; Oak's MO macro ; V 1.0 stop_requested = 0 slot1_x = 0 slot1_y = 0 processor_ore_x = 0 processor_ore_y = 0 processor_catalyst_x = 0 processor_catalyst_y = 0 feed_count = 1 zoomed = 0 fov = 110 tab_target_mode = 0 spam_switch = 0 alt_attack_mode = 0 block_on = 0 attacking = 0 arrow_count = 0 spell_dur = 3500 spell_cycle_dur = 60000 #IfWinActive, ahk_class LaunchUnrealUWindowsClient ; Start Tab and ALT-TAB handling code LALT & Tab:: Send {Alt down} Gosub, triggertab return ;Trigger ALT and TAB but not ALT-Tab ;!Tab:: ; Send {Alt down} ; Gosub, triggertab ;return ; Tab released $Tab Up:: ;Send {Alt up} Send {Tab up} return ; ALT Released $LALT Up:: Send {LALT Up} playinputsound() return ; Switch modes $^Tab:: if (tab_target_mode == 1){ playstopsound() tab_target_mode = 0 } else { playstartsound() tab_target_mode = 1 } ;tab_target_mode = (1 - tab_target_mode) return ; TAB hit triggertab: ; Target $Tab:: state := GetKeyState("Scrolllock", "T") if (tab_target_mode == 0){ Send {Tab down} } else { Loop { state := GetKeyState("Tab", "P") if (!state){ break } else { Send {Tab down} ; Auto-repeat consists of consecutive down-events (with no up-events). Sleep 30 ; The number of milliseconds between keystrokes (or use SetKeyDelay). Send {Tab up} ; Release the key. } } } return ; Use Right Windows key to replace ALT-TAB RWIN:: Send, {lalt down}{tab}{lalt up} return ; Trap Left windows key so it does not trigger any non-macro stuff *$LWIN:: ; Grab LWIN key so start menu does not pop up in game return ; End Tab Spam code ; code to spam weapon switch ; Used so we can geat weapon out as soon as possible after switching ; Replace XButton2 with what you use for weapon switch (default is X) ; Enable / disable spam mode $^XButton2:: if (spam_switch == 0){ playstartsound() spam_switch := 1 } else { playstopsound() spam_switch := 0 } return ; switch was pressed $XButton2:: if (spam_switch == 0){ Send {XButton2 down} } else { Loop { state := GetKeyState("XButton2", "P") if (!state){ break } else { Send {XButton2 down} ; Auto-repeat consists of consecutive down-events (with no up-events). Sleep 30 ; The number of milliseconds between keystrokes (or use SetKeyDelay). Send {XButton2 up} ; Release the key. } } } return ; Switch was released *XButton2 Up:: Send {XButton2 Up} return ; End switch spam code ; ALT attack mode ; Enable / disable toggle $^LButton:: if (alt_attack_mode == 0){ playstartsound() alt_attack_mode := 1 } else { playstopsound() alt_attack_mode := 0 } return ; Left button held *$LButton:: if (alt_attack_mode == 1){ Send {Alt down} } Send {Lbutton down} ; Send ALT up now else it triggers ALT Tab Send {Alt up} return ; Left button released *$LButton up:: if (alt_attack_mode == 1){ ;Send {Alt up} } Send {LButton up} return ; End ALT attack mode ; Blocking levelling LWIN & \:: if (block_on){ playstopsound() Sleep, 1000 block_on = 0 Send {RButton up} ;Click right up } else { playstartsound() Sleep, 1000 block_on = 1 Send {RButton down} ;Click right down } return ; Split 1 off a stack and click bottom right LWIN & `:: WinGetPos, tmpx, tmpy, tmpw, tmph, ahk_class LaunchUnrealUWindowsClient MouseGetPos, tmpx, tmpy Send +{click} Send 1{enter} Sleep, 1000 MouseMove, tmpw-30, tmph-30, 0 Click Sleep, 500 MouseMove, tmpx, tmpy, 0 return ; Zoom toggle LWIN & z:: if (!zoomed){ zoomed = 1 Send {enter}/eyefinity 30{enter} } else { Send {enter}/eyefinity %fov%{enter} zoomed = 0 } return ; Widescreen LWIN & +z:: if (fov == 110){ fov = 120 } else { fov = 110 } if (!zoomed){ Send {enter}/eyefinity %fov%{enter} } return ; Loot LWIN & l:: playstartsound() send {ENTER}/loot{ENTER} return ; Use LWIN & u:: playstartsound() send {ENTER}/use{ENTER} return ^o:: setprocessorore() return ^i:: setslot1() return ^p:: setprocessorcatalyst() return ^g:: ; Start Use StopTimers() playstartsound() Sleep, 1000 SetTimer, do_grab, % spell_dur Gosub, do_grab return ^f:: stacksofone() return ^z:: ; Stop all playstopsound() stop_requested = 1 StopTimers() Exit return ^d:: ; Start Clicking StopTimers() playstartsound() Sleep, 1000 SetTimer, do_attack, % spell_dur Gosub, do_attack return ^e:: ; Start Alt Clicking StopTimers() playstartsound() Sleep, 1000 SetTimer, do_alt_attack, % spell_dur Gosub, do_alt_attack return ^b:: ; Start Bowing / hard hitting StopTimers() playstartsound() Sleep, 1000 stop_requested = 0 ;SetTimer, do_bow, % spell_dur attacking = 0 arrows = 25 Gosub, do_bow return ^t:: ; Creature Control StopTimers() playstartsound() Sleep, 1000 SetTimer, do_tame, 4000 Gosub, do_tame return ^c:: ; Start casting on self ;StopTimers() playstartsound() ;Send +1 Sleep, 1000 ;SetTimer, do_cast_self, % spell_dur Gosub, do_cast_self ;Gosub, init_rest return ^h:: ; Start hitting hotkey ;StopTimers() playstartsound() SetTimer, do_hotkey, % spell_dur Gosub, do_hotkey return ^v:: ; Start casting on target StopTimers() playstartsound() ;Send +1 Sleep, 2000 SetTimer, do_cast_other, % spell_dur Gosub, do_cast_other Gosub, init_rest return StopTimers(){ Thread, NoTimers SetTimer, do_grab, off SetTimer, do_tame, off SetTimer, do_cast_self, off SetTimer, do_cast_other, off SetTimer, do_hotkey, off SetTimer, do_rest, off SetTimer, do_attack, off SetTimer, do_alt_attack, off SetTimer, do_bow, off Thread, NoTimers, false } ; Attack LWIN & a:: playstartsound() send {ENTER}attack{ENTER} return ; Wave LWIN & w:: playstartsound() send {ENTER}/emote Wave1{ENTER} return ; Follow LWIN & f:: playstartsound() send {ENTER}follow me{ENTER} return ; fEed LWIN & e:: playstartsound() send {ENTER}feed{ENTER} return ; pRotect LWIN & r:: playstartsound() send {ENTER}protect me{ENTER} return ; Check (Loyalty) LWIN & c:: playstartsound() send {ENTER}loyalty{ENTER} return ; banDage LWIN & d:: playstartsound() send {ENTER}bandage{ENTER} return ; Stay LWIN & s:: playstartsound() send {ENTER}stay{ENTER} return ; Guards LWIN & g:: playstartsound() send {ENTER}guards{ENTER} return ; Trade LWIN & t:: playstartsound() send {ENTER}{/}trade{ENTER} return ; Delay settings ^`:: playinputsound() say("Cast time: half a second") spell_dur = 500 return ^1:: playinputsound() say("Cast time: 1 second") spell_dur = 1000 return ^+1:: playinputsound() say("Cast time: 1.5 seconds") spell_dur = 1500 return ^2:: playinputsound() say("Cast time: 2 seconds") spell_dur = 2000 return ^+2:: playinputsound() say("Cast time: 2.5 seconds") spell_dur = 2500 return ^3:: playinputsound() say("Cast time: 3 seconds") spell_dur = 3000 return ^+3:: playinputsound() say("Cast time: 3.5 seconds") spell_dur = 3500 return ^4:: playinputsound() say("Cast time: 4 seconds") spell_dur = 4000 return ^+4:: playinputsound() say("Cast time: 4.5 seconds") spell_dur = 4500 return ^5:: playinputsound() say("Cast time: 5 seconds") spell_dur = 5000 return ^6:: playinputsound() say("Cast time: 6 seconds") spell_dur = 6000 return ; Spell loop timings ^F1:: playinputsound() spell_cycle_dur = 30000 say("Spell loop: 30 seconds") return ^F2:: playinputsound() spell_cycle_dur = 60000 say("Spell loop: 60 seconds") return ^F3:: playinputsound() spell_cycle_dur = 90000 say("Spell loop: 90 seconds") return ^F4:: playinputsound() spell_cycle_dur = 120000 say("Spell loop: 120 seconds") return ; end of hotkeys ^x:: do_rest: Thread, NoTimers Sleep, % spell_dur Send 0 Sleep, 75000 Gosub, init_rest Thread, NoTimers, false return #IfWinActive do_grab: send r return do_tame: if (feed_count == 5) { send {enter}feed{enter} feed_count = 1; } else { click feed_count ++ } return do_cast_self: Send !9 Sleep, % spell_dur checkstop() Send !9 Sleep, 1500 checkstop() GoSub, do_cast_self return do_cast_other: Send 9 Sleep, % spell_dur checkstop() Send 9 Sleep, 1500 checkstop() GoSub, do_cast_other return do_hotkey: Send !9 return do_attack: Click return do_alt_attack: Send !{Click} return do_bow: SetTimer, do_bow, off if (attacking){ attacking = 0 Click left up Sleep, 1000 checkstop() Gosub, do_bow } else { if (arrows){ arrows -- attacking = 1 checkstop() Click left down SetTimer, do_bow, % spell_dur } else { playstopsound() } } return init_rest: SetTimer, do_rest, % spell_cycle_dur return say(string) { tempFile = %A_TEMP%\TimeAnnounce.vbs FileAppend, ( LTRim Dim voic Set voic = WScript.CreateObject("SAPI.SpVoice") Set voic.voice = voic.GetVoices("", "Language=809").Item(0) voic.Speak("%string%") Set voic = nothing ), %tempFile% RunWait, WSCRIPT.EXE "%tempFile%",,, WSCRIPT_PID FileDelete, %tempFile% } setslot1(){ global slot1_x, slot1_y playinputsound() MouseGetPos, slot1_x, slot1_y } setprocessorore(){ global processor_ore_x, processor_ore_y playinputsound() MouseGetPos, processor_ore_x, processor_ore_y } setprocessorcatalyst(){ global processor_catalyst_x, processor_catalyst_y playinputsound() MouseGetPos, processor_catalyst_x, processor_catalyst_y } movetoinv(x,y){ global slot1_x, slot1_y tx := slot1_x + ((x - 1) * 44) ty := slot1_y + ((y - 1) * 44) MouseMove, tx , ty , 10 } movetoprocessorore(){ global processor_ore_x, processor_ore_y MouseGetPos, x, y MouseMove, x - 10, y, 80 MouseMove, processor_ore_x, processor_ore_y, 0 } movetoprocessorcatalyst(){ global processor_catalyst_x, processor_catalyst_y MouseGetPos, x, y MouseMove, x - 10, y, 80 MouseMove, processor_catalyst_x, processor_catalyst_y, 0 } movetoprocessorprocess(){ global processor_catalyst_x, processor_catalyst_y MouseMove, processor_catalyst_x, processor_catalyst_y+120, 0 } playstartsound(){ SoundPlay *48 } playstopsound(){ SoundPlay *16 } playinputsound(){ SoundPlay *64 } stacksofone(){ global stop_requested, slot1_x, slot1_y if ( (slot1_x = 0) || (slot1_y = 0)){ playstopsound() Exit } else { playstartsound() Sleep, 1000 x := 2 y := 1 while (y <=6){ while (x <=6){ if (stop_requested = 1){ stop_requested = 0 Exit } else { if (y=6 && x> 3){ Exit } movetoinv(6,6) ; grab 1 ore Send, {SHIFTDOWN} MouseClick, left Sleep, 1000 Send, {SHIFTUP}1{ENTER} Sleep, 500 movetoinv(x,y) ; dump it in the relevant pack slot MouseClick, left Sleep, 500 x++ } } y++ x := 1 Sleep, 1000 } } } processore(){ global stop_requested, slot1_x, slot1_y, processor_ore_x, processor_ore_y, processor_catalyst_x, processor_catalyst_y if ( (processor_ore_x = 0) || (processor_catalyst_x = 0) || (slot1_x = 0)){ playstopsound() Exit } else { playstartsound() Sleep, 1000 x = 2 y = 1 while (y <=6){ while (x <=6){ if (stop_requested = 1){ stop_requested = 0 Exit } else { if (y=6 && x> 3){ Exit } movetoinv(x,y) ; grab some ore SendEvent {Click down} movetoprocessorore() ; dump it in the ore slot SendEvent {Click up} Sleep, 500 movetoinv(1,1) ; grab catalyst SendEvent {Click down} movetoprocessorcatalyst() ; put it in the catalyst slot SendEvent {Click up} Sleep, 500 movetoprocessorprocess() ; click process MouseClick, left Sleep, 1000 x++ } } y++ x=1 Sleep, 1000 } } } checkstop(){ global stop_requested if (stop_requested == 1){ stop_requested = 0 Exit } else { return 1 } }