Friday, 24 July 2015

Ark macros

Well here's how to get some useful macros running in Ark: Survival Evolved...

First, download and install and run Autohotkey from here:
http://www.autohotkey.com/

You should have an Autohotkey icon (white H in a green square) on your taskbar. Right-click this and Edit This Script.

Delete everything and replace with this code:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Ark autohotkey script
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

#NoEnv
#Warn
SendMode Input
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Global variables for toggles
toggle_attack := 0
toggle_e := 0
toggle_run := 0

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Autoattack macro
;; Press F1 to toggle on/off

arkAutoAttack:
  IfWinActive ARK: Survival Evolved
  {
    SendEvent {Click}
  }
  else
  {
    SetTimer, arkAutoAttack, off
  }
return

F1::
  if toggle_attack = 0
  {
    toggle_attack = 1
    SetTimer, arkAutoAttack, 100
    ToolTip, AUTO ATTACK, 10, 10, 1
  }
  else
  {
    toggle_attack = 0
    SetTimer, arkAutoAttack, off
    Tooltip, , , , 1
  }
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Auto E macro
;; Press F2 to toggle on/off

arkAutoE:
  IfWinActive ARK: Survival Evolved
  {
    Send, e
  }
  else
  {
    SetTimer, arkAutoE, off
  }
return

F2::
  if toggle_e = 0
  {
    toggle_e = 1
    SetTimer, arkAutoE, 100
    ToolTip, AUTO E, 10, 30, 2
  }
  else
  {
    toggle_e = 0
    SetTimer, arkAutoE, off
    Tooltip, , , , 2
  }
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Autorun macro
;; Press F3 to toggle on/off

arkAutoRun:
  IfWinNotActive ARK: Survival Evolved
  {
    SendInput {w up}
    SetTimer, arkAutoRun, off
    toggle_run = 0
  }
return
 
F3::
  IfWinNotActive ARK: Survival Evolved
    return
  if toggle_run = 0
  {
    SendInput {w down}
    SetTimer, arkAutoRun, 200
    toggle_run = 1
    ToolTip, AUTO RUN, 10, 50, 3
  }
  else
  {
    toggle_run = 0
    SendInput {w up}
    SetTimer, arkAutoRun, off
    Tooltip, , , , 3
  }
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 50 clicks macro
;; Press F4 to click 50 times at mouse position
F4::
  Loop 50
  {
    Click
    Sleep 20
  }
return



Press Ctrl-S to save, or go to File->Save
Right-click the Autohotkey icon in your taskbar again and click Reload This Script.

You should now be able to press F1 to toggle autoattack, F2 to toggle pressing E, F3 to toggle autorun and F4 to click 50 times at your mouse cursor.