EZ Server

General Category => Quest and Guides => Topic started by: grim2594 on June 20, 2016, 06:25:55 pm



Title: Portal click macro
Post by: grim2594 on June 20, 2016, 06:25:55 pm
As requested... Here is a simple macro that will click across the screen, in the attempt to enter a portal.

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


Title: Re: Portal click macro
Post by: cyantheblue on June 20, 2016, 06:48:17 pm
thanks so much for posting this it works great for 6a/6b mirror (sure would work for aungish dragon door also) alot nicer then alt tabing all 12 boxxes threw