SetTitleMatchMode 2 ;TITLE NAME can be partial but must be case sensitive #SingleInstance off CoordMode, Mouse, Relative CoordMode, Pixel, Relative toggle = 0 TrayTip Toggled, Script is OFF press alt+1 to grab the window,2 return i = 0 a=3 if (toggle = 0) { !1:: ; <-- use the alt-o key to grab the active window's instance ID WinGet, WinID, ID, A MyWin = ahk_id %WinID% Traytip Toggled, The window has been selected Return } f9:: pause TrayTip Toggled, Script is PAUSED,2 Return f8:: Msgbox, Mining in slot 1, logout macro in slot 2, make sure your pickaxe which is on slot 3 is equipped, start the script on the char selection screen or press Z before starting. toggle = 1 TrayTip Toggled, Script is ON,2 While (toggle = 1) { IfWinExist, %MyWin% { WinActivate, %MyWin% ; Bring MO to front MouseClick, left, 213, 411 MouseClick, left, 213, 411 MouseClick, left, 213, 411 MouseClick, left, 213, 411 Send, {Alt Down} Sleep, 100 Send, !{Tab} Sleep, 100 Send, {Alt Up} Sleep, 40000 } a+1=a2 b = mod(a,2) if(b=0 && i!=0 && i<14) { ControlSend,,{%a%}, %MyWin% Sleep, 5000 ControlSend,,{%a2%}, %MyWin% } if(i=14) { a=3 loop, 7 { ControlSend,,{%a%}, %MyWin% a++ ControlSend,,{X}, %MyWin% Sleep, 1500 ControlSend,,{1}, %MyWin% Sleep, 1000 ControlSend,,{Z}, %MyWin% Sleep, 40000 } } Sleep 2500 TrayTip Toggled, We are starting to mine,2 if(i<=14) { ControlSend,,{X}, %MyWin% Sleep, 1500 ControlSend,,{1}, %MyWin% Sleep, 1000 ControlSend,,{Z}, %MyWin% Sleep, 300000 ControlSend,,{2}, %MyWin% Sleep, 9000 Sleep, 1500000 TrayTip Toggled, 5 minutes to alt+tab,2 Sleep, 300000 } i++ a++ } Return