Log in

View Full Version : Help needed.



spin3x
06-05-2012, 06:07 PM
Guys I'm trying to make this bit of the script, attack a monster if it doesnt find the colour "38937" and then once it attacked the monster, I want it to stop.

Heres the bit of the code:
Procedure Attack;
var
x, y: Integer;
begin
if not FindColorSpiralTolerance(x, y, 38937, 9, 0, 515, 316, 5) then //if it doesnt find this code, I want it to attack the monster.
begin
if FindColorSpiralTolerance(x, y, 5081481, 9, 0, 515, 316, 5) then
Mouse(x, y, 0, 0, mouse_left); //Attacking the monster.
until(FindColorSpiralTolerance(x, y, 38937, 9, 0, 515, 316, 5) // This is probably wrong. I want it to stop clicking attack the monster once it found the the colour " 38937"
end;
end;

I wasnt sure about the until part. :S

Recursive
06-05-2012, 06:24 PM
until srl_infight;

Or

until(DidRedClick);

The first one is probably more reliable

P1ng
06-05-2012, 06:26 PM
What does the colour you want it to 'not' find before attacking the monster indicate?

If it is the splash colour I'd recommend not using that to tell whether or not you are in a fight as it may pick up a nearby fight that is not your own. There are some functions like -
srl_InFight;
function IsFighting: Boolean;
begin
Result := PixelShift(IntToBox(MSCX-30, MSCY-30, MSCX+30, MSCY+30), 500) > 250;
end;
You could use those to determine whether you are in a fight instead.
1. Detects if HP bar is above head to determine if you are in a fight.
2. Detects if more than 250 pixels are moving within a square at the middle of the mainscreen where the player stands.

Abu
06-05-2012, 10:17 PM
Try WaitColourGone,yes that actually exists...