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/HacklingRake/Code"

From A Tale in the Desert
Jump to navigationJump to search
Line 9: Line 9:
 
^!w::
 
^!w::
  
Counter = 1
 
  
 
SetDefaultMouseSpeed, 0
 
SetDefaultMouseSpeed, 0
 +
step = 1
 +
cycles = 0
  
 +
Gui, +AlwaysOnTop +ToolWindow
 +
Gui, Add, Text,, # Rotten Flax processing:
 +
Gui, Add, Edit, vFlax wp number
 +
Gui, Add, Button, gStart, GO
 +
Gui, Show
 +
return
 +
 +
 +
 +
Start:
 +
Gui, Submit
 +
Gui, Destroy
 +
Cycles := Floor(Flax/10)
  
 
Msgbox, First, make sure you loaded your hackling rake with materials before beginning`n`nHover mouse over a black letter, in the word ENDURANCE, in skills tab`n`nThis is the letter/skill 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...
 
Msgbox, First, make sure you loaded your hackling rake with materials before beginning`n`nHover mouse over a black letter, in the word ENDURANCE, in skills tab`n`nThis is the letter/skill 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...
Line 45: Line 59:
 
{
 
{
 
MouseGetPos, ClickX, ClickY
 
MouseGetPos, ClickX, ClickY
Msgbox, Hackling Rake menu (Step 1) location recorded!`n`nNote you can hit Ctrl+P to pause script anytime and Ctrl+P again to resume`n`nClick OK to start...
+
Msgbox, Hackling Rake menu (Step 1) location recorded!`n`nNote: you can hit Ctrl+P to PAUSE script anytime and Ctrl+P again to RESUME`n`nClick OK to Start...
 
}
 
}
  
Line 51: Line 65:
  
  
loop
+
loop
{
+
{
  
 
WinActivate, eGenesis Client
 
WinActivate, eGenesis Client
 
PixelGetColor, color, skillX, skillY, RGB
 
PixelGetColor, color, skillX, skillY, RGB
  
if color = 0x000000
+
if color = 0x000000
{
+
{
MouseGetPos, OldX, OldY
+
MouseGetPos, OldX, OldY
  
  
if (counter = 1) {
+
if (step = 1) {
 
;Step 1 (Remove Straw) - Top/1st menu choice
 
;Step 1 (Remove Straw) - Top/1st menu choice
 
Click %ClickX%, %ClickY%
 
Click %ClickX%, %ClickY%
} else if (counter = 2) {
+
} else if (step = 2) {
 
;Step 2 (Seperate) - 2nd menu choice
 
;Step 2 (Seperate) - 2nd menu choice
 
NewY := ClickY + 15
 
NewY := ClickY + 15
 
Click %ClickX%, %NewY%
 
Click %ClickX%, %NewY%
} else if (counter = 3) {
+
} else if (step = 3) {
 
;Step 3 (Refine) - 2nd menu choice
 
;Step 3 (Refine) - 2nd menu choice
 
NewY := ClickY + 15
 
NewY := ClickY + 15
 
Click %ClickX%, %NewY%
 
Click %ClickX%, %NewY%
} else if (counter = 4) {
+
} else if (step = 4) {
 
;Clean Hackling Rake - Top/1st menu choice
 
;Clean Hackling Rake - Top/1st menu choice
 
Click %ClickX%, %ClickY%
 
Click %ClickX%, %ClickY%
counter = 0
+
step = 0
 +
counter++
 
}
 
}
  
 
+
step++
counter++
 
 
MouseMove, %OldX%, %OldY%
 
MouseMove, %OldX%, %OldY%
 
Sleep 500
 
Sleep 500
}
+
 
}
+
if (Counter = Cycles)
 +
break
 +
 
 +
}
 +
}
 +
Msgbox, Done, processed %Flax% rotten flax, Exiting...
 
</pre>
 
</pre>

Revision as of 16:25, 23 February 2010

;Ctrl+Alt+W to start macro.
;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

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


SetDefaultMouseSpeed, 0
step = 1
cycles = 0

	Gui, +AlwaysOnTop +ToolWindow
	Gui, Add, Text,, # Rotten Flax processing:
	Gui, Add, Edit, vFlax wp number
	Gui, Add, Button, gStart, GO
	Gui, Show
	return



Start:
Gui, Submit
Gui, Destroy
Cycles := Floor(Flax/10)

Msgbox, First, make sure you loaded your hackling rake with materials before beginning`n`nHover mouse over a black letter, in the word ENDURANCE, in skills tab`n`nThis is the letter/skill 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

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 Endurance text location recorded!`n`nNow pinup your Hackling Rake menu. Make sure it says "Seperate Rotten Flax (Step 1, Remove Straw)"`n`nHover mouse over that option and press F2 to record the click position.`n`nClick OK to proceed...
Tooltip
break
}
}


KeyWait, F2, D
if ErrorLevel = 0
{
MouseGetPos, ClickX, ClickY
Msgbox, Hackling Rake menu (Step 1) location recorded!`n`nNote: you can hit Ctrl+P to PAUSE script anytime and Ctrl+P again to RESUME`n`nClick OK to Start...
}




		loop
		{

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

	if color = 0x000000
	{
	MouseGetPos, OldX, OldY


if (step = 1) {
;Step 1 (Remove Straw) - Top/1st menu choice
Click %ClickX%, %ClickY%
} else if (step = 2) {
;Step 2 (Seperate) - 2nd menu choice
NewY := ClickY + 15
Click %ClickX%, %NewY%
} else if (step = 3) {
;Step 3 (Refine) - 2nd menu choice
NewY := ClickY + 15
Click %ClickX%, %NewY%
} else if (step = 4) {
;Clean Hackling Rake - Top/1st menu choice
Click %ClickX%, %ClickY%
step = 0
counter++
}

step++
MouseMove, %OldX%, %OldY%
Sleep 500

if (Counter = Cycles)
break

	}
		}
Msgbox, Done, processed %Flax% rotten flax, Exiting...