Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Global variables for toggles
- toggle_attack := 0
- toggle_e := 0
- toggle_run := 0
- toggle_eat := 0
- stack_number := 1
- harvest_number := 1
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Autorun macro
- ;; Press F1 to toggle on/off
- arkAutoRun:
- IfWinNotActive ARK: Survival Evolved
- {
- SendInput {w up}
- SetTimer, arkAutoRun, off
- toggle_run = 0
- }
- return
- F1::
- IfWinNotActive ARK: Survival Evolved
- return
- if toggle_run = 0
- {
- SendInput {w down}
- SetTimer, arkAutoRun, 200
- toggle_run = 1
- ToolTip, AUTO RUN, 10, 50, 1
- }
- else
- {
- toggle_run = 0
- SendInput {w up}
- SetTimer, arkAutoRun, off
- Tooltip, , , , 1
- }
- return
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Autoattack macro
- ;; Press F3 to toggle on/off
- arkAutoAttack:
- IfWinActive ARK: Survival Evolved
- {
- SendEvent {Click}
- }
- else
- {
- SetTimer, arkAutoAttack, off
- }
- return
- F3::
- if toggle_attack = 0
- {
- toggle_attack = 1
- SetTimer, arkAutoAttack, 100
- ToolTip, AUTO ATTACK, 10, 10, 3
- }
- else
- {
- toggle_attack = 0
- SetTimer, arkAutoAttack, off
- Tooltip, , , , 3
- }
- return
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Autofeeed drink macro
- ;; Press F5 to toggle on/off
- arkAutoEat:
- IfWinActive ARK: Survival Evolved
- {
- Send {9 down}
- sleep 50
- send {9 up}
- sleep 50
- Send {0 down}
- sleep 50
- Send {0 up}
- }
- else
- {
- SetTimer, arkAutoEat, off
- }
- return
- F5::
- if toggle_eat = 0
- {
- toggle_eat = 1
- SetTimer, arkAutoEat, 2400000
- ToolTip, AUTO EAT, 10, 80, 5
- }
- else
- {
- toggle_eat = 0
- SetTimer, arkAutoEat, off
- Tooltip, , , , 5
- }
- return
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Auto E macro
- ;; Press F4 to toggle on/off
- arkAutoE:
- IfWinActive ARK: Survival Evolved
- {
- Send, e
- }
- else
- {
- SetTimer, arkAutoE, off
- }
- return
- F4::
- if toggle_e = 0
- {
- toggle_e = 1
- SetTimer, arkAutoE, 100
- ToolTip, AUTO E, 10, 30, 4
- }
- else
- {
- toggle_e = 0
- SetTimer, arkAutoE, off
- Tooltip, , , , 4
- }
- return
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Harvestt stack of cropplots macro
- ;; Press F7 to start
- F7::
- ToolTip, HARVEST A STACK, 10, 30, 7
- Send {Down down} ; Press down the up-arrow key.
- Sleep 4000 ; Keep it down for one second.
- Send {Down up} ; Release the up-arrow key.
- Sleep 500
- Send {Up down}
- Loop, 500
- {
- PixelSearch, Px, Py, 750, 450, 1250, 700, 0xFAFB06, 13, Fast
- if ErrorLevel
- sleep 10
- else
- {
- PixelSearch, Px, Py, 750, 450, 1250, 700, 0xFE5E44, 13, Fast
- if ErrorLevel
- sleep 10
- else
- {
- Send {Up up}
- break
- }
- }
- }
- Loop, 12
- {
- Send, f
- Sleep, 1300
- PixelGetColor,Color,1260,104 ; Return / Get the color of the pixel at the X and Y coordinates / at the X and Y location
- If Color=0xFFE780 ; 0xFFFFFF is the color White, you need to modify this color to your desired color
- {
- MouseClick, left, 1322, 177
- Sleep, 50
- send, trap
- Sleep, 50
- MouseClick, left, 1475, 189
- Sleep, 75
- Send, {esc}
- Sleep, 350
- Send {Up down} ; Press down the up-arrow key.
- Sleep 295 ; Keep it down for one second.
- Send {Up up} ; Release the up-arrow key.
- }
- Else
- break
- }
- Send {a down}
- sleep 1100
- Send {a up}
- sleep 100
- Tooltip, , , , 7
- return
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Harvest 6 sttacks of cropplots moving left. May need to adjust things
- ;; Press F9 to start
- F9::
- ToolTip, HARVEST 6 STACKS - %stack_number% / 6 - START, 10, 30, 9
- Loop, 6
- {
- ToolTip, HARVEST 6 STACKS - %stack_number% / 6 - Plot %harvest_number% / 12 - ALIGNING FOR FIRST STACK, 10, 30, 9
- Send {Down down} ; Press down the up-arrow key.
- Sleep 4000 ; Keep it down for one second.
- Send {Down up} ; Release the up-arrow key.
- Sleep 500
- Send {Up down}
- Loop, 500
- {
- PixelSearch, Px, Py, 750, 450, 1250, 700, 0xFAFB06, 13, Fast
- if ErrorLevel
- sleep 10
- else
- {
- PixelSearch, Px, Py, 750, 450, 1250, 700, 0xFE5E44, 13, Fast
- if ErrorLevel
- {
- ToolTip, HARVEST 6 STACKS - %stack_number% / 6 - Plot %harvest_number% / 12 - ALIGNING FOR FIRST PLOT, 10, 30, 9
- sleep 10
- }
- else
- {
- Send {Up up}
- break
- }
- }
- }
- Loop, 12
- {
- ToolTip, HARVEST 6 STACKS - %stack_number% / 6 - Plot %harvest_number% / 12 - OPENING PLOT, 10, 30, 9
- Send, f
- Sleep, 1650
- PixelGetColor,Color,1260,104 ; Return / Get the color of the pixel at the X and Y coordinates / at the X and Y location
- If Color=0xFFE780 ; 0xFFFFFF is the color White, you need to modify this color to your desired color
- {
- ToolTip, HARVEST 6 STACKS - %stack_number% / 6 - Plot %harvest_number% / 12 - HARVESTING PLOT, 10, 30, 9
- MouseClick, left, 1322, 177
- Sleep, 75
- send, trap
- Sleep, 75
- MouseClick, left, 1475, 189
- Sleep, 75
- Send, f
- Sleep, 450
- ToolTip, HARVEST 6 STACKS - %stack_number% / 6 - Plot %harvest_number% / 12 - MOVING TO PLOT ABOVE, 10, 30, 9
- Send {Up down} ; Press down the up-arrow key.
- Sleep 295 ; Keep it down for one second.
- Send {Up up} ; Release the up-arrow key.
- }
- Else
- {
- ToolTip, HARVEST 6 STACKS - %stack_number% / 6 - Plot %harvest_number% / 12 - NO MORE PLOTS FOUND - MOVING ON, 10, 30, 9
- break
- }
- harvest_number++
- }
- harvest_number := 1
- stack_number++
- ToolTip, HARVEST 6 STACKS - %stack_number% / 6 - Plot %harvest_number% / 12 - NO MORE PLOTS FOUND MOVING ON TO NEXT STACK, 10, 30, 9
- Send {a down}
- sleep 1100
- Send {a up}
- sleep 100
- }
- stack_number := 1
- Tooltip, , , , 9
- return
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Move left, to test distatnces
- ;; Press F10 to start
- F10::
- Send {a down}
- sleep 900
- Send {a up}
- sleep 100
- return
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ^!z:: ; Control+Alt+Z hotkey.
- MouseGetPos, MouseX, MouseY
- PixelGetColor, color, %MouseX%, %MouseY%
- MsgBox The color at the current cursor position %MouseX% %MouseY% is %color%.
- return
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Kill app if tthings go wrong
- ;; Press F11
- F11::ExitApp ;Escape key will exit... place this at the bottom of the script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement