The Wiki for Tale 6 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:Peshet/Rhapeshtrees"
From ATITD6
Jump to navigationJump to searchm (Created page with "<PRE> ; IMPORTANT INFO ABOUT GETTING STARTED: Lines that start with a ; semicolon, such as this one, are comments. They are not executed. ; This script has a special filename ...") |
m |
||
Line 32: | Line 32: | ||
; It explains how to perform common automation tasks such as sending | ; It explains how to perform common automation tasks such as sending | ||
; keystrokes and mouse clicks. It also explains more about hotkeys. | ; keystrokes and mouse clicks. It also explains more about hotkeys. | ||
+ | </PRE> | ||
+ | <BR> | ||
+ | <BR> | ||
+ | <PRE> | ||
+ | ;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/26/2010 | ||
+ | ;Last Update: 10/15/2010 | ||
+ | |||
+ | |||
+ | |||
+ | step = 1 | ||
+ | cycles = 0 | ||
+ | counter = 0 | ||
+ | |||
+ | Gui, +AlwaysOnTop +ToolWindow | ||
+ | Gui, Add, Text,, How many Rotten Flax`nare in your inventory? | ||
+ | Gui, Add, Edit, vFlax 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, 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... | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | 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... | ||
+ | |||
+ | EatTimer = 1 | ||
+ | #Persistent | ||
+ | SetTimer, Eat, 1000 | ||
+ | |||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | SetDefaultMouseSpeed, 0 | ||
+ | |||
+ | Gui, +AlwaysOnTop +ToolWindow | ||
+ | Gui, Add, Text, vClickText, Preparing to start... Standby!`n`n`n`n | ||
+ | Gui, Show | ||
+ | GuiControl, Text, ClickText, Preparing to start... Standby!`n`n`n`n | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | 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 | ||
+ | |||
+ | |||
+ | GuiControl, Text, ClickText, %counter% of %Cycles% cycles`n`nStep: %step% of 5 until next cycle | ||
+ | |||
+ | |||
+ | |||
+ | if (Eat == "Yes") | ||
+ | { | ||
+ | GuiControl, Text, ClickText, %counter% of %Cycles% cycles`n`nStep: %step% of 5 until next cycle`n`nEat Grilled: %EatTimer%s of 660s | ||
+ | |||
+ | } else { | ||
+ | GuiControl, Text, ClickText, %counter% of %Cycles% cycles`n`nStep: %step% of 5 until next cycle | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | if (Counter = Cycles) | ||
+ | break | ||
+ | |||
+ | } | ||
+ | } | ||
+ | SoundPlay *16,1 | ||
+ | GuiControl, Text, ClickText, Processed %Flax% rotten flax, Exiting... | ||
+ | PAUSE | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | Eat: | ||
+ | |||
+ | EatTimer -- | ||
+ | |||
+ | GuiControl, Text, ClickText, %counter% of %Cycles% cycles`n`nStep: %step% of 5 until next cycle`n`nEat Grilled: %EatTimer%s of 660s | ||
+ | |||
+ | |||
+ | if EatTimer = 0 | ||
+ | { | ||
+ | SoundPlay *64,1 | ||
+ | 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 | ||
+ | Sleep 1000 | ||
+ | } | ||
+ | return | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ^r::reload | ||
+ | ^p::Pause | ||
</PRE> | </PRE> |
Latest revision as of 20:41, 22 December 2011
; IMPORTANT INFO ABOUT GETTING STARTED: Lines that start with a ; semicolon, such as this one, are comments. They are not executed. ; This script has a special filename and path because it is automatically ; launched when you run the program directly. Also, any text file whose ; name ends in .ahk is associated with the program, which means that it ; can be launched simply by double-clicking it. You can have as many .ahk ; files as you want, located in any folder. You can also run more than ; one .ahk file simultaneously and each will get its own tray icon. ; SAMPLE HOTKEYS: Below are two sample hotkeys. The first is Win+Z and it ; launches a web site in the default browser. The second is Control+Alt+N ; and it launches a new Notepad window (or activates an existing one). To ; try out these hotkeys, run AutoHotkey again, which will load this file. #z::Run www.autohotkey.com ^!n:: IfWinExist Untitled - Notepad WinActivate else Run Notepad return ; Note: From now on whenever you run AutoHotkey directly, this script ; will be loaded. So feel free to customize it to suit your needs. ; Please read the QUICK-START TUTORIAL near the top of the help file. ; It explains how to perform common automation tasks such as sending ; keystrokes and mouse clicks. It also explains more about hotkeys.
;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/26/2010 ;Last Update: 10/15/2010 step = 1 cycles = 0 counter = 0 Gui, +AlwaysOnTop +ToolWindow Gui, Add, Text,, How many Rotten Flax`nare in your inventory? Gui, Add, Edit, vFlax 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, 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... } 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... EatTimer = 1 #Persistent SetTimer, Eat, 1000 } } SetDefaultMouseSpeed, 0 Gui, +AlwaysOnTop +ToolWindow Gui, Add, Text, vClickText, Preparing to start... Standby!`n`n`n`n Gui, Show GuiControl, Text, ClickText, Preparing to start... Standby!`n`n`n`n 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 GuiControl, Text, ClickText, %counter% of %Cycles% cycles`n`nStep: %step% of 5 until next cycle if (Eat == "Yes") { GuiControl, Text, ClickText, %counter% of %Cycles% cycles`n`nStep: %step% of 5 until next cycle`n`nEat Grilled: %EatTimer%s of 660s } else { GuiControl, Text, ClickText, %counter% of %Cycles% cycles`n`nStep: %step% of 5 until next cycle } if (Counter = Cycles) break } } SoundPlay *16,1 GuiControl, Text, ClickText, Processed %Flax% rotten flax, Exiting... PAUSE Eat: EatTimer -- GuiControl, Text, ClickText, %counter% of %Cycles% cycles`n`nStep: %step% of 5 until next cycle`n`nEat Grilled: %EatTimer%s of 660s if EatTimer = 0 { SoundPlay *64,1 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 Sleep 1000 } return ^r::reload ^p::Pause