Log in

View Full Version : Problem with NextPlayer(False)



Exilus
02-07-2012, 03:39 AM
I can run scripts great on simba, yet there seems to be something wrong, sometime it randomly decides to open the log-out page, and click "sign out". then it just sits at the lobby page.

I noticed everytime this happens, "NextPlayer(False)" appears in the log, just after the bot stats (running time, wins, loses) log.

it can happen after 2 mins of running just like it can happen after 3 hours.

What's causing this? I guess it might be caused by the nextplayer option but how do i fix that?

Im running P1nky's pest controller.

Spiker
02-07-2012, 07:15 PM
I'm lazy and don't feel like searching for the script. Will you post the code. Most likely what's happening is it doesn't recognize something and a fail safe is logging it out. If you had another player listed, it would log into them next. However, with just one player's info, it would just log you out as you've experienced.

Good Luck

Exilus
02-07-2012, 07:38 PM
I have changed every "If X then Nextplayer(False)" to "If X then Nextplayer(True)"


script's been running 4 hours without logging off.



Well here's the script (modified so that they all say Nextplayer(true) instead of Nextplayer(false)):

program PestControllerBETA;
{$DEFINE SMART}
{$i srl\srl.simba}

//P1nky's PestController
//BETA Version

const
SpecialAttacks = False;
SRLStats_Username = ''; // Your SRL Stats Username (Optional) Register here: http://stats.villavu.com/
SRLStats_Password = '';// Your SRL Stats Password (Optional) Register here: http://stats.villavu.com/

//Will add more features later.

procedure DeclarePlayerz;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; //Your Runescape username
Players[0].Pass := ''; //Your Runescape password
Players[0].Active := True; //Set to true if you want to use this player. Set to False to disable this player.
Players[0].Pin := ''; //Leave blank if the player doesn't have a Bank PIN.
end;

var
Reward, games, win, lost, Rp, Pp, Yp, yellow, white, LeftGate,DTMSPOT2,DTMSPOT3,DTMSPOT, x, y : integer;


Procedure FindRandoms;
Begin
FindNormalRandoms;
wait(400)
FindLamp('Woodcutting');
End;



function Step1: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..4] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 933;
dtmMainPoint.y := 115;
dtmMainPoint.AreaSize := 3;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 1452869;
dtmMainPoint.Tolerance := 20;

dtmSubPoints[0].x := 933;
dtmSubPoints[0].y := 115;
dtmSubPoints[0].AreaSize := 3;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 1452869;
dtmSubPoints[0].Tolerance := 20;

dtmSubPoints[1].x := 933;
dtmSubPoints[1].y := 121;
dtmSubPoints[1].AreaSize := 3;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 4357778;
dtmSubPoints[1].Tolerance := 20;

dtmSubPoints[2].x := 923;
dtmSubPoints[2].y := 114;
dtmSubPoints[2].AreaSize := 3;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 2844546;
dtmSubPoints[2].Tolerance := 20;

dtmSubPoints[3].x := 931;
dtmSubPoints[3].y := 104;
dtmSubPoints[3].AreaSize := 3;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 2513523;
dtmSubPoints[3].Tolerance := 20;

dtmSubPoints[4].x := 941;
dtmSubPoints[4].y := 114;
dtmSubPoints[4].AreaSize := 3;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 5218735;
dtmSubPoints[4].Tolerance := 20;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;


function Step2: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..4] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 901;
dtmMainPoint.y := 138;
dtmMainPoint.AreaSize := 1;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 65535;
dtmMainPoint.Tolerance := 30;

dtmSubPoints[0].x := 901;
dtmSubPoints[0].y := 138;
dtmSubPoints[0].AreaSize := 1;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 65535;
dtmSubPoints[0].Tolerance := 30;

dtmSubPoints[1].x := 902;
dtmSubPoints[1].y := 133;
dtmSubPoints[1].AreaSize := 1;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 2714760;
dtmSubPoints[1].Tolerance := 30;

dtmSubPoints[2].x := 907;
dtmSubPoints[2].y := 139;
dtmSubPoints[2].AreaSize := 1;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 2714760;
dtmSubPoints[2].Tolerance := 30;

