SRL Archive - SRL Snippets

Exit Squeal of Fortune Page


xtrapsp

2012-11-14 05:02:59

Hey guys,

I don't know if this is right or not, wrote it SUPER quickly as I'm fixing my Squeal of Fortune Script.

(*
ExitSquealOfFortunePage
~~~~~~~~~~~~~~~~~~~

.. code-block:: pascal

function ExitSquealOfFortunePage(): boolean;

Finds and exits the SquealOfFortune Page. Based on Coh3n & Ashaman88s snippet.

.. note::

Author: Coh3n & Ashaman88
Last Modified: July 28th, 2012 by Xtrapsp

Example:

.. code-block:: pascal

ExitSquealOfFortunePage();
*)
function ExitSquealOfFortunePage(): boolean;
var
w, h, x, y, xs, ys, xe, ye,SquealDTM: integer;
begin
if (SRL_ExitedSquealOfFortunepage) then
exit;

SquealCloseDTM := DTMFromString('mbQAAAHicY2VgYFjHwsCwCYhXAfFGKB0BFA+F4mgo/nfSgyFAR4AhwsONYXWDFoMlIyMDNsCIBYMBAAEWCk0=');
SquealCloseDTMHighlight := DTMFromString('mWAAAAHicY2FgYFjPxMCwCopB7CVAsZUMCPrfvyQgjgLi2Qz/DjkwoANGNAwCAB47Dqg=');

getClientDimensions(w, h);

// This DTM is the X in the top right. The Static for this is Mouse(754, 38-50,0,0,true);
if (findDTM(SquealCloseDTM,x,y,xs,ys,xe,ye)) then
begin
mouse(x, y, 1, 2, mouse_Move);
if (findDTM(SquealCloseDTMHighlight,x,y,xs,ys,xe,ye)) then
begin
mouse(x, y, 0, 0, mouse_Left);
result := true;
SRL_ExitedSquealOfFortunepage := true;
end;
end;
end;
FreeDTM(SquealCloseDTM);
FreeDTM(SquealCloseDTMHighlight);
end;

Thanks

Le Jingle

2012-11-14 05:16:22

Is there a reason for the CTS in there? I don't do much with any squeal pop-up's, etc, but from that snippet, does it server a purpose that I might be overlooking?

riwu

2012-11-14 05:20:24

From: xtrapsp
Hey guys,

I don't know if this is right or not, wrote it SUPER quickly as I'm fixing my Squeal of Fortune Script.

(*
ExitSquealOfFortunePage
~~~~~~~~~~~~~~~~~~~

.. code-block:: pascal

function ExitSquealOfFortunePage(): boolean;

Finds and exits the SquealOfFortune Page. Based on Coh3n & Ashaman88s snippet.

.. note::

Author: Coh3n & Ashaman88
Last Modified: July 28th, 2012 by Xtrapsp

Example:

.. code-block:: pascal

ExitSquealOfFortune();
*)
function ExitSquealOfFortune(): boolean;
var
w, h, x, y, xs, ys, xe, ye, tmpCTS,SquealDTM: integer;
begin
if (SRL_ExitedSquealOfFortunepage) then
exit;

SquealCloseDTM := DTMFromString('mbQAAAHicY2VgYFjHwsCwCYhXAfFGKB0BFA+F4mgo/nfSgyFAR4AhwsONYXWDFoMlIyMDNsCIBYMBAAEWCk0=');
SquealCloseDTMHighlight := DTMFromString('mWAAAAHicY2FgYFjPxMCwCopB7CVAsZUMCPrfvyQgjgLi2Qz/DjkwoANGNAwCAB47Dqg=');

tmpCTS := getColorToleranceSpeed();
setColorToleranceSpeed(1);

getClientDimensions(w, h);

// This DTM is the X in the top right. The Static for this is Mouse(754, 38-50,0,0,true);
if (findDTM(SquealCloseDTM,x,y,xs,ys,xe,ye)) then
begin
mouse(x, y, 1, 2, mouse_Move);
if (findDTM(SquealCloseDTM,x,y,xs,ys,xe,ye)) then
begin
mouse(x, y, 0, 0, mouse_Left);
result := true;
SRL_ExitedSquealOfFortunepage := true;
end;
end;
end;
FreeDTM(SquealCloseDTM);
FreeDTM(SquealCloseDTMHighlight);
setColorToleranceSpeed(tmpCTS);
end;

Thanks

Uhm the SOF pop up has not been updated?
I just tested the the original ExitSquealOfFortune and it closed the pop up perfectly for me.

Also in the rare occasion that your mouse is already at the cross, the script will fail to find SquealCloseDTM since only SquealCloseDTMHighlight is present. It seems like the original ExitSquealOfFortune didn't check for that either.

Also your search area is null.

xtrapsp

2012-11-14 05:21:16

From: Le Jingle
Is there a reason for the CTS in there? I don't do much with any squeal pop-up's, etc, but from that snippet, does it server a purpose that I might be overlooking?


As I said it's just a quick snippet I chucked together, feel free to slice and remove :)
I believe the CTS is there because of the old Goblin section from the previous script Ash and Coh3n made for the little popup.

I'l change it :)

From: riwu
Uhm the SOF pop up has not been updated?
I just tested the the original ExitSquealOfFortune and it closed the pop up perfectly for me.

Also in the rare occasion that your mouse is already at the cross, the script will fail to find SquealCloseDTM since only SquealCloseDTMHighlight is present. It seems like the original ExitSquealOfFortune didn't check for that either.

Also your search area is null.


This isn't the popup, this is a slight modification of that popup bit to close the page. (Where you actually do the spins)

Ashaman88

2012-11-14 07:28:17

From: Le Jingle
Is there a reason for the CTS in there? I don't do much with any squeal pop-up's, etc, but from that snippet, does it server a purpose that I might be overlooking?


In the orig function it searches for the goblin first, makes a box around it, then searches for the dtm in that box. Helped to prevent false positives using just one of those methods

Xtra this is for when the sof page is up already?

xtrapsp

2012-11-14 07:39:43

From: Ashaman88
In the orig function it searches for the goblin first, makes a box around it, then searches for the dtm in that box. Helped to prevent false positives using just one of those methods

Xtra this is for when the sof page is up already?


indeed it is, It has a static click in the comments but I prefer this :3

riwu

2012-11-14 07:46:17

From: Ashaman88
In the orig function it searches for the goblin first, makes a box around it, then searches for the dtm in that box. Helped to prevent false positives using just one of those methods

Xtra this is for when the sof page is up already?

Hence why bitmap should be used. No false positive if you do it correctly. DTM is overrated :p


From: xtrapsp

This isn't the popup, this is a slight modification of that popup bit to close the page. (Where you actually do the spins)

Oh then you shouldn't use that as base, a lot unnecessary things.

xtrapsp

2012-11-14 07:57:48

From: riwu
Hence why bitmap should be used. No false positive if you do it correctly. DTM is overrated :p

Oh then you shouldn't use that as base, a lot unnecessary things.


"Wrote it SUPER quickly as I'm fixing my Squeal of Fortune Script."