Hoodz
2013-05-04 16:56:39
but i got a question: is it possible to check if a yak is in combat already?
i thought if a hpbar dtm or something is close to the tpa (the yak) then it wont attack the yak. else if the tpa (yak) doesnt have a hpbar dtm in their area then it will attack them.
but i have no idea how to script it like that.
it is also possible to draw boxes around the tpa's right?
program yakkiller;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$i SRL-OSR\SRL\misc\debug.simba}
{$i SRL-OSR\SRL\misc\SmartGraphics.simba}
var
x, y: integer;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
nick := '';
Active := True;
end;
end;
function AttackYakCheck: Boolean;
var
TPAA: T2DPointArray;
TPA: TPointArray;
CTS, I, Retry, x, y: Integer;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 3619909, MSX1, MSY1, MSX2, MSY2, 7);
ColorToleranceSpeed(CTS);
TPAA := TPAToATPAEx(TPA, 15, 13);
SortATPASize(TPAA, True);
for I := 0 to High(TPAA) do
if GetArraylength(TPAA[i]) > 5 then
begin
repeat
inc(Retry);
MiddleTPAEx(TPAA[i], x, y);
MMouse(X, Y, 3, 3);
if (IsUpTextMultiCustom(['ak'])) then
begin
Result := True;
case random(6) of
0..4:
begin
MouseBox(X + 2, Y + 2, X + 2, Y + 2, mouse_left);
wait(3000 + random(250))
end;
5:
begin
MouseBox(X + 2, Y + 2, X + 2, Y + 2, mouse_right);
wait(200 + random(100));
ChooseOptionMulti(['tta']);
wait(3000 + random(250))
end;
end
end;
until (Retry = 15);
Break;
end;
end;
procedure IsInCombat;
begin
if FindColor(X, Y, 255, 223, 127, 295, 175) or FindColor(X, Y, 65280, 223, 127, 295, 175) then
sleep(500)
else
attackyakcheck;
end;
begin
DeclarePlayers;
SetupSRL();
disguise('HoodzYakz Beta v1');
SRL_CombatRandoms := False;
ActivateClient;
ClearDebug;
writeln('HoodzYakz Beta v1')
repeat
if (not LoggedIn) then
begin
LogInPlayer;
setangle(0)
end;
if (LoggedIn) then
IsInCombat;
until (false);
end.thanks