dtmSubPoints[3].x := 901;
dtmSubPoints[3].y := 145;
dtmSubPoints[3].AreaSize := 1;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 2714760;
dtmSubPoints[3].Tolerance := 30;

dtmSubPoints[4].x := 896;
dtmSubPoints[4].y := 137;
dtmSubPoints[4].AreaSize := 1;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 2714760;
dtmSubPoints[4].Tolerance := 30;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;


function Step3: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..4] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 741;
dtmMainPoint.y := 175;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 863541;
dtmMainPoint.Tolerance := 15;

dtmSubPoints[0].x := 741;
dtmSubPoints[0].y := 175;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 863541;
dtmSubPoints[0].Tolerance := 15;

dtmSubPoints[1].x := 739;
dtmSubPoints[1].y := 173;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 16249839;
dtmSubPoints[1].Tolerance := 15;

dtmSubPoints[2].x := 744;
dtmSubPoints[2].y := 169;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 2976616;
dtmSubPoints[2].Tolerance := 15;

dtmSubPoints[3].x := 737;
dtmSubPoints[3].y := 169;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 2841950;
dtmSubPoints[3].Tolerance := 15;

dtmSubPoints[4].x := 734;
dtmSubPoints[4].y := 173;
dtmSubPoints[4].AreaSize := 0;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 16249839;
dtmSubPoints[4].Tolerance := 15;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;



function Left: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..4] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 665;
dtmMainPoint.y := 181;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 1466931;
dtmMainPoint.Tolerance := 15;

dtmSubPoints[0].x := 665;
dtmSubPoints[0].y := 181;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 1466931;
dtmSubPoints[0].Tolerance := 15;

dtmSubPoints[1].x := 661;
dtmSubPoints[1].y := 176;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 2908770;
dtmSubPoints[1].Tolerance := 15;

dtmSubPoints[2].x := 671;
dtmSubPoints[2].y := 174;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 2255469;
dtmSubPoints[2].Tolerance := 15;

dtmSubPoints[3].x := 665;
dtmSubPoints[3].y := 172;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 2323058;
dtmSubPoints[3].Tolerance := 15;

dtmSubPoints[4].x := 658;
dtmSubPoints[4].y := 177;
dtmSubPoints[4].AreaSize := 0;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 3242361;
dtmSubPoints[4].Tolerance := 15;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;

function Left1: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..3] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 660;
dtmMainPoint.y := 143;
dtmMainPoint.AreaSize := 1;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 263925;
dtmMainPoint.Tolerance := 15;

dtmSubPoints[0].x := 660;
dtmSubPoints[0].y := 143;
dtmSubPoints[0].AreaSize := 1;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 263925;
dtmSubPoints[0].Tolerance := 15;

dtmSubPoints[1].x := 650;
dtmSubPoints[1].y := 139;
dtmSubPoints[1].AreaSize := 1;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 5350033;
dtmSubPoints[1].Tolerance := 15;

dtmSubPoints[2].x := 652;
dtmSubPoints[2].y := 146;
dtmSubPoints[2].AreaSize := 1;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 4363665;
dtmSubPoints[2].Tolerance := 15;

dtmSubPoints[3].x := 648;
dtmSubPoints[3].y := 131;
dtmSubPoints[3].AreaSize := 1;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 263925;
dtmSubPoints[3].Tolerance := 15;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;


procedure LeftSpot;
begin
MakeCompass('S');
LeftGate := Left;
if DTMRotated(LeftGate, X, Y, MMX1, MMY1, MMX2, MMY2) then
MMouse(x, y, 0, 0);
wait(500);
Mouse(x, y, 0, 0, True);
end;


procedure LeftPortal;
begin
MakeCompass('S');
white := Left1;
if DTMRotated(white, X, Y, MMX1, MMY1, MMX2, MMY2) then
MMouse(x, y, 0, 0);
wait(500);
Mouse(x, y, 0, 0, True);
end;
//white

function NorthSpot: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..3] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 708;
dtmMainPoint.y := 160;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 393967;
dtmMainPoint.Tolerance := 15;

dtmSubPoints[0].x := 708;
dtmSubPoints[0].y := 160;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 393967;
dtmSubPoints[0].Tolerance := 15;

