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.

Difference between revisions of "User:Cegaiel/Macros/SkillsTimer/Code"

From A Tale in the Desert
Jump to navigationJump to search
Line 4: Line 4:
 
;The AHK icon in system tray will turn red while paused.
 
;The AHK icon in system tray will turn red while paused.
 
;Ctrl+R to reload script
 
;Ctrl+R to reload script
 +
;Date: 3/06/2010
 +
  
 
^r::reload
 
^r::reload
Line 80: Line 82:
 
Click %EatX%, %EatY%  
 
Click %EatX%, %EatY%  
  
 +
Gui, +AlwaysOnTop +ToolWindow
 +
Gui, Add, Text, vClickText, Preparing to start... Standby!`n`n
 +
Gui, Show
 +
GuiControl, Text, ClickText, Preparing to start... Standby!`n`n
 +
 +
EatTimer = 660
 
#Persistent  
 
#Persistent  
SetTimer, Eat, 660000
+
SetTimer, Eat, 1000
 +
}
  
  
}
+
;Else Eat = No
 +
} else {
 +
Gui, +AlwaysOnTop +ToolWindow
 +
Gui, Add, Text, vClickText, Preparing to start... Standby!
 +
Gui, Show
 +
GuiControl, Text, ClickText, Preparing to start... Standby!
 +
}
 +
 
  
}
 
  
 +
;This just appends the "of #" or the "of Unlimited" text on GUI bar.
 +
if (Clicks > 0)
 +
{
 +
Max := Clicks
 +
} else {
 +
Max := "Unlimited"
 +
}
  
  
Line 96: Line 118:
 
WinActivate, eGenesis Client
 
WinActivate, eGenesis Client
 
PixelGetColor, color, skillX, skillY, RGB
 
PixelGetColor, color, skillX, skillY, RGB
 +
  
 
if color = 0x000000
 
if color = 0x000000
Line 104: Line 127:
 
Sleep 500
 
Sleep 500
 
counter++
 
counter++
;Msgbox, #Black Detected: %A_Index%, #Clicks: %Clicks%
+
 
 +
if (Eat == "Yes")
 +
{
 +
GuiControl, Text, ClickText, Clicks: %counter% of %Max%`n`nAuto Eat: %EatTimer%s
 +
} else {
 +
GuiControl, Text, ClickText, Clicks: %counter% of %Max%
 +
}
 +
 
  
 
if (counter = Clicks)
 
if (counter = Clicks)
 
break
 
break
  
}
+
}
 
 
GetKeyState, state, F2
 
if state = D
 
{
 
MsgBox Clicks: %counter%
 
}
 
 
 
  
 
}
 
}
Line 126: Line 149:
  
 
Eat:  
 
Eat:  
 +
EatTimer --
 +
GuiControl, Text, ClickText, Clicks: %counter% of %Max%`n`nAuto Eat: %EatTimer%s
 +
 +
if EatTimer = 0
 +
{
 +
GuiControl, Text, ClickText, Eating grilled food...
 
MouseGetPos, OldMX, OldMY
 
MouseGetPos, OldMX, OldMY
 
;Click the Eat Grilled food menu
 
;Click the Eat Grilled food menu
Line 131: Line 160:
 
Sleep, 500
 
Sleep, 500
 
MouseMove, %OldMX%, %OldMY%, 0
 
MouseMove, %OldMX%, %OldMY%, 0
 +
EatTimer = 660
 +
}
 
return
 
return
 
</pre>
 
</pre>

Revision as of 06:36, 6 March 2010

;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.
;Ctrl+R to reload script
;Date: 3/06/2010


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

counter = 0

	Gui, +AlwaysOnTop +ToolWindow
	Gui, Add, Text,, # of Clicks to Stop?`n(Blank=Unlimited, don't stop):
	Gui, Add, Edit, vClicks wp number
	Gui, Add, Text,, Eating Grilled Food?`n(Automatically eat every 10 Teppy Min)
	Gui, Add, DropDownList, vEat Choose1, No|Yes

	Gui, Add, Button, gStart, Next
	Gui, Show
	return



Start:
Gui, Submit
Gui, Destroy

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...

WinActivate, eGenesis Client
SetDefaultMouseSpeed, 0


loop
{
MouseGetPos, skillX, skillY
PixelGetColor, color, skillX, skillY, RGB

if color = 0x000000
{
ToolTip, Coordinates: %skillX%`, %skillY%`nColor: %color%`n`n* HOVERING BLACK *`n* Press F2 to set location *
} else {
ToolTip, Coordinates: %skillX%`, %skillY%`nColor: %color%
}


GetKeyState, state, F2
if state = D
{
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...
Tooltip
WinActivate, eGenesis Client
break
}
}


KeyWait, F2, D
if ErrorLevel = 0
{
MouseGetPos, ClickX, ClickY
Msgbox, Click location recorded!`n`nNote: you can hit Ctrl+P to PAUSE script anytime and Ctrl+P again to RESUME`n`nHit F2, while the script runs, to see how many clicks you've done so far.`n`nClick OK to continue...
}


	if (Eat == "Yes")
	{

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 "Eat Grilled food" 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...

WinActivate, eGenesis Client


KeyWait, F2, D
if ErrorLevel = 0
{
MouseGetPos, EatX, EatY
Msgbox, Eat location recorded!`n`nClick OK to eat food and start the macro...
Click %EatX%, %EatY% 

	Gui, +AlwaysOnTop +ToolWindow
	Gui, Add, Text, vClickText, Preparing to start... Standby!`n`n
	Gui, Show
	GuiControl, Text, ClickText, Preparing to start... Standby!`n`n

	EatTimer = 660
	#Persistent 
	SetTimer, Eat, 1000
}


	;Else Eat = No
	} else {
	Gui, +AlwaysOnTop +ToolWindow
	Gui, Add, Text, vClickText, Preparing to start... Standby!
	Gui, Show
	GuiControl, Text, ClickText, Preparing to start... Standby!
	}



;This just appends the "of #" or the "of Unlimited" text on GUI bar.
if (Clicks > 0)
{
Max := Clicks
} else {
Max := "Unlimited"
}



	loop
	{

WinActivate, eGenesis Client
PixelGetColor, color, skillX, skillY, RGB


if color = 0x000000
{
MouseGetPos, OldX, OldY
Click %ClickX%, %ClickY% 
MouseMove, %OldX%, %OldY%
Sleep 500
counter++

		if (Eat == "Yes")
		{
		GuiControl, Text, ClickText, Clicks: %counter% of %Max%`n`nAuto Eat: %EatTimer%s
		} else {
		GuiControl, Text, ClickText, Clicks: %counter% of %Max%
		}


if (counter = Clicks)
break

		}

	}
Msgbox, Done, executed %counter% clicks, Exiting...





	Eat: 
	EatTimer --
	GuiControl, Text, ClickText, Clicks: %counter% of %Max%`n`nAuto Eat: %EatTimer%s
	
	if EatTimer = 0
	{
	GuiControl, Text, ClickText, Eating grilled food...
	MouseGetPos, OldMX, OldMY
	;Click the Eat Grilled food menu
	Click, %EatX%, %EatY%			
	Sleep, 500
	MouseMove, %OldMX%, %OldMY%, 0			
	EatTimer = 660
	}
	return