Ian
2012-11-08 15:01:12
I'm working on a rat killer that someone requested, but the problem that I'm running into is that I need a way to accurately determine how many rats have been killed. I suspect that what I'm using now artificially inflates the nubmer of rats it killed. Here's the function I'm using now:
The problem is when it attacks a rat that is in combat with the lumbridge guard (a bot-like npc that randomly wanders around killing rats), It registers the kill. Unfortunately, there is no message saying "somebody else is fighting that" (I was going to check the chatbox for that message then -1 the killcount.)
Any help would be appreciated, thanks!
Procedure KillRats;
Var
x, y: Integer;
begin
if not LoggedIn then LoginPlayer;
FindNormalRandoms;
If (not InFight) Then
begin
If FindObjCustom(x, y, ['Rat', 'at'], [4605769, 3882302], 5) Then
begin
WriteLn('Fighting Rat')
GetMousePos(x, y);
Mouse(x, y, 1, 1, false);
WaitOption('nt', 2000);
Kills := Kills + 1
Antiban;
Wait(randomrange(3000,4000));
Flag;
end;
end;
end;The problem is when it attacks a rat that is in combat with the lumbridge guard (a bot-like npc that randomly wanders around killing rats), It registers the kill. Unfortunately, there is no message saying "somebody else is fighting that" (I was going to check the chatbox for that message then -1 the killcount.)
Any help would be appreciated, thanks!