Hi there i recently was training my new account and i came across your script which was nice and everything though it can still need work with walking around the warrior combat area's i.e if there are no more warriors in the room make him move to the center or any other room? …
But the main thing was i just added ACA to the script making finding warrior's ALOT! more faster in my view but can still need work so with your permission im going to post this edited version, if you want me to remove it or something just ask me or if you can remove it your self then do so :)
EDIT!! just a quick heads up if you will, if for some reason your charactor isnt clicking or something ? just set the angle to HIGH or LOW make sure you change them bouth or it will go high then low again and yeah :L
Program Al_Kharid_Warrior_Killer;
{$i srl\srl\misc\smart.simba}
{$i SRL\SRL.simba}
{$i srl\srl\skill\fighting.simba}
Var
x, y, Food: Integer;
B: Array [0..5] of Integer;
aFound: Extended;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Bankpin Here
Players[0].BoxRewards := ['Xp'];
Food := DTMFromString('m1gAAAHic42JgYMhmYmBIA+IkII4F4lwgLgbiCiAuB+ISIM4B4vtAtXeA+CkQfwTiR0D8BMp/CJW7BsS1ES1AkokITBxgJBIjAAA4Lw6i');
end;
//---------------------EDITED by Zac-------------------------------\\
function WarriorColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 0.76);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 6048546, MSX1, MSY1, MSX2, MSY2, 11);
if (Length(arP) = 0) then
begin
//Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 1.72) and (X <= 10.47) and (Y >= 2.08) and (Y <= 12.47) and (Z >= 3.78) and (Z <= 21.61) then
begin
Result := arC[i];
// Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
//Writeln('AutoColor failed in finding the color.');
end;
Procedure Attackwarrior;
Var
x, y: Integer;
Begin
X:=MSCX;
Y:=MSCX;
If FindObjTPA( x, y, WarriorColor, 10, 2, 5, 2, 10, ['Warrior','Al']) Then
Begin
GetMousePos (x, y);
Case Random (0) Of
0: Mouse (x, y, 2, 2, True)
End;
End;
End;
Procedure SetDTM;
Begin
B[0] := DTMFromString('mrAAAAHic42BgYChhYmAIAuJVQLwSiu2h2AmI7YBqUoA4EYiDgdgTiKOBOByI/YB4em8qQ7ghG4NBkgiDQoQAg5U1Kxw7JEkxiADV4MOMBDAMAACI9AxR');
B[1] := DTMFromString('mlwAAAHicY2dgYDBkYmBwAmJHKHYAYj8gjgfiQKC8CxCHAXE8EOcDsTMQOwHxzJ5UBqdEKQYbK1Y4NkoUYVAKF2AQAcrjwox4MBQAAKFHCbE=');
B[2] := DTMFromString('mlwAAAHicY2dgYIhiYmDwAOJ6NOwOxJVA+Xwg9gXiHCCuBeIJQGwJxFt70hi+/+ZmMEoUYbCxYgVjENu70IRBBCiPCzPiwVAAABJQDU0=');
B[3] := DTMFromString('mlwAAAHicY2dgYOBgZGD4DqTFgPQfIC0IpP9B6RIgHQXEkUBcCcW5QFwIxEnBTgz21uYMtpYmDBVpgQxx/vYMt3ZOZqjJDGYQAcrjwox4MBQAAF81DpI=');
B[4] := DTMFromString('mwQAAAHic42RgYOhnYmCYg4RnA3E4EJcAcQUQpwKxCVCdGxBHA3EGEGsCsS4QqwFxCRALAPHU7jQGS0s2BvkwQTjd15IIFvcoMGWY3pHOIAJURwgzEoHhAAAP1hCq');
B[5] := DTMFromString('mlwAAAHicY2dgYJjAxMBQD8QNUAxirwDiHiCOAMpXAXEeEIcDsTUQWwCxJRBv6kpjMNLkYtBPEGWQDxME0zAsApTHhRnxYCgAALMIC8s=');
end;
Procedure Bankit;
Begin
B[3] := DTMFromString('mlwAAAHicY2dgYOBgZGD4DqTFgPQfIC0IpP9B6RIgHQXEkUBcCcW5QFwIxEnBTgz21uYMtpYmDBVpgQxx/vYMt3ZOZqjJDGYQAcrjwox4MBQAAF81DpI=');
MakeCompass ('w')
repeat
Wait(50 + Random(25));
until FindDTMRotated(B[3], x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4, Pi/60, aFound);
If FindDTMRotated(B[3], x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 3, 3, True);
Wait(1500)
if not (bankscreen) then
repeat
Wait(50 + Random(25));
until FindDTMRotated(B[3], x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4, Pi/60, aFound);
If FindDTMRotated(B[3], x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 3, 3, True);
Wait(1500)
Withdraw(0, 0, 28);
CloseBank;
FreeDTM(B[3])
end;
end;
end;
Procedure ToBank;
begin
B[0] := DTMFromString('mrAAAAHic42BgYChhYmAIAuJVQLwSiu2h2AmI7YBqUoA4EYiDgdgTiKOBOByI/YB4em8qQ7ghG4NBkgiDQoQAg5U1Kxw7JEkxiADV4MOMBDAMAACI9AxR');
B[1] := DTMFromString('mlwAAAHicY2dgYDBkYmBwAmJHKHYAYj8gjgfiQKC8CxCHAXE8EOcDsTMQOwHxzJ5UBqdEKQYbK1Y4NkoUYVAKF2AQAcrjwox4MBQAAKFHCbE=');
B[2] := DTMFromString('mlwAAAHicY2dgYIhiYmDwAOJ6NOwOxJVA+Xwg9gXiHCCuBeIJQGwJxFt70hi+/+ZmMEoUYbCxYgVjENu70IRBBCiPCzPiwVAAABJQDU0=');
MakeCompass ('n')
if FindDTMRotated(B[0], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 3, 3, True);
FFlag(6);
FreeDTM(B[0]);
repeat
Wait(50 + Random(25));
until FindDTMRotated(B[1], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound);
end;
if FindDTMRotated(B[1], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 3, 3, True);
FFlag(6);
FreeDTM(B[1]);
repeat
Wait(50 + Random(25));
until FindDTMRotated(B[2], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound);
end;
if FindDTMRotated(B[2], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 3, 3, True);
FFlag(6);
FreeDTM(B[2]);
End;
End;
Procedure FromBank;
begin
B[4] := DTMFromString('mwQAAAHic42RgYOhnYmCYg4RnA3E4EJcAcQUQpwKxCVCdGxBHA3EGEGsCsS4QqwFxCRALAPHU7jQGS0s2BvkwQTjd15IIFvcoMGWY3pHOIAJURwgzEoHhAAAP1hCq');
B[5] := DTMFromString('mlwAAAHicY2dgYJjAxMBQD8QNUAxirwDiHiCOAMpXAXEeEIcDsTUQWwCxJRBv6kpjMNLkYtBPEGWQDxME0zAsApTHhRnxYCgAALMIC8s=');
MakeCompass ('n')
if FindDTMRotated(B[4], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 3, 3, True);
FFlag(6);
FreeDTM(B[4]);
repeat
Wait(50 + Random(25));
until FindDTMRotated(B[5], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound);
end;
if FindDTMRotated(B[5], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 3, 3, True);
FFlag(6);
FreeDTM(B[5]);
end;
end;
Procedure LowHPLetsEat;
var
x, y: Integer;
test: boolean;
begin
test := (HPPercent < 70) and (LoggedIn);
If(not(test)) then
Exit;
if test then
If InvEmpty then
begin
ToBank;
Bankit;
FromBank;
end else
begin
if FindDTM( Food, X, Y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x ,y, 5, 5, true);
Wait(100);
WriteLn('Having a bite of tuna');
end else
begin
WriteLn('couldn''t find any tuna');
end;
end else
WriteLn('health isn''t low enough to eat');
end;
begin
MouseSpeed := 18;
Smart_Server := 136;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
SetDTM;
MakeCompass ('n')
SetAngle(SRL_ANGLE_LOW);
repeat
SetAngle(SRL_ANGLE_LOW);
Attackwarrior;
While(Infight)do
Wait(300);
LowHPLetsEat;
Until not LoggedIn;
end.
Edit i noticed that once it clicks npc , and engages fight, but like 4-5 seconds later or quicker it clicks on another npc? any way to stop that .. so if its fighting one, finish it then attack the next closest npc?