Ich bin in Sachen Autoit etwas eingerostet..ok..aber wieso funktioniert das nicht oder komm ich einfach nur nicht drauf ?
Vielleicht habt ihr ne andere Methode das umzusetzten..
der Sinn sollte klar sein; nach den HP/MP bars suchen, ggf. item wechseln und dann nutzen.
nur [c]Send[/c] geht auch nicht
Edit: komm ich so vielleicht weiter oder lauf ich da auch ins leere ?
Vielleicht habt ihr ne andere Methode das umzusetzten..
der Sinn sollte klar sein; nach den HP/MP bars suchen, ggf. item wechseln und dann nutzen.
Code:
#comments-start
Author : Pad
Version : 1.0
Kommentare : HP/MP taker
#comments-end
AutoItSetOption("SendKeyDownDelay", 100)
HotKeySet("{NUMPAD5}", "_an_aus")
HotKeySet("{NUMPAD1}", "_register_bars")
HotKeySet("{NUMPAD2}", "_register_item")
HotKeySet("{NUMPAD9}", "_exit")
Global $an_aus = 0
Global $hp_color = 0x622929
Global $hp_item_color = 0xF7F2A5
Global $mp_color = 0x1C1C44
Global $mp_item_color = 0xD4F9FC
While 1
Sleep(200)
WEnd
Func _an_aus()
If $an_aus = 0 Then
AdlibRegister("_main", 250)
$an_aus = 1
Else
AdlibUnRegister("_main")
$an_aus = 0
EndIf
EndFunc
Func _register_bars()
Global $wdw = WinActive("[CLASS:FDPclass]")
Global $mouse = MouseGetPos()
EndFunc
Func _register_item()
Global $mouse2 = MouseGetPos()
EndFunc
Func _main()
#Region *** check HP_bar ***
PixelSearch($mouse[0]-50, $mouse[1]-50, $mouse[0]+50, $mouse[1]+50, $hp_color)
If @error Then
; check item
PixelSearch($mouse2[0]-50, $mouse2[1]-50, $mouse2[0]+50, $mouse2[1]+50, $hp_item_color)
If @error Then
; change item
ControlSend("DARK SOULS III", "", $wdw, "{DOWN}")
Sleep(500)
; check item
PixelSearch($mouse2[0]-50, $mouse2[1]-50, $mouse2[0]+50, $mouse2[1]+50, $hp_item_color)
If not @error Then
; take potion
ControlSend("DARK SOULS III", "", $wdw, "r")
EndIf
Else
; take potion
ControlSend("DARK SOULS III", "", $wdw, "r")
EndIf
EndIf
#EndRegion *** check HP_bar ***
Sleep(200)
#Region *** check MP_bar ***
PixelSearch($mouse[0]-0, $mouse[1]-0, $mouse[0]+50, $mouse[1]+3, $mp_color)
If @error Then
; check item
PixelSearch($mouse2[0]-50, $mouse2[1]-50, $mouse2[0]+50, $mouse2[1]+50, $mp_item_color)
If @error Then
; change item
ControlSend("DARK SOULS III", "", $wdw, "{DOWN}")
Sleep(500)
; check item
PixelSearch($mouse2[0]-50, $mouse2[1]-50, $mouse2[0]+50, $mouse2[1]+50, $mp_item_color)
If not @error Then
; take potion
ControlSend("DARK SOULS III", "", $wdw, "r")
EndIf
Else
; take potion
ControlSend("DARK SOULS III", "", $wdw, "r")
EndIf
EndIf
#EndRegion *** check MP_bar ***
EndFunc
Func _exit()
Exit
EndFunc
Edit: komm ich so vielleicht weiter oder lauf ich da auch ins leere ?