View Full Version : Script problems
Wrycu
11-17-2006, 01:35 AM
I have tried four different scripts, and every time i get:
Line 51: Out of range
I don't know what i did wrong... i have:
Players[1].Name :='f_follower';
Players[1].Pass :='PASSWORDHERE';
Players[1].Nick :='fol';
Players[1].Active:=True;
why does it error? (it says that my username is out of range)
Also, everything in the form for fizzup's autominer needs to be a number, right? Cause it wont work and ive spent three hours trying to get it to work.
IronTeapot
11-17-2006, 03:07 AM
Have you tried placing a space instead of the _? i believe that it will not recognize/know what to do with shifted characters.
Pentti
11-17-2006, 11:57 AM
Does you have "SetUpSRL" begining of your script? If not, it gives you that error. And is your declareplayers procedure like this:
procedure Declareplayers;
begin
HowManyPlayers:=1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:=0;
Players[0].Name :='Name'
Players[0].Pass := 'Pass'
Players[0].Nick := 'Nick'
Players[0].Active:=True;
end;
Wrycu
11-17-2006, 12:01 PM
THanks, ill try it later tonight. Got other stuffs to do right now. Like school.
Wrycu
11-17-2006, 07:02 PM
Nope, i still get out of range. I am using 'SRL powerminer 2.5b'.
My script is:
Begin
HowManyPlayers:=1;
NumberOfPlayers( HowManyPlayers );
CurrentPlayer := StartPlayer;
Players[0].Name :='ffollower';
Players[0].Pass := 'PASSWORDHERE';
Players[0].Nick := 'fol';
Players[0].Active:=True;
For when its actually run, I set
How many players? as one.
for starting player, i set it as one. i have tried zero as well, to no avail. And, just to make sure, everything in that has to be an integer, right? because whenever i put a non integer it errors, saying its not a valid integer.
Infantry001
11-18-2006, 03:26 AM
make currentplayer := 0
Wrycu
11-18-2006, 03:30 AM
Tried that, and got an error. Im completely baffled as to why it errors. I code, so i can understand this and follow most of it and i dont see how its out of range... i tried it with two characters, and it worked. So im guessing it needs more than one. I made three accounts just now to be used...
Infantry001
11-18-2006, 04:02 AM
hmm me too. are there other players in DeclarePlayers?
Wrycu
11-18-2006, 04:05 AM
Nope. And i even tried it with them all set to .active = true, incase that had some odd affect. not a clue.
Boreas
11-18-2006, 04:21 AM
what do you mean all? does it look like this
Players[0].Name :='ffollower';
Players[0].Pass := 'PASSWORDHERE';
Players[0].Nick := 'fol';
Players[0].Active:=True;
Players[1].Name :='ffollower';
Players[1].Pass := 'PASSWORDHERE';
Players[1].Nick := 'fol';
Players[1].Active:=True;
Players[2].Name :='ffollower';
Players[2].Pass := 'PASSWORDHERE';
Players[2].Nick := 'fol';
Players[2].Active:=True;
etc
If you are only using one player you have to delete the other blocks, and just keep that one with [0]
if this doesn't work then post the whole thing
Wrycu
11-18-2006, 03:58 PM
Wait, if im using a certain number of players, i need to remove the rest of the player code?
I just tried it with three players and got an error. Ill post the entire thing. This is the SRL powerminer 2.5b
Procedure DeclarePlayers;
Begin
NumberOfPlayers( HowManyPlayers );
CurrentPlayer := StartPlayer;
Players[0].Name :='F ******';
Players[0].Pass :='PWHERE';
Players[0].Nick :='smi';
Players[0].Active:=True;
Players[0].String1 := 'Tin'; // Primairy Ore Color
Players[0].String2 := 'Copper'; // Secondairy Ore Color wont be mined as much as 1.
Players[0].String3 := 'Tin'; // Third Ore Color, won't be mined as much as 1 and 2.
Players[0].Boolean1 := True; // Is The Pick Equipped?
Players[1].Name :='F ******';
Players[1].Pass :='PWHERE';
Players[1].Nick :='min';
Players[1].Active:=True;
Players[1].String1 := 'Tin'; // Primairy Ore Color
Players[1].String2 := 'Copper'; // Secondairy Ore Color wont be mined as much as 1.
Players[1].String3 := 'Tin'; // Third Ore Color, won't be mined as much as 1 and 2.
Players[1].Boolean1 := True; // Is The Pick Equipped?
Players[2].Name :='1337*****';
Players[2].Pass :='PWHERE'
Players[2].Nick :='1337';
Players[2].Active:=True;
Players[2].String1 := 'Tin'; // Primairy Ore Color
Players[2].String2 := 'Copper'; // Secondairy Ore Color wont be mined as much as 1.
Players[2].String3 := 'Tin'; // Third Ore Color, won't be mined as much as 1 and 2.
Players[2].Boolean1 := True; // Is The Pick Equipped?
Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :='';
Players[3].Active:=False;
Players[3].String1 := 'Iron'; // Primairy Ore Color
Players[3].String2 := 'Iron'; // Secondairy Ore Color wont be mined as much as 1.
Players[3].String3 := 'Iron'; // Third Ore Color, won't be mined as much as 1 and 2.
Players[3].Boolean1 := True; // Is The Pick Equipped?
Players[4].Name :='';
Players[4].Pass :='';
Players[4].Nick :='';
Players[4].Active:=False;
Players[4].String1 := 'Iron'; // Primairy Ore Color
Players[4].String2 := 'Iron'; // Secondairy Ore Color wont be mined as much as 1.
Players[4].String3 := 'Iron'; // Third Ore Color, won't be mined as much as 1 and 2.
Players[4].Boolean1 := True; // Is The Pick Equipped?
Players[5].Name :='';
Players[5].Pass :='';
Players[5].Nick :='';
Players[5].Active:=False;
Players[5].String1 := 'Iron'; // Primairy Ore Color
Players[5].String2 := 'Iron'; // Secondairy Ore Color wont be mined as much as 1.
Players[5].String3 := 'Iron'; // Third Ore Color, won't be mined as much as 1 and 2.
Players[5].Boolean1 := True; // Is The Pick Equipped?
Writeln( IntToStr ( HowManyPlayers ) + ' Players' );
End;
Sorry for the stars in the name, just incase anyone sees this and attempts to report my chars without actually seeing them or something. I got an error... im gonna download the no form version now and try that. Any ideas on why its erroring, however?
-Edit-
I got the formless version and ran it. It logged me in, looked at my stats, my inventory, set me to run and... moved the mouse around. It refused to do anything else. Dunno why... :-/. HELP? lol.
-/Edit-
tarajunky
11-18-2006, 04:14 PM
If you only have 3 players, you should delete the rest of the empty values.
The 'Out of range' error happens when you have an array of a fixed value, like let's say 5, and then you try to put data into 6, 7, or 8. That causes an error because there are only 5 spots in the array.
HowManyPlayers tells SRL how large to make the player array. So, if you only have 1 player, HowManyPlayers should be set to 1, and you should only have one set of player information, and you start at 0, not 1.
Players[0].Name:='blah';
Players[0].Pass:='blah';
Players[0].Nick:='lah';
Players[0].Active:=True;
...
...
...
end;
After this one entry, there should not be any more players below. It should just be the one and then end;
If you want 2 players, you set HowManyPlayers:=2, then have 2 sets of player data.
Players[0].Name:='P1';
...
...
...
Players[1].Name:='P2';
...
...
...
end;
Now, what if you have another set that is "empty"?
Players[2].Name:='';
Players[2].Pass:='';
...
...
Well you might look at that and say there isn't a player there so no big deal. But SCAR looks at that number 2, compares it back to your array size specified by HowManyPlayers, notices that its only supposed to be two units large, and spits out an 'Out of range' error.
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.