dtmSubPoints[1].x := 702;
dtmSubPoints[1].y := 155;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 3420468;
dtmSubPoints[1].Tolerance := 15;

dtmSubPoints[2].x := 715;
dtmSubPoints[2].y := 155;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 3355448;
dtmSubPoints[2].Tolerance := 15;

dtmSubPoints[3].x := 708;
dtmSubPoints[3].y := 153;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 3289141;
dtmSubPoints[3].Tolerance := 15;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;

function Spot44: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..4] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 672;
dtmMainPoint.y := 180;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 329713;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 672;
dtmSubPoints[0].y := 180;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 329713;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 671;
dtmSubPoints[1].y := 156;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 6523792;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 667;
dtmSubPoints[2].y := 169;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 5336950;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 678;
dtmSubPoints[3].y := 162;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 5792867;
dtmSubPoints[3].Tolerance := 0;

dtmSubPoints[4].x := 666;
dtmSubPoints[4].y := 163;
dtmSubPoints[4].AreaSize := 0;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 6457999;
dtmSubPoints[4].Tolerance := 0;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;


//Portal Locs:

function YellowPortal: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..4] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 676;
dtmMainPoint.y := 179;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 65535;
dtmMainPoint.Tolerance := 15;

dtmSubPoints[0].x := 676;
dtmSubPoints[0].y := 179;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 65535;
dtmSubPoints[0].Tolerance := 15;

dtmSubPoints[1].x := 676;
dtmSubPoints[1].y := 172;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 7444128;
dtmSubPoints[1].Tolerance := 15;

dtmSubPoints[2].x := 682;
dtmSubPoints[2].y := 180;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 7312029;
dtmSubPoints[2].Tolerance := 15;

dtmSubPoints[3].x := 669;
dtmSubPoints[3].y := 178;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 7048342;
dtmSubPoints[3].Tolerance := 15;

dtmSubPoints[4].x := 676;
dtmSubPoints[4].y := 184;
dtmSubPoints[4].AreaSize := 0;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 7114649;
dtmSubPoints[4].Tolerance := 15;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;


procedure TOYellow; // Directly to Yellow Portal
begin
MakeCompass('S');
Yp := YellowPortal;
if DTMRotated(YP, X, Y, MMX1, MMY1, MMX2, MMY2) then
MMouse(x, y, 0, 0);
wait(500);
Mouse(x, y, 0, 0, True);
FFlag(1);
end;

function RedPortal: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..4] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 778;
dtmMainPoint.y := 192;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 62719;
dtmMainPoint.Tolerance := 15;

dtmSubPoints[0].x := 778;
dtmSubPoints[0].y := 192;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 62719;
dtmSubPoints[0].Tolerance := 15;

dtmSubPoints[1].x := 778;
dtmSubPoints[1].y := 185;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 8150929;
dtmSubPoints[1].Tolerance := 15;

dtmSubPoints[2].x := 772;
dtmSubPoints[2].y := 183;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 7559818;
dtmSubPoints[2].Tolerance := 15;

dtmSubPoints[3].x := 786;
dtmSubPoints[3].y := 190;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 8418184;
dtmSubPoints[3].Tolerance := 15;

dtmSubPoints[4].x := 769;
dtmSubPoints[4].y := 188;
dtmSubPoints[4].AreaSize := 0;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 7432058;
dtmSubPoints[4].Tolerance := 15;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;

procedure ToRed; //Directly to Purple Portal
begin
Status('To Red');
MakeCompass('S');
Rp := RedPortal;
if DTMRotated(Rp, X, Y, MMX1, MMY1, MMX2, MMY2) then
MMouse(x, y, 0, 0);
wait(500);
Mouse(x, y, 0, 0, True);
FFlag(1);
end;


Procedure AttackWhite;
begin
repeat
if FindObj(x, y, 'ortal', 13217188, 15) then
MMouse(x,y,0,0);
wait(500);
Mouse(x,y,0,0,false);
ChooseOption('ttack');
until(false);
end;


Procedure AttackRed;
begin
repeat
if FindObj(x, y, 'ortal', 6246545, 15) then
MMouse(x,y,0,0);
wait(500);
Mouse(x,y,0,0,false);
ChooseOption('ttack');
wait(3434 + Random(244));
until(false);
end;


