Results 1 to 7 of 7

Thread: How to run the same player more than once?

  1. #1
    Join Date
    Feb 2008
    Location
    Norway
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default How to run the same player more than once?

    When I'm running Narcles Autofighter(the free script), I don't wish to use more than one player, however I do want to log out after 9 minutes(to avoid randoms), and log in again. When I just try to set the same player in twice, it won't log in again. :S This is what I've tried:


    procedure DeclarePlayers;
    begin
    if not(UseForm) then
    begin
    HowManyPlayers := 2;//Change this accordinly
    NumberOfPlayers(HowManyPlayers);
    CurrentPlayer := 0;

    Players[0].Name :='lalalala'; //Character Name
    Players[0].Pass :='hahaha'; //Character Pass
    Players[0].Nick :='lala'; //Nickname 3 - 4 Letter's of char name
    Players[0].Active:=True; //True if you want this player to be ran in the script, false if not
    Players[0].Booleans[0] := false;//Ranging? true/false
    Players[0].Booleans[1] := true;//Eat food?
    Players[0].Integers[0] := 7371129;//1st color of monster
    Players[0].Integers[1] := 1253197;//2nd color of monster
    Players[0].Integers[2] := 5789791;//3rd color of monster
    Players[0].Integers[3] := 24;//hitpoints
    Players[0].Integers[4] := 9;//Kill monster for? in minutes.
    Players[0].Strings[0] := 'eleton';//monster name
    Players[0].Strings[1] := 'attack'; //the skill you want to train > strength, attack, defence, whipdefence, pure, even, accurate, rapid or longrange <
    Players[0].Strings[2] := 's';//Player run direction > n, e, s, w <

    Players[1].Name :='lalalala'; //Character Name
    Players[1].Pass :='hahaha'; //Character Pass
    Players[1].Nick :='lala'; //Nickname 3 - 4 Letter's of char name
    Players[1].Active:=True; //True if you want this player to be ran in the script, false if not
    Players[1].Booleans[0] := false;//Ranging? true/false
    Players[1].Booleans[1] := true;//Eat food?
    Players[1].Integers[0] := 7371129;//1st color of monster
    Players[1].Integers[1] := 1253197;//2nd color of monster
    Players[1].Integers[2] := 5789791;//3rd color of monster
    Players[1].Integers[3] := 24;//hitpoints
    Players[1].Integers[4] := 9;//Kill monster for? in minutes.
    Players[1].Strings[0] := 'eleton';//monster name
    Players[1].Strings[1] := 'attack'; //the skill you want to train > strength, attack, defence, whipdefence, pure, even, accurate, rapid or longrange <
    Players[1].Strings[2] := 's';//Player run direction > n, e, s, w <

  2. #2
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    You could add a sleep time every 9 minutes

  3. #3
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    procedure DeclarePlayers;
    begin
    if not(UseForm) then
    begin
    HowManyPlayers := 1;//Change this accordinly MAKE THIS ONE THEN THERES NO MORE WORRIES
    NumberOfPlayers(HowManyPlayers);
    CurrentPlayer := 0;

    Players[0].Name :='lalalala'; //Character Name
    Players[0].Pass :='hahaha'; //Character Pass
    Players[0].Nick :='lala'; //Nickname 3 - 4 Letter's of char name
    Players[0].Active:=True; //True if you want this player to be ran in the script, false if not
    Players[0].Booleans[0] := false;//Ranging? true/false
    Players[0].Booleans[1] := true;//Eat food?
    Players[0].Integers[0] := 7371129;//1st color of monster
    Players[0].Integers[1] := 1253197;//2nd color of monster
    Players[0].Integers[2] := 5789791;//3rd color of monster
    Players[0].Integers[3] := 24;//hitpoints
    Players[0].Integers[4] := 9;//Kill monster for? in minutes.
    Players[0].Strings[0] := 'eleton';//monster name
    Players[0].Strings[1] := 'attack'; //the skill you want to train > strength, attack, defence, whipdefence, pure, even, accurate, rapid or longrange <
    Players[0].Strings[2] := 's';//Player run direction > n, e, s, w <

    then delete the other lines and just have that, alt u can just set
    SCAR Code:
    Players[0].Active:=True; //True if you want this player to be ran in the script, false if not
    false like so
    SCAR Code:
    Players[0].Active:=False; //True if you want this player to be ran in the script, false if not

    ~Spaz

  4. #4
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    If spaz's method doesn't work, try this:
    In the main loop (not the actual Begin to End. but where it calls all the procedures/functions in a repeat loop) call the procedure timeCheck; and in the var section add 'logtime: Integer' and lastly add this code:
    SCAR Code:
    Procedure timeCheck;
    Begin
      If(logtime = 0) Then
        marktime(logtime);
      If(timefrommark(logtime)>(60*9*1000)) Then
      Begin
        Logout;
        Sleep(RandomRange(15000,30000))
        Logtime:=0;
        Login;
      End;
    End;
    That should work (haven't tested it) though it may mess with the script if it already has a timer for logging out (in which case find it and change it to 9 minutes)

  5. #5
    Join Date
    Feb 2008
    Location
    Norway
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    spaz, i tried what you said, but it still didn't solve the problem. It clicks on the "Existing user" - button, but it doesn't type in the username and password, and then it presses "Log in", and so it goes on and on without logging in.
    Whats that sleeptime you were talking about richard? I'm kinda new, but could you please give an example?

    Mixter, could you try to explain where to put it in baby language? :P

  6. #6
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    marktime just makes the integer count the milliseconds and gives it that value (so for every second the script runs after calling marktime, the variable increases by 1000 as there are 1000 milliseconds in a second). When the time since the mark was made is bigger than 9 minutes (which is 1000 (a second) times'd by 60 (a minute) times'd by 9 (9 minutes)). When that is the case, it logs out the player then waits for a random time between 15 seconds and 30 seconds (RandomRange just pickesa random number between the 2 values). It then resets the variable it uses to store the time.

    You would then put the actual code ('procedure timecheck; etc') anytime before the main loop of the script. In the main loop, find where most of the procedures are called in a repeat loop then put 'timecheck;' on any new line there.

  7. #7
    Join Date
    Feb 2008
    Location
    Norway
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mixster05 View Post
    marktime just makes the integer count the milliseconds and gives it that value (so for every second the script runs after calling marktime, the variable increases by 1000 as there are 1000 milliseconds in a second). When the time since the mark was made is bigger than 9 minutes (which is 1000 (a second) times'd by 60 (a minute) times'd by 9 (9 minutes)). When that is the case, it logs out the player then waits for a random time between 15 seconds and 30 seconds (RandomRange just pickesa random number between the 2 values). It then resets the variable it uses to store the time.

    You would then put the actual code ('procedure timecheck; etc') anytime before the main loop of the script. In the main loop, find where most of the procedures are called in a repeat loop then put 'timecheck;' on any new line there.
    Still don't understand. Sorry I don't understand where to put that code in your first post...
    Im very new to scripting, but hey this help section:P
    I have read a few tuts tho.

    Edit: Ok, now I tried with 2 players, and it couldn't log in the second player. Guess it's just something wrong with the script.

    EDIT!!!: Problem solved. All i had to do was to play RS in Mozilla. Rofl.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Ultimate Merchanter (first player to player seller!)
    By Timothegreat in forum RS3 Outdated / Broken Scripts
    Replies: 63
    Last Post: 05-14-2009, 02:07 PM
  2. Player not found in player array?quikchat?
    By jerrysyron in forum OSR Help
    Replies: 2
    Last Post: 08-01-2008, 12:44 AM
  3. Help with mp4 player pls
    By HISTORY in forum News and General
    Replies: 4
    Last Post: 05-16-2006, 11:14 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
  •