Results 1 to 12 of 12

Thread: Script problems

  1. #1
    Join Date
    Nov 2006
    Posts
    235
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Autoer problems: cannot Auto using scripts

    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:
    Code:
         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.

  2. #2
    Join Date
    Oct 2006
    Posts
    412
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Have you tried placing a space instead of the _? i believe that it will not recognize/know what to do with shifted characters.

  3. #3
    Join Date
    Jun 2006
    Location
    USA
    Posts
    1,828
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Does you have "SetUpSRL" begining of your script? If not, it gives you that error. And is your declareplayers procedure like this:
    SCAR Code:
    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;

  4. #4
    Join Date
    Nov 2006
    Posts
    235
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    THanks, ill try it later tonight. Got other stuffs to do right now. Like school.

  5. #5
    Join Date
    Nov 2006
    Posts
    235
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nope, i still get out of range. I am using 'SRL powerminer 2.5b'.
    My script is:
    Code:
    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.

  6. #6
    Join Date
    Jun 2006
    Posts
    1,492
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    make currentplayer := 0

  7. #7
    Join Date
    Nov 2006
    Posts
    235
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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...

  8. #8
    Join Date
    Jun 2006
    Posts
    1,492
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hmm me too. are there other players in DeclarePlayers?

  9. #9
    Join Date
    Nov 2006
    Posts
    235
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nope. And i even tried it with them all set to .active = true, incase that had some odd affect. not a clue.

  10. #10
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    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

  11. #11
    Join Date
    Nov 2006
    Posts
    235
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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
    Code:
    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-

  12. #12
    Join Date
    Mar 2006
    Posts
    3,051
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Help with a few problems in my script
    By Warflight in forum OSR Help
    Replies: 3
    Last Post: 01-25-2009, 09:58 AM
  2. First Script(Problems)
    By earthgas in forum First Scripts
    Replies: 7
    Last Post: 12-12-2008, 10:33 PM
  3. Problems with a script.:(
    By h4lofr3ak in forum OSR Help
    Replies: 19
    Last Post: 02-09-2008, 10:59 AM
  4. Having problems with my first script
    By darkfire355 in forum OSR Help
    Replies: 2
    Last Post: 01-27-2008, 12:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •