Forums → Programming Forum → Armorbot Help
5 | 4522 |
I'm trying to add a Armorbot high score table in my game using actionscript 1.0. Everything except the name submission works (only submits blank names) and I don't know what is causing this. I have relooked at my variables several times and don't believe that is the problem.
Any help, please?
- 5 Replies
You might be able to narrow down the problem to one of two areas in the code:
A) Where the name string is originally given the players name.
B) Where the name is sent to Armorbot.
I would try using the trace function to output the name string. Output the name string just after 'A' and right before 'B'. This would help you narrow down where the problem is.
If your new to actionscript, here's how you call the trace function:
trace(name);
If you still need help, I suggest posting some of the code on here. It would be easier if there was something to look at.
my code currently looks like this;
//Send Highscore AS1.0 // Armor Bot Rankz
function __rankz_send__(par1,par2,par3,par4){
trace(par3);
par227 = new LoadVars();
par228 = new LoadVars();
par227.flashkey = par2;
par227.SU0249 = par1;
par227.bmFtZTE = par3;
par227.c2NvcmUx = par4+"Z";
par227.c2NvcmUx = par227.c2NvcmUx.split("0".join("U"
par227.c2NvcmUx = par227.c2NvcmUx.split("".join("A"
par227.c2NvcmUx = par227.c2NvcmUx.split("AU".join("Y"
par227.c2NvcmUx = par227.c2NvcmUx.split("A1".join("B"
par227.c2NvcmUx = par227.c2NvcmUx.split(".".join("N"
par227.flashkey = par227.flashkey.split("=".join(""
par227.SU0249 = par227.SU0249.split("=".join(""
par228.onLoad = function(success){
if(success){
trace(par228.msg);
}else{
trace(par228.loaded);
}
}
}
trace(_root.myName.text);
bXlnYW1lX25hbWVfdmFyaWFibGU = _root.myName.text;
bXlnYW1lX3Njb3JlX3ZhcmlhYmxl = _root.score;
__rankz_send__("MzM0MGolZSVhJW4lcw==", "ZVNXS2RhalA=", bXlnYW1lX25hbWVfdmFyaWFibGU, bXlnYW1lX3Njb3JlX3ZhcmlhYmxl);
//Send Highscore AS1.0 END
stop();
Well, the code looks fine. I have a theory though:
Are you only setting bXlnYW1lX25hbWVfdmFyaWFibGU with _root.myName.text only once at start up? If so, then _root.myName.text is an empty string to start with. So when you call __rankz_send__, you do so without first setting bXlnYW1lX25hbWVfdmFyaWFibGU with an actual name.
Try encapsulating this section of code
trace(_root.myName.text);
bXlnYW1lX25hbWVfdmFyaWFibGU = _root.myName.text;
bXlnYW1lX3Njb3JlX3ZhcmlhYmxl = _root.score;
__rankz_send__("MzM0MGolZSVhJW4lcw==", "ZVNXS2RhalA=", bXlnYW1lX25hbWVfdmFyaWFibGU, bXlnYW1lX3Njb3JlX3ZhcmlhYmxl);
into a function. Like this:
function submitScore(){
trace(_root.myName.text);
bXlnYW1lX25hbWVfdmFyaWFibGU = _root.myName.text;
bXlnYW1lX3Njb3JlX3ZhcmlhYmxl = _root.score;
__rankz_send__("MzM0MGolZSVhJW4lcw==", "ZVNXS2RhalA=", bXlnYW1lX25hbWVfdmFyaWFibGU, bXlnYW1lX3Njb3JlX3ZhcmlhYmxl);
}
This way, when you call submitScore you'll be setting bXlnYW1lX25hbWVfdmFyaWFibGU with the current name in _root.myName.text every time.
Does that makes sense? I hope that helps.
I have the same problem but with actionscript 2.0 :S
My code is
//Send Highscore AS2.0 // Armor Bot Rankz
import ab3.rankz.*;
function __rankz_send__(par1,par2,par3,par4){
par227 = new LoadVars();
par228 = new LoadVars();
par227.flashkey = par2;
par227.SU0249 = par1;
par227.bmFtZTE = Armor_Bot_30_En_AS1.Encode(par3);
par227.c2NvcmUx = Armor_Bot_30_En_AS1.Encode(par4+"j%e%a%n%s"
par227.flashkey = par227.flashkey.split("=".join(""
par227.SU0249 = par227.SU0249.split("=".join(""
par228.onLoad = function(success){
if(success){
trace(par228.msg);
}else{
trace(par228.loaded);
}
}
par227.sendAndLoad("http://rankz.armorbot.com/submit/",par228,"POST"
}
bXlnYW1lX25hbWVfdmFyaWFibGU = name;//replace my_name1_variable with your name variable (1)
bXlnYW1lX3Njb3JlX3ZhcmlhYmxl = score;//replace my_score1_variable with your score1 variable
__rankz_send__("MzY0NGolZSVhJW4lcw==", "UU9XSkxWdmI=", bXlnYW1lX25hbWVfdmFyaWFibGU, bXlnYW1lX3Njb3JlX3ZhcmlhYmxl);
//Send Highscore AS2.0 END
You must be logged in to post a reply!