SRL Archive - OSR Help

How can I get it to stay on target


Strydr

2013-02-27 18:02:32

Hi Im a very very begginer programmer and Im trying to learn so I took a script used it as a template and modified it. I was wondering how I can get this script to stay on target. I want to release it to the community but I dont know that many ways to do anti leech so if someone could help me and pm a basic anti leech it would be greatly appreiciated heres what I have so far. It targets them and ussually kills but when two are near eachother it will click one not in combat.
EDIT!!!: So I used the search button and I found one but I removed the wait time on it so it can grab it before other players do. But now it looks like it spazzzing and the guy is on crack. Any other way to add wait time?

program Yourmom;

{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$I P07Include.Simba}



var
X, Y:Integer;

procedure TargetYourMom;
begin
If P07_FindObjCustom(x, y, ['Attack', 'Cow calf', 'Cow'], [12107201, 5073289, 3949911, 4150639], 5) Then
ClickMouse2(mouse_left);
end;

Function IsFighting: Boolean;
var
PBox: TBox;
Begin
PBox := IntToBox(238, 169, 279, 217);
Result := (AveragePixelShift(PBox, 250, 350) > 15);
End; function fight:boolean;
var
x, y:integer;
tmpCTS,i, L,Counter,Fighter: Integer;
begin
if IsFighting then
begin
repeat
until (not IsFighting)
end;
TargetYourMom
While IsFighting do
Wait(RandomRange(400, 800));
if not IsFighting then
End;

begin
if IsFighting then
begin
repeat
until (not IsFighting)
end;
begin
SetupP07Include;
repeat
TargetYourMom;
until False;
end;
end.