SRL Archive - SRL Suggestions

FindPopup (dwarfen axe level 10)


Harry

2011-11-18 12:58:47

{*******************************************************************************
function FindPopup: Boolean;
by: Harry
Description: A simple functinds and closes the "please buy RS Members" popup
that happens when you reach lvl 10 in any skill.
*******************************************************************************}
function FindPopup: Boolean;
begin
Result := False;
if (GetColor(485, 40) = 2569093) then // Parts of red X, checked in two different spots to reduce false-positives
if (GetColor(488, 40) = 11189720) then
begin
Result := True;
TakeScreen('Found Popup');
AddToSRLLog('******** FOUND POPUP ********');
MouseBox(482, 35, 492, 44, 1); // Box around the X, to close it.
Wait(1000+Random(3000));
end;
end;

Handles the dwarfen axe popup. Works great, tested it on a few accounts. The colors nor the position changes, and the mousebox is the outside border of the popup red X. I'm honestly surprised no one has made this yet. Also needs to also be added to FindNormalRandoms. :)

Nava2

2011-11-18 13:07:07

What are the colours for? Perhaps these should be constants and you need some comments to explain what parts are haha.

Sorry, I'm silly.

Harry

2011-11-18 13:08:35

Colors are parts of the red X. I check one point then another to lower the chance of any false positives.

Tickyy

2011-11-18 14:04:48

Inside at FindNormalRandoms?

Harry

2011-11-18 14:06:42

From: Tickyy
Inside at FindNormalRandoms?

Yes, you'd want to add it there. I didn't do that as I'd hope the devs would know how :p

Also got lots of these in my Simba folder now, feels good.

Nava2

2011-11-18 15:35:40

Hmm, I haven't done random dev in awhile, do we screenshot every random?

Seems excessive.

Also I did push this to SRL5 hopefully someone else can push to 4.

Harry

2011-11-18 15:36:55

I think for the FindX ones it does. In case of false-detections they can be uploaded.

DeSnob

2011-11-18 16:06:07

Can't this be shortened a bit?
  if (GetColor(485, 40) = 2569093) then // Parts of red X, checked in two different spots to reduce false-positives
if (GetColor(488, 40) = 11189720) then
To this:
  if (GetColor(485, 40) = 2569093) and (GetColor(488, 40) = 11189720) then

Harry

2011-11-18 16:08:19

From: DeSnob
Can't this be shortened a bit?
  if (GetColor(485, 40) = 2569093) then // Parts of red X, checked in two different spots to reduce false-positives
if (GetColor(488, 40) = 11189720) then
To this:
  if (GetColor(485, 40) = 2569093) and (GetColor(488, 40) = 11189720) then

No, this is intentional. If the first condition is met, it calls it as a failsafe. Calling two requests uses more resources than just once.

DeSnob

2011-11-18 16:09:29

Ah, didn't know that. Thanks. :)

Nava2

2011-11-18 16:52:57

From: Harry
No, this is intentional. If the first condition is met, it calls it as a failsafe. Calling two requests uses more resources than just once.


On the contrary, PS/Lape use Short Circuit evaluation. Thus it will not search for the second one unless the first one is true. ;)

It really makes no difference, but I prefer the seperate lines.. I'm just a stickler for clean code.

Coh3n

2011-11-18 18:27:47

Nava, why don't you take the 30 seconds and setup SRL4 on your computer? I'll commit later if you're still lazy.

Nice job, Harry.

E: I don't really like taking a screenshot each time, same for each random. The bitmaps are over 1MB and add up over time. Especially when 99% of the time they're not ever used.

E: Committed.

Harry

2011-11-18 18:49:43

They are good for finding false positives though :p Might be a better idea to make TakeScreen save as a PNG? Or setupSRL screenshots:=False or whatever the var was.

WT-Fakawi

2011-11-19 03:21:48

Good work. I have found there is at least one more of those Popups, forgot where. I recall when surpassing lvl 10 mage and/or range. I have got it recorded in HLR somewhere :)

Also, while you are at this. Can you please also make a check for the silly and oddlooking click to continue that keeps popping up (whenever you exceeed lvl 10….sling is not recommended for level above 10 blah) until you clicked it?

Harry

2011-11-19 09:53:50

IMO that should be handled in your script. Just call ClickToContinue a lot :) It could be done but it's too skill-specific to be in the antirandoms I think.