SRL Archive - SRL Archives

FindBrokenAxe - WC.scar


Cazax

2008-09-30 18:28:13

Function FindBrokenAxe(Slot : Integer): Boolean;
Var
ATPA : T2DPointArray;
Box : TBox;
T : Integer;
Begin
T := GetCurrentTab;
GameTab(4);
Wait(100);
SetArrayLength(ATPA, 3);
Box := InvBox(Slot);
FindColorsTolerance(ATPA[0], 924021, Box.X1, Box.Y1, Box.X2, Box.Y2, 7);
FindColorsTolerance(ATPA[1], 791908, Box.X1, Box.Y1, Box.X2, Box.Y2, 7);
FindColorsTolerance(ATPA[2], 923761, Box.X1, Box.Y1, Box.X2, Box.Y2, 7);
Result := (Length(ATPA[0]) <= 4) And (Length(ATPA[1]) <= 4) And (Length(ATPA[2]) <= 4)
If Not Result Then
Begin
GameTab(5);
Wait(100);
FindColorsTolerance(ATPA[0], 924021, 575, 291, 602, 318, 7);
FindColorsTolerance(ATPA[1], 791908, 575, 291, 602, 318, 7);
FindColorsTolerance(ATPA[2], 923761, 575, 291, 602, 318, 7);
Result := (Length(ATPA[0]) <= 4) And (Length(ATPA[1]) <= 4) And (Length(ATPA[2]) <= 4)
End;
GameTab(T);
End;

TESTED.
Broken axes have 4 red pixels. The function verifies if those 4 pixels are there. Normal axes have more than 4 red pixels ;). Just input the slot to search with, if no axe was found in inventory, then it goes to tab 5. Won't work for dragon axe.

P1nky

2008-09-30 18:54:34

oo a advance 1 than mine, i just use
If (FindBlackChatMessage('You do not')) Then

lol works perfect too :P though gj.

Cazax

2008-09-30 19:13:11

From: ~~Joker~~
oo a advance 1 than mine, i just use
If (FindBlackChatMessage('You do not')) Then

lol works perfect too :P though gj.

If a lot of people is talking? and this is faster :P

spamthis

2008-09-30 20:20:56

Ah man! I just finished writing my own and then I see this which totally blows mine out of the water. Mind if I use this (with full credit of course)?

Twisted

2008-09-30 20:30:03

amazing, i'll need that for my script, may I use (with credits of course).

Cazax

2008-10-01 17:33:29

No problem on using the function, thats why i posted it :)

TViYH

2008-10-01 18:07:47

Very nice function. I'd say I'll use this in my future scripts.

Cazax

2008-10-02 17:54:09

Updated it now it supports all axes except dragon.

Nava2

2008-10-03 08:17:19

Great function, new idea ;).

Much more advanced then most current ones. :)

Seroko

2008-10-13 18:15:35

Never knew this, again great work. But if you are wanting to keep a constant eye on not having a broken axe (and you have it equiped) won't you have to still probably check chat and use this more as an occasional check? Because switching gametabs super often is announcing you are a bot =P

TViYH

2008-10-13 20:19:40

No, I switch game tabs when I legit all of the time.