
; Mageloc powerleveler for shadowbane
; Expects to be 2-3 ticks above the ground to avoid melee damage.
; Must be in combat mode.  You should buff yourself and stance before
; starting.
;
; Flys, nukes, and uses spells to maintain resources at livable levels.
;
; $Id: mageloc.au3,v 1.5 2004/02/10 05:36:11 hag Exp $
;
; Key Bindings:
; SurpassLimits		L
; Needs of the One	M
; Mind and Body One	0
; Free Thought		9
; Heal			H
; Offensive Stance	O
; Psychic Shout		\
; Best Weapon Styles	1, 2, and 3

; Global variable indicating which style to use.
$style_counter = 0

InitWorld()
While(1)
    ;; Can probably increase the loop size here as you get higher
    ;; level buffs.
    For $i = 1 to 8
	ShoutLimitHeal()
	ShoutManaSuck()
	ShoutLimitHeal()
    Next
    ;; Refresh stance and buffs.
    Stance()
    Sleep(500)
    ShoutLimitHeal()
    ConSpiBuff()
    IntBuff()
    SurpassLimits()
    Sleep(500)
    Heal()
    Sleep(500)
WEnd

;; We throw enough spells that we want to style around that we can't
;; just keep it simple stupid; we alternate between three to keep the
;; timers happy.
Func DoStyle()
    Select
	Case $style_counter == 0
	    Style1()
	Case $style_counter == 1
	    Style2()
	Case $style_counter == 2
	    Style3()
	    $style_counter = -1
    EndSelect
    $style_counter = $style_counter + 1
EndFunc

;; Shout, then steal mana.  Replenish stam and health.
Func ShoutManaSuck()
    DoStyle()
    PsychicShout()
    Sleep(1000)
    DoStyle()
    NeedsOfOne()
    Sleep(1200)
    SurpassLimits()
    Sleep(1000)
    Heal()
    Sleep(1800)
EndFunc

;; Shout, the replenish stam and health.
Func ShoutLimitHeal()
    DoStyle()
    PsychicShout()
    Sleep(2500)
    SurpassLimits()
    Sleep(500)
    Heal()
    Sleep(1800)
EndFunc

Func InitWorld()
    ;; Wait for any startup window switching and such to get done
    ;; before we start twiddling
    Sleep(3000)
    ;; We want window relative coordinates for pixel grabs.
    AutoItSetOption("PixelCoordMode", 0)
    ;; We want minimal delay between multiple keystrokes in a send.
    AutoItSetOption("SendKeyDelay", 1)
EndFunc

;;;
;; Hereafter a simple functions that do send the appropriate keystroke
;; and associated pause.  Edit here if your keybindings are different.

Func ConSpiBuff()
     WinSend("sb-macro", "", "0")
     BuffSleep()
EndFunc

Func IntBuff()
     WinSend("sb-macro", "", "9")
     BuffSleep()
EndFunc

Func BuffSleep()
    Sleep(4200)
EndFunc

Func SurpassLimits()
     WinSend("sb-macro", "", "l")
     Sleep(2000)
EndFunc

Func Heal()
     WinSend("sb-macro", "", "h")
     Sleep(3000)
EndFunc

Func Stance()
    WinSend("sb-macro", "", "o")
    Sleep(6200)
EndFunc

Func NeedsOfOne()
     WinSend("sb-macro", "", "m")
     Sleep(5000)
EndFunc

Func PsychicShout()
     WinSend("sb-macro", "", "\")
     Sleep(3500)
EndFunc

Func Style1()
     WinSend("sb-macro", "", "1")
     Sleep(1200)
EndFunc

Func Style2()
     WinSend("sb-macro", "", "2")
     Sleep(1200)
EndFunc

Func Style3()
     WinSend("sb-macro", "", "3")
     Sleep(1200)
EndFunc

;; EOF


