Log in

View Full Version : Is there a function to check for popup and not click?



JAD
04-03-2007, 01:54 AM
title pretty much says all. Is there a function in the SRL include (didn't find in the text part of SRL manual) to just look to see if there is a popup there and doesn't click? if there is, please tell me the command :) then I can finally release my edgevil willow cutter + banker.

Jason2gs
04-03-2007, 01:59 AM
Hmmm, I do remember thinking about this earlier.

I don't believe there is though. You could just check for:

a) The text (probably upchars) of the option for what you need.

b) Modify chooseoption to not click the option.

c) Look for a bitmap of the option you need.

Edit, yep, it looks like you'll be able to do b.



function FindOption(x, y: Integer; txt: string): Boolean;
var
x1, y1, x2, y2, LeftCorner, RightCorner: Integer;
begin
LeftCorner := BitmapFromString(4, 4, 'z78DA33753135313137C5' +
'411A600064715CEA914500CACE13F0');
RightCorner := BitmapFromString(4, 4, 'z78DA33753135313137' +
'C5200D30002E35F8C501C9C013F0');
if (FindBitmap(LeftCorner, x1, y1)) and (FindBitmap(RightCorner, x2, y2)) then
begin
if (FindText(x, y, txt, upchars, x1, y1, x2, 502)) then
begin
Result := True;
Mouse(x + Length(txt) * 3, y + 3, 2, 2, True); // Just take this part out, yes?
end
else if (FindText(x, y, 'Cancel', upchars, x1, y1, x2, 502)) then
Mouse(x + 9, y + 3, 2, 2, True);
end;
FreeBitmap(LeftCorner);
FreeBitmap(RightCorner);
end;

JAD
04-03-2007, 02:01 AM
I was going to use a little bitmap for the next time I get a wc lvl :p the problem is, it can't click the text cause its slightly in cursive, so it doesn't recognize it.

Jason2gs
04-03-2007, 02:08 AM
Slightly cursive? Hmm, and this is a popup option? Cursive sounds like it might be NPC Chat text, that's why I ask.

I might have some WCers that are close to a level up. I could take a screen shot/vid if you tell me what you want.

JAD
04-03-2007, 02:23 AM
Oh cool! I just want a very small bitmap that can tell when a popup for you've advanced a level comes up. If you could make that for me, I'd give you credits and that'd be awesome :)