Log in

View Full Version : Multiplayer Help



Footy
07-10-2012, 05:20 PM
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
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('mAAEAAHic42FgYIhmYmBIBeJ0IE4A4jAg9g fiQCAOAeIkJoiadKj4c0YGhsdA/ACI3wLxZyD+CMQvoOKvoPxbQPwGiF3UOYG2MBGNUxhIA4wkYmQ AAD/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('mAAEAAHic42FgYIhmYmBIBeJ0IE4A4jAg9g fiQCAOAeIkJoiadKj4c0YGhsdA/ACI3wLxZyD+CMQvoOKvoPxbQPwGiF3UOYG2MBGNUxhIA4wkYmQ AAD/rEFY=');
HighAlch := DTMFromString('mWAAAAHicY2FgYGhiYmCoBuIOIO4C4hdAsZ dA/AqInwDxxV0SDIcWCDD0l7MynLtyi4EVKAbDXEDMiIZBAACvMwx 0');
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('mAAEAAHic42FgYIhmYmBIBeJ0IE4A4jAg9g fiQCAOAeIkJoiadKj4c0YGhsdA/ACI3wLxZyD+CMQvoOKvoPxbQPwGiF3UOYG2MBGNUxhIA4wkYmQ AAD/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.

Kasi
07-10-2012, 05:27 PM
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?

Footy
07-10-2012, 05:28 PM
Lol, that was an antileech, removed that, still have an issue though. Read the updated OP

Kasi
07-10-2012, 05:30 PM
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)

Footy
07-10-2012, 05:37 PM
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

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]

Kasi
07-10-2012, 05:45 PM
you need to reset Loadsdone to 0, try that and then reply if it hasnt made a difference

Footy
07-10-2012, 05:53 PM
Hmm, I reset loadsdone inbetween 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.

Kasi
07-10-2012, 06:00 PM
Hmm, I reset loadsdone inbetween 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.

Footy
07-10-2012, 06:01 PM
Goin out for about a half hour, Ill check when I get back, take your time! :D

Kasi
07-10-2012, 06:03 PM
Goin out for about a half hour, Ill check when I get back, take your time! :D

:P okay ill clean up the script for you too -.-
Edit : seems to be working, just bad logic i guess


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('mAAEAAHic42FgYIhmYmBIBeJ0IE4A4jAg9g fiQCAOAeIkJoiadKj4c0YGhsdA/ACI3wLxZyD+CMQvoOKvoPxbQPwGiF3UOYG2MBGNUxhIA4wkYmQ AAD/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('mAAEAAHic42FgYIhmYmBIBeJ0IE4A4jAg9g fiQCAOAeIkJoiadKj4c0YGhsdA/ACI3wLxZyD+CMQvoOKvoPxbQPwGiF3UOYG2MBGNUxhIA4wkYmQ AAD/rEFY=');
HighAlch := DTMFromString('mWAAAAHicY2FgYGhiYmCoBuIOIO4C4hdAsZ dA/AqInwDxxV0SDIcWCDD0l7MynLtyi4EVKAbDXEDMiIZBAACvMwx 0');

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('mAAEAAHic42FgYIhmYmBIBeJ0IE4A4jAg9g fiQCAOAeIkJoiadKj4c0YGhsdA/ACI3wLxZyD+CMQvoOKvoPxbQPwGiF3UOYG2MBGNUxhIA4wkYmQ AAD/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.

Footy
07-10-2012, 08:45 PM
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