Right, I'm trying to update my Dummy Hitter, because it's pretty poor at the moment I'll admit. I'm adding an uptext check, and an array for colours. This is what I've got so far. The lines with loads of /s are lines I've just put in to help myself debugging it.
SCAR Code:
program DummyHitter;
{.include SRL/SRL.scar}
var
I, X, Y, XX, YY : Integer;
Colour : TIntegerArray;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
{Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := True;
Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active := True;
Players[3].Name := '';
Players[3].Pass := '';
Players[3].Nick := '';
Players[3].Active := True;
Players[4].Name := '';
Players[4].Pass := '';
Players[4].Nick := '';
Players[4].Active := True; }
end;
procedure AntiBan;
begin
if not LoggedIn then
begin
Exit;
Players[CurrentPlayer].Active := False;
end;
case Random(150) of
0: RandomRClick;
1: BoredHuman;
2: HoverSkill('Attack', False);
end;
end;
procedure AntiRandoms;
begin
if not LoggedIn then
begin
Exit;
Players[CurrentPlayer].Active := False;
end;
FindNormalRandoms;
if FindFight then
RunAway('W', True, 1, 5000 + Random(2500));
AntiBan;
end;
procedure LoadColours;
begin
Colour[0]:= 6849433;
Colour[1]:= 7047070;
Colour[2]:= 10139599;
Colour[3]:= 8759236;
Colour[4]:= 7771308;
Colour[5]:= 8956871;
end;
procedure DummyHit;
begin
if not LoggedIn then
begin
Exit;
Players[CurrentPlayer].Active := False;
end;
if FindSymbol(XX, YY, 'training dummy') then
begin
WriteLn('Found symbol'); ////////////////////
MouseFlag(XX-10, YY, 5, 5, 1);
Wait(500 + Random(250));
ChatsOff;
end else
WriteLn('No dummy symbol'); //////////////////
repeat
AntiRandoms;
for I:= 0 to 5 do
if FindColorSpiralTolerance(x, y, Colour[i], MSX1, MSY1, MSX2, MSY2, 15) then
begin
AntiRandoms;
WriteLn('Found dummy colour');//////////////////
if IsUpText('ummy') then
begin
WriteLn('Found uptext');
Mouse(x, y,5,5,True);
Wait(1250 + Random(500));
end else
WriteLn('No uptext'); //////////////////
end else
WriteLn('No dummy colour');/////////////////
until (IsChatBoxTextAnyLine('nothing more you can learn', clBlack)) or
not(FindSymbol(XX, YY, 'training dummy')) or
not(FindColorSpiralTolerance(x, y, Colour[i], MSX1, MSY1, MSX2, MSY2, 15));
Logout;
Players[CurrentPlayer].Active := False;
end;
begin
SetupSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
repeat
DummyHit;
NextPlayer(False);
until(AllPlayersInactive)
end.
This is what I got from the debug box
Code:
Successfully compiled (4488 ms)
SRL Compiled in 62 msec
********
Creating the NickTPA.
Found symbol
[Runtime Error] : Out Of Range in line 95 in script D:\Program Files\SCAR\SCAR 3.15\Scripts\My Scripts\Dummy Hitter\Dummy Hitter V1.1.scar
Line 95 is
SCAR Code:
ntiRandoms;
for I:= 0 to 5 do
if FindColorSpiralTolerance(x, y, Colour[i], MSX1, MSY1, MSX2, MSY2, 15) //THIS LINE
then
begin
AntiRandoms;
I assume it's something to do with the "for..to..do" part, but meh, I might be wrong.
Any help is appreciated.
Thanks,
Richard