Results 1 to 11 of 11

Thread: Multiplayer Help

  1. #1
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Multiplayer Help

    Im trying to add multiplayer to my script, but all it does is log in, then log out. What am I doing wrong? Thanks guys
    Simba Code:
    program Alcher;
    {$DEFINE SMART}
    {$i srl/srl.simba}
    const
    Loads = 5;  //How many Alchs to do?
    RuneA = True; //Are you only alching rune arrows? True if yes, false if no.

    var
    Loadsdone, Fail:Integer;
                                                     //SIMPLE ANTILEECH
                                                     //HINT: 1 VERY SIMPLE ANTILEECH IN MAINLOOP
    procedure DeclarePlayers;

    begin
      HowManyPlayers := 2;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      with Players[0] do
      begin
        Name:= ''; // Username Here
        Pass:= ''; // Password here
        Active:= True;
      end;

      with Players[1] do           //Copy and paste and change number for more players.
      begin
        Name:= ''; // Username Here
        Pass:= ''; // Password here
        Active:= True;
      end;
    end;

    Procedure Start;
    var
      RArrows, x, y:integer;
    begin
    RArrows := DTMFromString('mAAEAAHic42FgYIhmYmBIBeJ0IE4A4jAg9gfiQCAOAeIkJoiadKj4c0YGhsdA/ACI3wLxZyD+CMQvoOKvoPxbQPwGiF3UOYG2MBGNUxhIA4wkYmQAAD/rEFY=');
      if not loggedin then
        exit;
      if not existsitem(17) then
        begin
          if finddtm(RArrows, x, y, MIX1, MIY1, MIX2, MIY2) then
            begin
            Dragmouse(x, y, 1, 1, 575, 377, 1, 1);
            wait(randomrange(100,200));
            end else

          begin
          writeln('we couldnt find the arrows! Make sure we begin with them in your inv!');
          Logout;
          Terminatescript;
          end;
        end else
          gametab(Tab_magic);
        If existsitem(17) then
          gametab(tab_magic);
          FreeDtm(RArrows);
    end;


    Procedure alch;
    var
      x, y, RArrows, Highalch:integer;




    begin
    RArrows := DTMFromString('mAAEAAHic42FgYIhmYmBIBeJ0IE4A4jAg9gfiQCAOAeIkJoiadKj4c0YGhsdA/ACI3wLxZyD+CMQvoOKvoPxbQPwGiF3UOYG2MBGNUxhIA4wkYmQAAD/rEFY=');
    HighAlch := DTMFromString('mWAAAAHicY2FgYGhiYmCoBuIOIO4C4hdAsZdA/AqInwDxxV0SDIcWCDD0l7MynLtyi4EVKAbDXEDMiIZBAACvMwx0');
      if not loggedin then
        exit;
      if finddtm(HighAlch, x, y, MIX1, MIY1, MIX2, MIY2) then
        Mouse(x, y, 10, 10, 1) else
          exit;
      wait(randomrange(200,300));
      if finddtm(RArrows, x, y, MIX1, MIY1, MIX2, MIY2) then
        begin
          case random(10) of
            0..1: begin Mouse(x, y, 10, 10, 1);
            Loadsdone := Loadsdone + 1; end;
            2..10: begin clickmouse2(1)
             Loadsdone := Loadsdone + 1; end;
          end;
        end else
          begin
            Fail := Fail + 1 ;
            Gametab(tab_magic);
          end;
      wait(randomrange(900,1100));
      FreeDtm(RArrows);
      FreeDtm(HighAlch);
    end;



    procedure AntiBan;  //Antiban from leetzalcher, edited by me
    begin
      if(not(LoggedIn))then
        exit;
        writeln('Antiban time???');
      Findnoninventoryrandoms;

      Case Random (2750) of    //Change number inside brackets to increase/decrease number of antibans. Higher number = less antibans
        0..18: Begin SleepAndMoveMouse(5000 + Random(750)); GameTab(tab_Magic); End;
        19..24: Begin GameTab(tab_Inv) ExamineInv; GameTab(tab_Magic); SleepAndMoveMouse(2500 + Random(553)); End;
        25..42: Begin RandomAngle(1); End;
        43..48: Begin GameTab(Tab_Stats); Wait(3000 + Random(400)); GameTab(tab_Magic); SleepAndMoveMouse(2550 + Random(658)); End;
        49..54: Begin GameTab(tab_Stats) HoverSkill('random', False); GameTab(tab_Magic); SleepAndMoveMouse(2200 + Random(545)); End;
        55..60: Begin PickUpMouse; GameTab(tab_Magic); End;
        61..66: Begin RandomMovement;  GameTab(tab_Magic); End;
        67..72: Begin BoredHuman; GameTab(tab_Magic); End;
        73..80: Begin Examineinv; RandomRclick;  Pickupmouse; SleepAndMoveMouse(randomrange(2000, 5000)); end;
        End;
    end;

    Procedure MiniBreaker;   //Idea From Solidone40
    Begin
      if not loggedin then
        exit;

      Case Random (600) Of
        1: begin Writeln('MiniBreak!!!'); wait(randomrange(30000, 40000));  end;
        2: begin Writeln('Minibreak!!!'); Wait(randomrange(10000, 15000));  end;
        3: begin Writeln('Minibreak!!!'); Wait(randomrange(5000, 15000));  end;
        4: begin Writeln('Minibreak!!!'); Wait(randomrange(50000, 60000));  end;
      end;
    end;

    Procedure proggy;
    var
      XP, Alchs:Integer;

    begin
      if not loggedin then
        exit;
      XP := Loadsdone * 65
      Alchs := Loadsdone
      cleardebug;
      Writeln('Thanks for using Foootys Alcher!!!');
      Writeln('***************************************');
      Writeln('Time running = ' + (timerunning));
      Writeln('Total Alchs = ' + IntToStr(Alchs));
      Writeln('XP Earned = ' + IntToStr(XP));
      Writeln('Thank You For using Foootys Alcher!!!');
    end;

    Procedure Failz;
    var
      RArrows, x, y:integer;
    begin
      RArrows := DTMFromString('mAAEAAHic42FgYIhmYmBIBeJ0IE4A4jAg9gfiQCAOAeIkJoiadKj4c0YGhsdA/ACI3wLxZyD+CMQvoOKvoPxbQPwGiF3UOYG2MBGNUxhIA4wkYmQAAD/rEFY=');
        GameTab(26)
        if finddtm(RArrows, x, y, MIX1, MIY1, MIX2, MIY2) then
          begin
            Mouse(x, y, 2, 2, 1);
            Gametab(25);
          end else
            begin
              writeln('We appear to be All out of arrows! Logging out!!!');
              Logout;
              Terminatescript;
            end;
       if finddtm(RArrows, x, y, MIX1, MIY1, MIX2, MIY2) then
         begin
            Dragmouse(x, y, 1, 1, 575, 377, 1, 1);
            wait(randomrange(100,200));
            Gametab(28);
            wait(randomrange(200,300));
          end;
      FreeDtm(RArrows)
      Fail := 0;
    end;



    begin
     SetupSRL
      Declareplayers
      Loginplayer
      Activateclient
      Start
      repeat
        repeat
          Alch
          Antiban
          Minibreaker
          proggy
          if Fail >= 2 then
          Failz;
        until(Loads = Loadsdone) or (not loggedin);
      NextPlayer(Players[CurrentPlayer].Active);
      until(false);
    end.
    Last edited by Footy; 07-10-2012 at 05:25 PM.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  2. #2
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Erm, Why have you got TerminateScript in the mainloop?
    Edit: oh i see, can you paste the debug so we have a little more to work with?

  3. #3
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol, that was an antileech, removed that, still have an issue though. Read the updated OP
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  4. #4
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Can you post the debug so we have a little more to work with? does it work with single player?
    Edit : From what im seeing your script can't possibly ever finish, due to that little infinite loop at the end, the only possible way it can end is if you are calling terminatescript at a weird point, iv control f'd all your terminate scripts and they look close to FindDTM's this should mean your DTM's arn't accurate.
    Edit2 : to fix this i would recommend changing all your TerminateScripts except your antileech to NextPlayer(False); and change your infinte loop to Until(AllPlayersInactive)
    Last edited by Kasi; 07-10-2012 at 05:41 PM.

  5. #5
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It works perfectly with single player, just added the second declare players, if not logged in to each procedure, and a bit to the main loop. I tried it again, it will do the 5 alchs with the first account, but then log in to the second account and do nothing. Heres the Debug
    Code:
    Compiled successfully in 624 ms.
    SRL Compiled in 15 msec
    SMART Initialized.
    Loaded: Server 8, Members: False, Signed: True, Super Detail: False.
    Welcome to Runescape.
    My email
    Screenshot of: IP Log 43 Seconds
    Current player:My Email
    Antiban time???
    Thanks for using Foootys Alcher!!!
    ***************************************
    Time running = 55 Seconds
    Total Alchs = 1
    XP Earned = 65
    Thank You For using Foootys Alcher!!!
    Antiban time???
    Thanks for using Foootys Alcher!!!
    ***************************************
    Time running = 58 Seconds
    Total Alchs = 2
    XP Earned = 130
    Thank You For using Foootys Alcher!!!
    Antiban time???
    Thanks for using Foootys Alcher!!!
    ***************************************
    Time running = 1 Minutes and 0 Seconds
    Total Alchs = 3
    XP Earned = 195
    Thank You For using Foootys Alcher!!!
    Antiban time???
    Thanks for using Foootys Alcher!!!
    ***************************************
    Time running = 1 Minutes and 0 Seconds
    Total Alchs = 3
    XP Earned = 195
    Thank You For using Foootys Alcher!!!
    Antiban time???
    Thanks for using Foootys Alcher!!!
    ***************************************
    Time running = 1 Minutes and 2 Seconds
    Total Alchs = 4
    XP Earned = 260
    Thank You For using Foootys Alcher!!!
    Antiban time???
    Thanks for using Foootys Alcher!!!
    ***************************************
    Time running = 1 Minutes and 2 Seconds
    Total Alchs = 4
    XP Earned = 260
    Thank You For using Foootys Alcher!!!
    Antiban time???
    Thanks for using Foootys Alcher!!!
    ***************************************
    Time running = 1 Minutes and 2 Seconds
    Total Alchs = 4
    XP Earned = 260
    Thank You For using Foootys Alcher!!!
    Antiban time???
    Thanks for using Foootys Alcher!!!
    ***************************************
    Time running = 1 Minutes and 4 Seconds
    Total Alchs = 5
    XP Earned = 325
    Thank You For using Foootys Alcher!!!
    NextPlayer(True)
    SwitchToPlayer(PlayerNo: 1, Active: True);
    Welcome to Runescape.
    My Email
    Screenshot of: IP Log 1 Minutes and 19 Seconds
    Current player: My Email
    Antiban time???
    Thanks for using Foootys Alcher!!!
    ***************************************
    Time running = 1 Minutes and 25 Seconds
    Total Alchs = 5
    XP Earned = 325
    Thank You For using Foootys Alcher!!!
    NextPlayer(True)
    Successfully executed.
    The following DTMs were not freed: [2, 3, 4, 5, 6, 7, 8, 9]
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  6. #6
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    you need to reset Loadsdone to 0, try that and then reply if it hasnt made a difference

  7. #7
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hmm, I reset loadsdone inbetween
    Simba Code:
    until(Loads = Loadsdone) or (not loggedin);
      NextPlayer(Players[CurrentPlayer].Active);
    and fixed the terminatescript issue, but now It will do 5 alchs on the first player, then go to the second, and not do any alching, just fly through the loop again and again, printing hundreds of proggys...
    E: i reset loadsdone using Loadsdone := 0, I think thats the correct way to do it.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  8. #8
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by Foooty View Post
    Hmm, I reset loadsdone inbetween
    Simba Code:
    until(Loads = Loadsdone) or (not loggedin);
      NextPlayer(Players[CurrentPlayer].Active);
    and fixed the terminatescript issue, but now It will do 5 alchs on the first player, then go to the second, and not do any alching, just fly through the loop again and again, printing hundreds of proggys...
    E: i reset loadsdone using Loadsdone := 0, I think thats the correct way to do it.
    ah gimme a couple mins ill set it up on my chars.

  9. #9
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Goin out for about a half hour, Ill check when I get back, take your time!
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  10. #10
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by Foooty View Post
    Goin out for about a half hour, Ill check when I get back, take your time!
    :P okay ill clean up the script for you too -.-
    Edit : seems to be working, just bad logic i guess

    Simba Code:
    program Alcher;
    {$DEFINE SMART}
    {$i srl/srl.simba}

    Const
      RuneA = True; //Are you only alching rune arrows? True if yes, false if no.

    Var
     Fail:Integer;
                                                     //SIMPLE ANTILEECH
                                                     //HINT: 1 VERY SIMPLE ANTILEECH IN MAINLOOP
    Procedure DeclarePlayers;
    Begin
      HowManyPlayers := 2;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      With Players[0] Do
      Begin
        Name:= ''; // Username Here
        Pass:= ''; // Password here
        Integers[0] := 1000;                 // how many loads for this char here
        Active:= True;
      End;

      With Players[1] Do           //Copy and paste and change number for more players.
      Begin
        Name:= ''
        Pass:= '';
        Integers[0] := 5;
        Active:= True;
      End;
    End;

    Procedure Start;
    Var
      RArrows, x, y:integer;
    Begin
      Fail := 0;
      If Not loggedin Then
        Exit;
      If Not ExistsItem(17) Then
      Begin
        RArrows := DTMFromString('mAAEAAHic42FgYIhmYmBIBeJ0IE4A4jAg9gfiQCAOAeIkJoiadKj4c0YGhsdA/ACI3wLxZyD+CMQvoOKvoPxbQPwGiF3UOYG2MBGNUxhIA4wkYmQAAD/rEFY=');
        GameTab(25);
        if finddtm(RArrows, x, y, MIX1, MIY1, MIX2, MIY2) then
        begin
          Dragmouse(x, y, 5, 5, 575, 377, 5, 5);
          wait(randomrange(100,200));
          FreeDTM(RArrows);
          GameTab(28);
        end else
        begin
          writeln('we couldnt find the arrows! Make sure we begin with them in your inv!');
          FreeDtm(RArrows);
          NextPlayer(False);
        end;
      End;
      gametab(Tab_magic);
    end;


    Procedure alch;
    var
      x, y, RArrows, Highalch, P :integer;
    begin
      if not loggedin then
        exit;
      RArrows := DTMFromString('mAAEAAHic42FgYIhmYmBIBeJ0IE4A4jAg9gfiQCAOAeIkJoiadKj4c0YGhsdA/ACI3wLxZyD+CMQvoOKvoPxbQPwGiF3UOYG2MBGNUxhIA4wkYmQAAD/rEFY=');
      HighAlch := DTMFromString('mWAAAAHicY2FgYGhiYmCoBuIOIO4C4hdAsZdA/AqInwDxxV0SDIcWCDD0l7MynLtyi4EVKAbDXEDMiIZBAACvMwx0');

      MarkTime(P);
      While Not (GetCurrentTab = 28) Do
      Begin
        Wait(RandomRange(50, 100));
        If (TimeFromMark(P) >= 4000) Then
        Begin
          GameTab(28);
          Break;
        End;
      End;
      Wait(RandomRange(250, 350));
      if finddtm(HighAlch, x, y, MIX1, MIY1, MIX2, MIY2) then
        Mouse(x, y, 10, 10, True)
      else
      Begin
        FreeDTM(RArrows);
        FreeDTM(HighAlch);
        exit;
      End;
      MarkTime(P);
      While Not (GetCurrentTab = 25) Do
      Begin
        Wait(RandomRange(50, 100));
        If (TimeFromMark(P) >= 4000) Then
        Begin
          GameTab(25);
          Break;
        End;
      End;
      Wait(RandomRange(250, 350));
      if finddtm(RArrows, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
        case random(10) of
          0..1: begin
                  Mouse(x, y, 10, 10, 1);
                  Players[CurrentPlayer].Integers[1] := Players[CurrentPlayer].Integers[1] + 1;
                  wait(randomrange(1200,1500));
                end;
         2..10: begin
                  clickmouse2(1)
                  Players[CurrentPlayer].Integers[1] := Players[CurrentPlayer].Integers[1] + 1;
                  wait(randomrange(1200,1500));
                end;
        end;
        FreeDtm(RArrows);
        FreeDtm(HighAlch);
        Wait(RandomRange(500, 650));
        Exit;
      End;
      FreeDtm(RArrows);
      FreeDtm(HighAlch);
      Fail := Fail + 1;
      WriteLn(Fail);
    end;

    procedure AntiBan;  //Antiban from leetzalcher, edited by me
    begin
      if(not(LoggedIn))then
        exit;
      writeln('Antiban time???');
      Findnoninventoryrandoms;

      Case Random (2750) of    //Change number inside brackets to increase/decrease number of antibans. Higher number = less antibans
        0..18: Begin SleepAndMoveMouse(5000 + Random(750)); GameTab(tab_Magic); End;
        19..24: Begin GameTab(tab_Inv) ExamineInv; GameTab(tab_Magic); SleepAndMoveMouse(2500 + Random(553)); End;
        25..42: Begin RandomAngle(1); End;
        43..48: Begin GameTab(Tab_Stats); Wait(3000 + Random(400)); GameTab(tab_Magic); SleepAndMoveMouse(2550 + Random(658)); End;
        49..54: Begin GameTab(tab_Stats) HoverSkill('random', False); GameTab(tab_Magic); SleepAndMoveMouse(2200 + Random(545)); End;
        55..60: Begin PickUpMouse; GameTab(tab_Magic); End;
        61..66: Begin RandomMovement;  GameTab(tab_Magic); End;
        67..72: Begin BoredHuman; GameTab(tab_Magic); End;
        73..80: Begin Examineinv; RandomRclick;  Pickupmouse; SleepAndMoveMouse(randomrange(2000, 5000)); end;
        End;
    end;

    Procedure MiniBreaker;   //Idea From Solidone40
    Begin
      if not loggedin then
        exit;

      Case Random (600) Of
        1: begin Writeln('MiniBreak!!!'); wait(randomrange(30000, 40000));  end;
        2: begin Writeln('Minibreak!!!'); Wait(randomrange(10000, 15000));  end;
        3: begin Writeln('Minibreak!!!'); Wait(randomrange(5000, 15000));  end;
      end;
    end;

    Procedure proggy;
    var
      XP, Alchs:Integer;
    begin
      if not loggedin then
        exit;
      XP := Players[CurrentPlayer].Integers[1] * 65
      Alchs := Players[CurrentPlayer].Integers[1]
      //cleardebug;
      Writeln('Thanks for using Foootys Alcher!!!');
      Writeln('***************************************');
      Writeln('Time running = ' + (timerunning));
      Writeln('Total Alchs = ' + IntToStr(Alchs));
      Writeln('XP Earned = ' + IntToStr(XP));
      Writeln('Thank You For using Foootys Alcher!!!');
    end;

    Procedure Failz;
    var
      RArrows, x, y:integer;
    begin
      RArrows := DTMFromString('mAAEAAHic42FgYIhmYmBIBeJ0IE4A4jAg9gfiQCAOAeIkJoiadKj4c0YGhsdA/ACI3wLxZyD+CMQvoOKvoPxbQPwGiF3UOYG2MBGNUxhIA4wkYmQAAD/rEFY=');
      GameTab(26)
      if finddtm(RArrows, x, y, MIX1, MIY1, MIX2, MIY2) then
      Begin
        Mouse(x, y, 5, 5, True);
        Start;
      end else
      begin
        writeln('We appear to be All out of arrows! Logging out!!!');
        NextPlayer(False);
        Start;
      end;
      if finddtm(RArrows, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
        Dragmouse(x, y, 5, 5, 575, 377, 5, 5);
        wait(randomrange(100,200));
        Gametab(28);
        wait(randomrange(200,300));
      end;
      FreeDTM(RArrows);
      Fail := 0;
    end;



    begin
      {$IFDEF SMART}
        SMART_Server := 83;
        SMART_Members := True;
        SMART_Signed := True;
        SMART_SuperDetail := False;
      {$ENDIF}
      SetupSRL;
      Declareplayers;
      LogInPlayer;
      repeat
        If LoggedIn Then Start;
        repeat
          Alch;
          Antiban;
          Minibreaker;
          proggy;
          if Fail >= 2 then
            Failz;
        until((Players[CurrentPlayer].Integers[1] >= Players[CurrentPlayer].Integers[0]) or (not loggedin));
        NextPlayer(Not (Players[CurrentPlayer].Integers[1] >= Players[CurrentPlayer].Integers[0]))
      until(AllPlayersInactive);
    end.
    Last edited by Kasi; 07-10-2012 at 08:03 PM.

  11. #11
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Testing it Now! I'm assuming this switches players when it runs out of arrows? Thanks so much, and +rep
    E: nevermind, didnt see the integer in Declareplayers
    Last edited by Footy; 07-10-2012 at 08:50 PM.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

Thread Information

Users Browsing this Thread

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

Posting Permissions

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