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 10: Line 10:
  
  
SetDefaultMouseSpeed, 0
 
 
step = 1
 
step = 1
 
cycles = 0
 
cycles = 0
  
 
Gui, +AlwaysOnTop +ToolWindow
 
Gui, +AlwaysOnTop +ToolWindow
Gui, Add, Text,, # Rotten Flax processing:
+
Gui, Add, Text,, How many Rotten Flax`nare in your inventory?
 
Gui, Add, Edit, vFlax wp number
 
Gui, Add, Edit, vFlax wp number
Gui, Add, Button, gStart, GO
+
Gui, Add, Button, gStart, Continue
 
Gui, Show
 
Gui, Show
 
return
 
return
Line 28: Line 27:
 
Cycles := Floor(Flax/10)
 
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, This requires %Cycles% cycles, the macro will stop automatically after %Cycles% cycles.`n`nNow, hover 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
 
WinActivate, eGenesis Client
 +
SetDefaultMouseSpeed, 0
  
 
loop
 
loop

Revision as of 06:19, 5 March 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::


step = 1
cycles = 0

	Gui, +AlwaysOnTop +ToolWindow
	Gui, Add, Text,, How many Rotten Flax`nare in your inventory?
	Gui, Add, Edit, vFlax wp number
	Gui, Add, Button, gStart, Continue
	Gui, Show
	return



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

Msgbox, This requires %Cycles% cycles, the macro will stop automatically after %Cycles% cycles.`n`nNow, hover 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
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 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...