[AutoIt] Melee macro

08/14/2009 12:11 Penakle#1
New melee macro which allows you to chose offense or defense. Borrowed some code (a lot of code) from Ices

Code:
#cs------------------------------------------------------
Simple melee AutoIt script by TeabagGus
Script requires two people with running the same script
There is a 5 second delay for the macro to start
Wand is slot 8
Heal Self is slot 1
Rest is slot 5
Weapon is slot 0
Shield is slot 9 if using a 1h and shield if not leave blank
#ce-------------------------------------------------------

Dim $a, $c, $d, $e, $f, $g, $h, $z, $x
Global $Paused

HotKeySet("`", "TogglePause")
HotKeySet("{ESC}", "Close")

$g = InputBox( "Question", "How many swings?", "20" )
$h = InputBox( "Question", "How long to parry? [milliseconds]" , "30000" )
$f = InputBox( "Question", "Offense or Defense first?", "Offense" )
$c = InputBox( "Question", "How Long to Rest? [milliseconds]", "180000" )
MsgBox( 0, "Alert", "Click OK then Alt + Tab into Darkfall to start the script." )

WinWaitActive ("Darkfall Online")
Sleep (1000)

While 1
    CombatMode()
    If $f = "Offense" Then
        Offense()
        Defense()
    Else
        Defense()
        Offense()
    EndIf
    CombatMode()
    Rest()
WEnd

Func Offense()
    Sleep (1000)
    $o = 0
    While $o <= $g
        Sleep (1000)
        MouseClick ("left")
        Sleep (1000)
        $o = $o + 1
    WEnd
    Sleep (1000)
EndFunc

Func Defense()
    Sleep (1000)
    Send ("{V Down}")
    Sleep ( $h )
    Send ("{V Up}")
    Sleep (1000)
EndFunc

Func Rest()
    Send ("5")
    Sleep (1000)
    MouseClick ("left")
    Sleep ( $c )
    Send ("W")
    Sleep (1000)
EndFunc

Func CombatMode()
    Sleep (1000)
    Send ("R")
    Sleep (1000)
EndFunc

Func TogglePause( )
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func EquipWeapon()
    Sleep (1000)
    Send ( $x ) ; Weapon
    Sleep (1000)
    Send ( $z ) ; Shield
    Sleep (1000)
EndFunc

Func Close()
    Exit
EndFunc
01/13/2011 15:55 jorge014#2
;
01/13/2011 15:55 jorge014#3
;j
01/13/2011 15:55 jorge014#4
//
01/13/2011 15:55 jorge014#5
////
01/13/2011 15:56 jorge014#6
/////
01/13/2011 15:56 jorge014#7
m
01/13/2011 15:56 jorge014#8
m,lnm
01/13/2011 15:57 jorge014#9
kkkkkkkkkkk
01/13/2011 15:58 jorge014#10
kkkkkkkkkkkkkkk
01/13/2011 15:58 jorge014#11
kik
01/13/2011 15:59 jorge014#12
kgk
01/13/2011 15:59 jorge014#13
Thread
01/13/2011 15:59 jorge014#14
kkkkk
01/13/2011 16:00 jorge014#15
...........