<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.atitd.org/wiki/t5w/index.php?action=history&amp;feed=atom&amp;title=User%3ACegaiel%2FMacros%2FSkillsTimer%2FCode</id>
	<title>User:Cegaiel/Macros/SkillsTimer/Code - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://www.atitd.org/wiki/t5w/index.php?action=history&amp;feed=atom&amp;title=User%3ACegaiel%2FMacros%2FSkillsTimer%2FCode"/>
	<link rel="alternate" type="text/html" href="http://www.atitd.org/wiki/t5w/index.php?title=User:Cegaiel/Macros/SkillsTimer/Code&amp;action=history"/>
	<updated>2026-06-03T17:42:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>http://www.atitd.org/wiki/t5w/index.php?title=User:Cegaiel/Macros/SkillsTimer/Code&amp;diff=19289&amp;oldid=prev</id>
		<title>Cegaiel: Created page with &quot;&lt;pre&gt; ;Ctrl+Alt+W to start script ;Ctrl+P to pause script and Ctrl+P again to resume ;The AHK icon in system tray will turn red while paused. ;Hold F2 for 1 second, while script ...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.atitd.org/wiki/t5w/index.php?title=User:Cegaiel/Macros/SkillsTimer/Code&amp;diff=19289&amp;oldid=prev"/>
		<updated>2010-09-15T08:11:29Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; ;Ctrl+Alt+W to start script ;Ctrl+P to pause script and Ctrl+P again to resume ;The AHK icon in system tray will turn red while paused. ;Hold F2 for 1 second, while script ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
;Ctrl+Alt+W to start script&lt;br /&gt;
;Ctrl+P to pause script and Ctrl+P again to resume&lt;br /&gt;
;The AHK icon in system tray will turn red while paused.&lt;br /&gt;
;Hold F2 for 1 second, while script is running, to pause script and reset click counter to zero.&lt;br /&gt;
;Ctrl+R to reload script&lt;br /&gt;
;Date: 9/15/2010&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
^r::reload&lt;br /&gt;
^p::Pause&lt;br /&gt;
^!w::&lt;br /&gt;
&lt;br /&gt;
;X/Y mouse coordinates of a popup box's OK button (yellowish part of the OK button, not the black text)&lt;br /&gt;
;530,479 is the position of OK button in 1024x768 resolution&lt;br /&gt;
;You can find out your position, at your resolution, with a free tool called Magnify at:&lt;br /&gt;
;http://www.atitd.org/wiki/tale4/User:Cegaiel/Macros#Tool:_Magnify_.28Windows_Executable.29&lt;br /&gt;
;The purpose of this, is when popup boxes occurs (ie error message when you dont have enough materials to repair a mine)&lt;br /&gt;
;The script will make a Windows Error sound and then pause script.&lt;br /&gt;
;Once you figure out the problem, Ctrl+P, to resume/unpause where you left of at.&lt;br /&gt;
&lt;br /&gt;
PopX = 530&lt;br /&gt;
PopY = 479&lt;br /&gt;
&lt;br /&gt;
counter = 0&lt;br /&gt;
&lt;br /&gt;
	Gui, +AlwaysOnTop +ToolWindow&lt;br /&gt;
	Gui, Add, Text,, # of Clicks to Stop?`n(Blank=Unlimited, don't stop):&lt;br /&gt;
	Gui, Add, Edit, vClicks wp number&lt;br /&gt;
	Gui, Add, Text,, Eating Grilled Food?`n(Automatically eat every 10 Teppy Min)&lt;br /&gt;
	Gui, Add, DropDownList, vEat Choose1, No|Yes&lt;br /&gt;
	Gui, Add, Button, gStart, Next&lt;br /&gt;
	Gui, Show&lt;br /&gt;
	return&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Start:&lt;br /&gt;
Gui, Submit&lt;br /&gt;
Gui, Destroy&lt;br /&gt;
&lt;br /&gt;
Msgbox, Hover mouse over a black letter, in skills tab (ie Endurance for digging)`n`nThe letter/skill you want to hover is the one that turns red when you get tired`n`nWhen you are hovering a black letter it will tell you in the tooltip.`n`nPress F2, when it tells you in tooltip, to set position.`n`nClick OK to proceed...&lt;br /&gt;
&lt;br /&gt;
WinActivate, eGenesis Client&lt;br /&gt;
SetDefaultMouseSpeed, 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
loop&lt;br /&gt;
{&lt;br /&gt;
MouseGetPos, skillX, skillY&lt;br /&gt;
PixelGetColor, color, skillX, skillY, RGB&lt;br /&gt;
&lt;br /&gt;
if color = 0x000000&lt;br /&gt;
{&lt;br /&gt;
ToolTip, Coordinates: %skillX%`, %skillY%`nColor: %color%`n`n* HOVERING BLACK *`n* Press F2 to set location *&lt;br /&gt;
} else {&lt;br /&gt;
ToolTip, Coordinates: %skillX%`, %skillY%`nColor: %color%&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GetKeyState, state, F2&lt;br /&gt;
if state = D&lt;br /&gt;
{&lt;br /&gt;
color = 0x000000&lt;br /&gt;
MsgBox Skills text location recorded, now its time to record the click location.`n`nHover where you want to click and press F2.`n`nFor a dig (or other skills related tasks), pin up the Dig Hole menu and set the click to the word Dig.`n`nFor limestone/dirt set the click position on the icon.`n`nClick OK to proceed...&lt;br /&gt;
Tooltip&lt;br /&gt;
WinActivate, eGenesis Client&lt;br /&gt;
break&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
KeyWait, F2, D&lt;br /&gt;
if ErrorLevel = 0&lt;br /&gt;
{&lt;br /&gt;
MouseGetPos, ClickX, ClickY&lt;br /&gt;
Msgbox, Click location recorded!`n`nNote: you can hit Ctrl+P to PAUSE script anytime and Ctrl+P again to RESUME`n`nHold F2, while the script is running, to pause and reset click numbers.`nThen just Ctrl+P to unpause script and continue at 0 clicks.`n`nClick OK to continue...&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		if (Eat == &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		{&lt;br /&gt;
&lt;br /&gt;
Msgbox, One more step! You have selected that you will be eating grilled foods!`n`nPinup the Esc, Skills, Consume menu and set the click position of the &amp;quot;Eat Grilled food&amp;quot; menu by hovering and hitting F2.`n`nNote: When this macro begins, it will first eat (so don't manually eat first).`n`nThen every 10 Teppy Mins (11:00 real time), it will automatically click/eat the grilled food.`n`nClick OK, then hit F2 over the grilled food consume menu to set...&lt;br /&gt;
&lt;br /&gt;
	WinActivate, eGenesis Client&lt;br /&gt;
&lt;br /&gt;
	KeyWait, F2, D&lt;br /&gt;
	if ErrorLevel = 0&lt;br /&gt;
	{&lt;br /&gt;
	MouseGetPos, EatX, EatY&lt;br /&gt;
	Msgbox, Eat location recorded!`n`nClick OK to eat food and start the macro...&lt;br /&gt;
&lt;br /&gt;
	EatTimer = 1&lt;br /&gt;
	#Persistent &lt;br /&gt;
	SetTimer, Eat, 1000&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	Gui, +AlwaysOnTop +ToolWindow&lt;br /&gt;
	Gui, Add, Text, vClickText, Preparing to start... Standby!`n`n&lt;br /&gt;
	Gui, Show&lt;br /&gt;
	GuiControl, Text, ClickText, Preparing to start... Standby!`n`n&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;This just appends the &amp;quot;of #&amp;quot; or the &amp;quot;of Unlimited&amp;quot; text on GUI bar.&lt;br /&gt;
if (Clicks &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
Max := Clicks&lt;br /&gt;
} else {&lt;br /&gt;
Max := &amp;quot;Unlimited&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	loop&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
WinActivate, eGenesis Client&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;This searches for a popup box, which would suggest something likely went wrong&lt;br /&gt;
&lt;br /&gt;
			PixelSearch, Px, Py, %PopX%, %PopY%, %PopX%, %PopY%, 0xECDFBD, 15, Fast|RGB&lt;br /&gt;
&lt;br /&gt;
			if ErrorLevel = 0&lt;br /&gt;
			{&lt;br /&gt;
			SoundPlay *16,1&lt;br /&gt;
			Msgbox, Pop Up box detected! Pausing macro...`n`nNo problem, just find the problem, correct and hit Ctrl+P.`n`nYou will resume from where you left off at...&lt;br /&gt;
			PAUSE&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
;End searching for popupbox&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GetKeyState, state, F2&lt;br /&gt;
if state = D&lt;br /&gt;
{&lt;br /&gt;
Msgbox, Reseting click# to 0 and Pausing script...`n`nNote the GUI status bar will continue showing your last click# until you resume.`n`nHit Ctrl+P to restart/resume the script (with same click positions) and begin at 0 clicks.&lt;br /&gt;
counter = 0&lt;br /&gt;
PAUSE&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PixelGetColor, color, skillX, skillY, RGB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if color = 0x000000&lt;br /&gt;
{&lt;br /&gt;
counter++&lt;br /&gt;
MouseGetPos, OldX, OldY&lt;br /&gt;
Click %ClickX%, %ClickY% &lt;br /&gt;
MouseMove, %OldX%, %OldY%&lt;br /&gt;
Sleep 300&lt;br /&gt;
&lt;br /&gt;
		if (Eat == &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		{&lt;br /&gt;
		GuiControl, Text, ClickText, Clicks: %counter% of %Max%`n`nEat Grilled: %EatTimer%s of 660s&lt;br /&gt;
		} else {&lt;br /&gt;
		GuiControl, Text, ClickText, Clicks: %counter% of %Max%`n`nCtrl+R: Reload, +P: Pause&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if (counter = Clicks)&lt;br /&gt;
{&lt;br /&gt;
GuiControl, Text, ClickText, Clicks: %counter% of %Max% - Done!`n`nCtrl+R to Reload/Reset&lt;br /&gt;
SoundPlay *16,1&lt;br /&gt;
PAUSE&lt;br /&gt;
;The purpose of the pause is because the #Persistent Eat sub still runs even when done, this is just a lazy way to &amp;quot;exit the script&amp;quot;&lt;br /&gt;
;Exit will not stop a persistent and my other choice is ExitApp which will completely terminate the script and the counter GUI.&lt;br /&gt;
;The Eat sub runs whether you choose grilled foods or not. Even though its in an If statement, it still runs, so thats my workaround =/&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	Eat: &lt;br /&gt;
&lt;br /&gt;
	EatTimer --&lt;br /&gt;
	GuiControl, Text, ClickText, Clicks: %counter% of %Max%`n`nEat Grilled: %EatTimer%s of 660s&lt;br /&gt;
	&lt;br /&gt;
	if EatTimer = 0&lt;br /&gt;
	{&lt;br /&gt;
	SoundPlay *64,1&lt;br /&gt;
	GuiControl, Text, ClickText, Eating grilled food...&lt;br /&gt;
	MouseGetPos, OldMX, OldMY&lt;br /&gt;
	;Click the Eat Grilled food menu&lt;br /&gt;
	Click, %EatX%, %EatY%			&lt;br /&gt;
	Sleep, 500&lt;br /&gt;
	MouseMove, %OldMX%, %OldMY%, 0			&lt;br /&gt;
	EatTimer = 660&lt;br /&gt;
	Sleep 1000&lt;br /&gt;
	}&lt;br /&gt;
	return&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cegaiel</name></author>
	</entry>
</feed>