Procedure AttackYellow;
begin
repeat
Status('Attacking Yellow');
if FindObj(x, y, 'ortal', 3978936, 15) then
MMouse(x,y,0,0);
wait(500);
Mouse(x,y,0,0,false);
ChooseOption('ttack');
wait(3434 + Random(244));
until(false);
end;


procedure SPOT1; // Toward Void.
begin
Status('Spot 1');
SetRun(True);
MakeCompass('S');
DTMSPOT := Step1;
if DTMRotated(DTMSPOT, X, Y, MMX1, MMY1, MMX2, MMY2) then
MMouse(x, y, 0, 0);
wait(500);
Mouse(x, y, 0, 0, True);
FFlag(0);
wait(1300);
end;

procedure SPOT2; // Void
begin
Status('Spot 2');
MakeCompass('S');
DTMSPOT2 := Step2;
if DTMRotated(DTMSPOT2, X, Y, MMX1, MMY1, MMX2, MMY2) then
MMouse(x, y, 0, 0);
wait(500);
Mouse(x, y, 0, 0, True);
FFlag(0);
wait(1300);
end;

Procedure AwayFromVoid;
begin
If not (DTMSPOT2 < 10) then
begin
exit;
end else
Spot2;
end;


procedure SPOT3; // Towards North Portals
begin
Status('Spot 3');
MakeCompass('S');
DTMSPOT3 := Step3;
if DTMRotated(DTMSPOT3, X, Y, MMX1, MMY1, MMX2, MMY2) then
MMouse(x, y, 0, 0);
wait(500);
Mouse(x, y, 0, 0, True);
Flag;
wait(1300);
end;


procedure SPOT4; // North (Middle of Yellow/Purple)
begin
Status('Spot 4');
MakeCompass('S');
yellow := NorthSpot;
if DTMRotated(yellow, X, Y, MMX1, MMY1, MMX2, MMY2) then
MMouse(x, y, 0, 0);
wait(500);
Mouse(x, y, 0, 0, True);
Wait(3532 + Random(432));
Flag;
end;

Procedure WinOrLose;
begin
Status('Checking if Win Game Or Lose');
MakeCompass('S');
if FindNPCChatText('Congratulations!',True) then
begin
win := win + 1;
stats_IncVariable('PC Points Earned',2);
exit;
end else
if FindNPCChatText('noticed',True) or FindNPCChatText('lost.',True) then
begin
lost := lost + 1;
exit;
end else
begin
exit;
end;
end;



function NPC: Boolean;
begin
FindRandoms;
if FindNPCChatText('ritual',True) or
FindNPCChatText('Congratulations!',True) or
FindNPCChatText('knights',True) or
FindNPCChatText('lost.',True) or
FindText(x, y, 'attle', UpChars, MCX1, MCY1, MCX2, MCY2) or
FindText(x, y, 'defend the Void Knight', UpChars, MCX1, MCY1, MCX2, MCY2) then
Begin
Result := True;
Writeln('NPC Message Detected!');
If (FindColorSpiralTolerance(x, y, 540186, 136, 379, 415, 470, 25)) then
wait(2000);
Status('NPC Message');
MMouse(x,y,0,0);
wait(500);
Mouse(x,y,0,0,true);
WinOrLose;
end else
Result := False;
end;


procedure RandomButton;
begin
case Random(3) of
0:
begin
KeyDown(VK_Left);
wait(Random(600) + 500);
KeyUp(VK_Left);
end;
1:
begin
KeyDown(VK_Right);
wait(Random(600) + 500);
KeyUp(VK_Right);
end;
2:
begin
KeyDown(VK_Up);
wait(Random(200) + 500);
KeyUp(VK_Up);
end;
end;
end;

procedure Report;
var
Answer, WC: Integer;
begin
If Not (LoggedIn) Or Not (Players[CurrentPlayer].Active) Then
NextPlayer(True);
cleardebug;
SRLRandomsReport;
Writeln('||===========================||');
Writeln('|| P1nkys PestController ||');
Writeln('||===========================||');
Writeln('|| ' + TheDate(Date_Formal) + ' ||');
Writeln('||===========================||');
Writeln(' Worked For ' + TimeRunning);
Writeln(' Games Played ' + IntToStr(Games));
Writeln(' Won ' + IntToStr(Win) + ' Games ');
Writeln(' Lose ' + IntToStr(lost) + ' Games ');
Writeln(' Reward ' + IntToStr(Reward));
Writeln('||===========================||');
Writeln('||===========================||');
Writeln('||===========================||');
Stats_Commit;
end;


