Code:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=.\Icons\Tools.ico
#AutoIt3Wrapper_outfile=.\DFGather.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Comment=Basic Gathering Macro
#AutoIt3Wrapper_Res_Description=Basic Gathering Macro
#AutoIt3Wrapper_Res_Fileversion=1.0.2.17
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#AutoIt3Wrapper_Res_LegalCopyright=© 2009
#AutoIt3Wrapper_Res_Language=1033
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
If Not FileExists(@ScriptDir&"\_Macros.ini") Then
IniWrite(@ScriptDir&"\_Macros.ini", "gather", "loops", "20")
IniWrite(@ScriptDir&"\_Macros.ini", "gather", "rest", "60000")
IniWrite(@ScriptDir&"\_Macros.ini", "gather", "random_start", "1000")
IniWrite(@ScriptDir&"\_Macros.ini", "gather", "random_end", "3000")
IniWrite(@ScriptDir&"\_Macros.ini", "gather", "rest_skill_toolbar_number", "1")
IniWrite(@ScriptDir&"\_Macros.ini", "gather", "hotkey_to_end_script", "2")
Sleep(500)
EndIf
; ========================== Variables set as per YOUR GUI setup ===============================
Global $RestSkill = IniRead(@ScriptDir&"\_Macros.ini", "gather", "rest_skill_toolbar_number", "1")
Global $MiningLoop = IniRead(@ScriptDir&"\_Macros.ini", "gather", "loops", "20")
Global $SleepRegen = IniRead(@ScriptDir&"\_Macros.ini", "gather", "rest", "60000")
Global $HotKey = IniRead(@ScriptDir&"\_Macros.ini", "gather", "hotkey_to_end_script", "2")
Global $random_start = IniRead(@ScriptDir&"\_Macros.ini", "gather", "random_start", "1000")
Global $random_end = IniRead(@ScriptDir&"\_Macros.ini", "gather", "random_end", "3000")
Global $Equipt_Unequipt_Animation = 3000 ; how long it takes for the equipt/unequipt animation to finish
Global $Standup_Animation = 3000 ; how long it takes for the stand up animation to finish
; ========================== Variables set as per YOUR GUI setup ===============================
HotKeySet($HotKey, "_Exit")
Sleep(2000)
; Start of the Macro
; Assumes you are standing, with gather tool in hand, facing the resource, ready to start gathering.
If WinActive("Darkfall Online") Then
; do nothing
Else
WinActivate("Darkfall Online")
MouseClick("RIGHT") ; this assumes the mouse is over top the Darkfall Window
Sleep(1000)
EndIf
While 1
_Gather_Resource()
_Rest()
_StandUp()
_Equipt_Unequipt_Tool()
_Look_Down_45_Degrees()
Sleep(1000)
WEnd
Func _StandUp()
Send("{SPACE}")
Sleep($Standup_Animation)
EndFunc
Func _Equipt_Unequipt_Tool()
Send("r") ; put away axe
Sleep($Equipt_Unequipt_Animation) ; wait for animation to finish
EndFunc
Func _Rest()
_Equipt_Unequipt_Tool()
Send($RestSkill) ; prep the rest command
Sleep(1000) ; wait
MouseClick("LEFT") ; use rest skill
Sleep($SleepRegen)
EndFunc
Func _Gather_Resource()
For $i = 1 To $MiningLoop
$num = Random($random_start, $random_end)
MouseClick("LEFT")
Sleep(10000 + $num)
Next
EndFunc
Func _Look_Down_45_Degrees()
Send ("{DOWN Down}")
Sleep (1500)
Send ("{DOWN Up}")
EndFunc
Func _Exit()
Exit
EndFunc