Troll
2010-10-21 15:10:47
Hi
well im trying to click and attack cows but every time the mouse does not go near the cows just next to them.
Thanks
well im trying to click and attack cows but every time the mouse does not go near the cows just next to them.
Function AttackCow(calf:Boolean) :Boolean;
Var NPCs : TNPCArray;
I,x,y : Integer;
CowTile : TPoint;
Begin
If Not LoggedIn Then Exit;
result := false;
If calf Then
NPCs := GetNPCsBy('Cow')
else
NPCs := GetNPCsBy('Cow calf');
If high(NPCs) > -1 Then // Should be -1, because a high of 0 means that one NPC was found, -1 means nothing was found
Begin
For i:= 0 To high(NPCs) Do
Begin
If (NPCs[i].Name = 'Cow') Then
Begin
writeln ('Found cow');
If TileOnMS (NPCs[i].Tile, 0) Then
Begin
If Not NPCs[I].Fighting Then
Begin
CowTile := TileToMS(NPCs[i].Tile,5);
MMouse(CowTile.x,CowTile.y,3,3);
If R_IsUpText('Cow') Then
Begin
GetMousePos(x,y);
If Random(15) = 5 Then // This means you have a 1 in 16 chance of clicking true
Begin
Mouse(x,y,0,0,true);
End Else
Begin
Mouse(x,y,0,0,False);
R_ChooseOption('ttac');
End;
Result := True;
End else Begin
writeln ('Did not find cow uptext!');
Wait(750);
End;
End Else writeln('cow in fight');
end else writeln ('Cow #'+inttostr(i)+' not on mainscreen [dont worry too much about this msg]');
End;
End;
End; writeln ('Warning, array has nothing in it');
End;
Any idea's?Thanks