procedure AntiBan;
var
NoBan: Integer;
begin
// FindRandoms;
Noban := Random(18);
case Move of
0: MMouse(x, y, (10 + random(350)), (10 + random(200)));
1: MMouse(x, y, (10 + random(400)), (10 + random(600)));
2: MMouse(x, y, (10 + random(550)), (10 + random(400)));
3: MMouse(x, y, (10 + random(500)), (10 + random(400)));
4: MMouse(Random(MSX2), Random(MSY2), 0, 0);
5: RandomRclick;
6: RandomButton;
10: setangle(1)
end;
end;

function InGame: Boolean; //weequ's function
begin
result := (getColor(370, 74) = 16711935) and (getColor(404, 70) = 16737894);
end;

Procedure BoatWait;
begin
If Not (LoggedIn) Or Not (Players[CurrentPlayer].Active) Then
NextPlayer(True);
repeat
Status('Waiting In Boat');
RandomButton;
FindRandoms;
Report;
Wait(1232 + random(534));
until(NPC) or (Ingame);
Games := Games + 1;
exit;
end;

function FindBoard(x,y:Integer):Boolean;
var
CTS, I: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
SetColorSpeed2Modifiers(1, 3);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 3958408, MSX1, MSY1, MSX2, MSY2, 4);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 2, 2);
For I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 1, 1);
If(IsUpTextMultiCustom(['Gangplank'])) then
begin
Result := True;
GetMousePos(x, y);
Break;
end;
end;
end;

Function RewardBox : Boolean;
begin
if FindColorTolerance(x,y,986895,134,96,435,334,1) then
begin
Result := True;
Mouse(392,60,0,0,true);
Reward := Reward + 1;
end else
Result := False;
end;

procedure Plank;
begin
If Not (LoggedIn) Or Not (Players[CurrentPlayer].Active) Then
NextPlayer(True);
Status('Searching For Plank');
WinOrLose;
MakeCompass('S');
FindRandoms;
begin
{ KeyDown(VK_Down);
wait(Random(1000) + 500);
KeyUp(VK_Down);}
Setangle(0);
end;
repeat
if not RewardBox then
if FindBoard(x,y) then
//If (FindColorSpiralTolerance(x, y, 5008519, MSX1, MSY1, MSX2, MSY2, 3)) then
//If (FindObjCustom(x,y,['Gang','angplank','Gangplank','gplank'], [3628927,2704989,3496825], 5)) Then
//If FindObjTPA(X, Y, 5074570, 10, 1, 120, 120, 50, ['angplank','Gang']) then
// ClickMouse2(False);
wait(2000);
Status('Looking for Plank');
wait(200 + random(232));
if Isuptext('angplank') then
ClickMouse2(true);
Until(FindBlackChatMessage('You board the lander') or (ingame));
//ChooseOption('angplank');
//until(ChooseOption('ross') or ChooseOption('angplank'));
//until WaitOptionMulti(['ross', 'angplank', 'Gangplank'], 1500);
{if Isuptext('angplank') then
Mouse(x,y,0,0,true);
wait(1232);
Mouse(x,y,0,0,true); }
FindRandoms;
//Until(ChooseOption('ross'));
Report;
NPC;
exit;
end;

Procedure SpecAttack;
begin
Writeln('Toggling Special');
Status('Special Attack');
MouseBox(528,179,545,195,1);
begin
If (FindColorSpiralTolerance(x, y, 3566664, 545, 208, 738, 430, 25)) then
wait(2000);
Status('Special');
MMouse(x,y,0,0);
wait(500);
Mouse(x,y,0,0,true);
end;
end;



