This script will dive underwater to loose health and train your Rigor skill.
Please make sure that you are in the water.
Uses Autoit (Google)
CODE
;require admin for vista
#RequireAdmin
;set options
Opt("SendKeyDelay", 100)
Opt("MouseClickDelay", 100)
Opt("MouseClickDownDelay", 100)
;init
Global $curwindow
Global $rcoords
;intro
MsgBox(64, RandomStr(), "This tool will dive under water to loose health and train your rigor skill.")
;ask for settings
$wintitle = InputBox(RandomStr(), "Window settings? This value can normally be left at the default value.", "[TITLE:Darkfall Online; CLASS:SFMainWindow]")
If not WinExists($wintitle) Then
MsgBox(64, RandomStr(), "The window could not be found. Please start DF first.")
Exit
EndIf
$rest = InputBox(RandomStr(), "Howmany seconds do you wish to wait when above water to rest to full health? This value will be randomized by a bit, so make sure to leave a safe value rather then a minimum one.", 260)
If $rest == "" Then
MsgBox(64, RandomStr(), "You entered invalid values. Application will now exit.")
Exit
EndIf
$fdive_time = InputBox(RandomStr(), "Howlong do you want to dive and loose health to train your rigor (in seconds)? This value will be randomized by a bit, so please don't enter a maximum value but a safe one.", 60)
;confirm
$confirm = MsgBox(65, RandomStr(), "Please continue when you are in the water. You can exit the application by right clicking the tray icon or clicking cancel now.")
If $confirm == 2 Then
Exit
EndIf
;activate window (if you're in windowed mode, you can alt tab out again, semi-background mode will be enabled (see stealth functions))
WinActivate($wintitle)
WinWaitActive($wintitle)
Sleep(1000)
;loop
While 1
$dive_time = Random($fdive_time - ($fdive_time / 50), $fdive_time + ($fdive_time / 50), 1) * 1000
$divetimer = TimerInit()
Do
$divehold = Random(900, 1100, 1)
StealthActivate()
Send("{c down}")
Sleep($divehold)
Send("{c up}")
StealthRestore()
Sleep($divehold)
Until TimerDiff($divetimer) > $dive_time
Sleep(Random($rest - ($rest / 50), $rest + ($rest / 50), 1) * 1000)
WEnd
;functions
Func StealthActivate()
If WinActive($wintitle) Then
$curwindow = ""
Else
BlockInput(1)
$rcoords = MouseGetPos()
$curwindow = WinGetTitle("[active]")
WinActivate($wintitle)
WinWaitActive($wintitle)
EndIf
$details = WinGetPos($wintitle)
MouseMove($details[0] + ($details[2] / 2), $details[1] + ($details[3] / 2), 0);this is done to support multiple monitors
EndFunc;==>StealthActivate
Func StealthRestore()
If $curwindow <Then>StealthRestore
Func RandomStr($length = 0)
If $length == 0 Then
$length = Random(2, 8, 1)
EndIf
$seed = ""
Do
If Random() <0> $length)
Return $seed
EndFunc;==>RandomStr