pokemonmasteraaron
The blind Pokémon Master!
- 323
- Posts
- 13
- Years
- In the forest of an undiscovered region
- Seen May 14, 2024
You needed to relax anyway.
btw, I'm the 2012th viewer of this thread :P
btw, I'm the 2012th viewer of this thread :P
You needed to relax anyway.
btw, I'm the 2012th viewer of this thread :P
i knew it. u cant script. copiing the script failed and youhave no idea what to do.
my opinion cya
I can't wait to php file, please make it quickly.
<?php
$host="Localhost";
$user="root";
$pass="";
$base="pokemon";
$port=3306;
$sql=mysql_connect($host,$user,$pass,$base,$port) or die("Cannot connect to MySQL");
$request = $_GET['Request'];
if ($request == "delete_pokemon") {
$code = $_GET['Code'];
mysql_query("DELETE FROM Trades WHERE Code=$code") or die("Cannot delete".$code."From Trades");
}
if ($request == "taken_pokemon") {
$poke=$_GET['Pokemon'];
$ech=mysql_query("FROM Trades SELECT Taken WHERE Pokemon=$poke") or die("Cannot Select".$Poke."From Trades");
}
if ($request == "send_pokemon") {
$code=$_GET['Code'];
$poke=$_GET['Pokemon'];
$level=$_GET['Level'];
$level1=$_GET['Level1'];
$level2=$_GET['Level2'];
$wanted=$_GET['Wanted'];
mysql_query("INSERT INTO Trades Code=$code,Pokemon=$poke,Level=$level,Wanted=$wanted,Level1=$level1,Level2=$level2,Taken='No'") or die("Cannot insert Query.");
}
if ($request == "get_pokemon") {
$poke=$_GET['Pokemon'];
$level1=$_GET['Level1'];
$levle2=$_GET['Level2'];
$ech=mysql_query("FROM Trades SELECT * WHERE Pokemon=$poke and Level>$level1 and Level<$level2") or die("None");
}
if ($request == "get_all") {
$ech=mysql_query("FROM Trades SELECT *") or die("Error!");
}
die($ech);
$sql_close;
?>
Ok so i tested it, i got few errors, pokemon stores online but cant finish trade + some bugs. here are screens.
First screen Pokemon is stored but is not on the lsit but when i press space it continue.
https://dl.dropbox.com/u/4212314/Gts errpr/capture018.png
And here is something messed
https://dl.dropbox.com/u/4212314/Gts errpr/capture019.png
and error when want to finish trade.
Spoiler:Exception: RuntimeError
Message: Script error within event 18, map 11 (Pokój Simona):
Exception: NoMethodError
Message: Section171:88:in `pbCompleteTradeGTS'undefined method `ConvertToString' for 0:Fixnum
***Full script:
pbStartGTS()
Interpreter:243:in `pbExecuteScript'
PokemonGts:474:in `pbGetTradeResults'
PokemonGts:421:in `pbStartSearchGTS'
PokemonGts:406:in `pbSearchListGTS'
PokemonGts:349:in `loop'
PokemonGts:409:in `pbSearchListGTS'
PokemonGts:56:in `pbStartGTS'
PokemonGts:36:in `loop'
PokemonGts:58:in `pbStartGTS'
(eval):1:in `pbExecuteScript'
Thankyou for this awesome feature
Can you help me? after pressing search for pokemon and put the pokemon i want i get this error:
Spoiler:---------------------------
Pokemon Essentials
---------------------------
Exception: RuntimeError
Message: Script error within event 32, map 25 (Test Map 2):
Exception: TypeError
Message: Section143:434:in `+'cannot convert Fixnum into Array
***Full script:
pbStartGTS()
Interpreter:243:in `pbExecuteScript'
tra:434:in `pbGetGTSTradeListing'
tra:417:in `pbStartSearchGTS'
tra:406:in `pbSearchListGTS'
tra:349:in `loop'
tra:409:in `pbSearchListGTS'
tra:56:in `pbStartGTS'
tra:36:in `loop'
tra:58:in `pbStartGTS'
(eval):1:in `pbExecuteScript'
Interpreter:276:in `pbExecuteScript'
Interpreter:1593:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'
Scene_Map:114:in `update'
Scene_Map:68:in `main'
Hope it will be out soon.
EDIT:A few comments about your php script. Bolded is how to improve/fix the issue
First off, pbpPostData in essentials sends requests using $_POST not $_GET.
Any $_GET should be $_POST
Also, any variables you send from the essentials script need to be sanitised before use in php otherwise you'll be open to sql injection which could potentially wipe out your database or have others insert unauthorised data into it if they managed to get hold of the url, which is pretty easy to do
You need to use mysql_real_escape_string() on all variables
e.g.
$ech=mysql_query("FROM Trades SELECT * WHERE Pokemon=".mysql_real_escape_string($poke)." and Level>".mysql_real_escape_string($level1)." and Level<".mysql_real_escape_string($level2)."") or die("None");
Your final $sql_close; at the end won't do anything since anything after a die() call isn't executed. You shouldn't be using die() to output data anyway.
Change the die to an echo or print
Its better to use elseif statements not several ifs since you're only going to be sending one request at once, and for each request its going to go through the whole script each time, which takes more time in the long run than elseif. With elseif it'd go through only until the criteria is met.
Use elseifs
e.g.
if(this>1){
do this
} elseif (this>2) {
do this
} else
do this
}
I don't know what I do bad, but when i call script pbStartGTS() and choose my Pokemon to trade nad press "Trade" i have an error: No pokemon chosen. This is screen for this error:
Ho-oh doy you know, what i do bad?