// If (FindObjCustom(x,y,['Bank','nk','booth','oot'], [1717052], 5)) Then
Procedure FightPests; //2305818 green pest
var //2701962 = red pest
CTS: Integer; //5051472 = PURPLE PEST POP UP
begin
Status('Fighting Pests');
//['Splatter','Torcher','Shifter','Defiler','Splatter ','Brawler'])
{ if not FindObj(x, y, 'hifter', 2108184, 1) or
FindObj(x, y, 'hifter', 2572415, 10) then }
If not (FindObjCustom(x,y,['hifter','Shifte','Shifter','hift'], [2108184,5051472,3228504], 5)) Then
begin
Report;
RandomButton;
Exit;
end else
Mmouse(x,y,0,0);
if isuptext('hifter') then
wait(200);
Mouse(x,y,0,0,True);
//ChooseOption('ttack');
//WaitOptionMulti(['Atta', 'ttac', 'ttack'], 1500);
wait(2000);
Report;
end;

//2830989
// 1319947
//


//purple = western
//blue = eastern
//yellow = south eastern
// red = south western
Function Portal(Name : string) : Boolean;
begin
case Name Of
'red' :
if (FindBlackChatMessage('south-western')) then
begin
Result := True;
Writeln('Red Portal Shield Down!');
Exit;
end else
Result := False;
'yellow':
if (FindBlackChatMessage('south-eastern')) then
begin
Result := True;
Writeln('Yellow Portal Shield Down!');
Exit;
end else
Result := False;
end;
end;
//You must defend
Procedure RedRoute;
begin
Tored;
AttackRed;
If Portal('yellow') then
begin
exit;
end;
end;

Procedure YellowRoute;
begin
wait(5000);
Status('Yellow Route');
toyellow;
AttackYellow;
If Portal('red') then
begin
RedRoute;
end;
end;

procedure FreeDTMS;
begin
FreeDTM(step1);
FreeDTM(step2);
FreeDTM(step3);
FreeDTM(Left);
FreeDTM(Left1);
FreeDTM(northspot);
FreeDTM(redportal);
FreeDTM(yellowportal);
FreeDTM(spot44);
end;

Procedure PestControl;
begin
WinorLose;
Spot1;
Spot2;
SpecAttack;
repeat
FightPests;
Until(false);
end;


begin
Disguise('P1nky PestController');
ClearDebug;
ClearReport;
Smart_Server := 17;
Smart_Members := false;
Smart_Signed := true;
Smart_SuperDetail := false;
begin
if (SRLStats_Username = '') then
SetupSRLStats(654, 'Anonymous', 'anon1337')
else
SetupSRLStats(654, SRLStats_Username, SRLStats_Password);
SetUpSRL;
declareplayerz;
ActivateClient;
ClearDebug;
LoginPlayer;
repeat
begin
FreeDTMS;
NPC;
Report;
Plank;
BoatWait;
begin
Spot1;
Spot2;
if SpecialAttacks then
begin
SpecAttack;
end;
repeat
FightPests
Until not (Ingame);
end;
end;
until(false);
end;
end.

//3978936 yellow Port

Kyle Undefined
02-07-2012, 07:51 PM
Could you remove the commented part from under the //Will add more features later. please?

Exilus
02-08-2012, 05:15 PM
hmmm it seems like i was wrong, it didn't work.


That nextplayer function isn't even in the program. Where can i find it to remove it manually? i dont plan on ever using it.

Inception
02-08-2012, 07:59 PM
The NextPlayer function is used when you are running multiple characters. Changing each NextPlayer to Exit should work.

Exilus
02-09-2012, 01:55 PM
The NextPlayer function is used when you are running multiple characters. Changing each NextPlayer to Exit should work.

you mean that i replace every "if X then Nextplayer(false)" smply by "Exit"?

what what this is going to do?

Inception
02-09-2012, 02:48 PM
you mean that i replace every "if X then Nextplayer(false)" smply by "Exit"?

what what this is going to do?

No, I mean that you replace NextPlayer(false) by Exit. It will exit the procedure instead of logging you out and changing your status.

Markus
02-09-2012, 02:53 PM
That does mean the script will most likely mess up. It's logging out for a reason!

Exilus
02-09-2012, 03:07 PM
That does mean the script will most likely mess up. It's logging out for a reason!

Well i watched it run and it goes around killing pests as it should and then "Nextplayer(False)" or "Nextplayer(True)" pops up in the log and it starts clicking on "exit to lobby".


other people have it running flawlessly why does it do that to me?