To use:
1) Copy the macro text.
2) Create a new text document.
3) Name it ClickPortal.inc
4) In the main macro, that you want to use it in, have the include tag at the top: #include ClickPortal.inc
5) Wherever you want the macro to run, simply use: /call ClickPortal
Optional) If you want the main script to know if you clicked the portal or not, you can use /varset variableName ${Macro.Return} || Then /if (${variableName }) { }
Optional) If you want to just run this as a macro, and not include it in another macro, just change the file extension from .inc to .mac and then rename Sub ClickPortal to Sub Main
Here is the code:
Code:
#event PClicked "#*#You got it open#*#"
Sub Event_PClicked
/varset clickedPortal 1
/delay 1s
/return
Sub ClickPortal
/declare attempt bool false
/declare pixelX int -500
/if (!${Defined[clickedPortal]}) {
/declare clickedPortal bool outer false
}
/varset clickedPortal 0
/echo Attempting to click the portal...
:DoClicks
/doevents
/if (!${clickedPortal}) {
/if (!${attempt}) {
/varset attempt 1
/click left center
/delay 1s
/goto :DoClicks
} else /if (${pixelX}<500 && !${clickedPortal}) {
/click left ${pixelX} -10
/varcalc pixelX ${pixelX}+10
/delay 0.2s ${clickedPortal}
/goto :DoClicks
} else / if (!${clickedPortal}) {
/echo Could not click the portal...
/return 0
}
}
/return 1