The Wiki for Tale 4 is in read-only mode and is available for archival and reference purposes only. Please visit the current Tale 11 Wiki in the meantime.

If you have any issues with this Wiki, please post in #wiki-editing on Discord or contact Brad in-game.

User:Cegaiel/Macros/PopUpCloser/Code

From A Tale in the Desert
< User:Cegaiel‎ | Macros‎ | PopUpCloser
Revision as of 03:04, 6 March 2010 by Cegaiel (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
;Start script with Ctrl+Alt+W
;Pause: Ctrl+P (Resume again with another Ctrl+P)
;Reload script: Ctrl+R


^r::reload
^p::Pause
^!w::


IfWinExist eGenesis Client
{

	Gui, +AlwaysOnTop +ToolWindow
	Gui, Font, bold
	Gui, Add, Text, vLocationText, Record the OK button location
	Gui, Font, norm

	Gui, Add, Text,, 
	( LTrim
	Click on a tree now and Search for a Falcon Roost
		
	When the popup box occurs, then middle click (click mouse wheel) on OK button.

	Make sure you dont click on the black text, just any of the yellowish part of the button.


	You can pause the script with Ctrl+P = Pause Script (Ctrl+P again to resume)

	)
	Gui, Show


	WinGet, GameWinHandle, ID, eGenesis Client
	loop
	{

		WinActivate, eGenesis Client
		CoordMode, Mouse, Relative
		KeyWait, MButton, D
		KeyWait, MButton
		MouseGetPos, TestX, TestY, WinHandle
		if (WinHandle = GameWinHandle)
		{
			Gosub, RecordIcon
		}
		else
		{
			Gui, Destroy
			break
		}
	}
	return



	RecordIcon:
	MouseGetPos, LocX, LocY
	Gui, Destroy



	#Persistent
	SetTimer, SearchButton, 2000
	return


SetDefaultMouseSpeed, 0


			SearchButton:

			WinActivate, eGenesis Client

;Note the number 15 in the PixelSearch line, below, means look for the color, #EDCFBD within 15 shades.
;If it is not clicking the popupbox, then try raising it 5 shades at a time (20, 25).
;If it is mistaking sand in the background, then try lowerering it 1 shade at a time.

			PixelSearch, Px, Py, %LocX%, %LocY%, %LocX%, %LocY%, 0xECDFBD, 15, Fast|RGB

			if ErrorLevel = 0
			{
			MouseGetPos, OldMX, OldMY
			Click, %LocX%, %LocY%
			Sleep 300
			MouseMove, %OldMX%, %OldMY%, 0			
			}
			return



}