Okay i just spent some time trying to help you out with this, and finnaly got it working quite nicely actually, hope it will do the same for you. Who knows, maybe i'll use this in future bots :)Quote:
Hi and thanks, it still does not work very well so I am trying different things. I also found this func from an old thread:
but I am not exactly sure how it should be called in the fighting function...Code:func canUseCombo($skill, $target) if not isDllStruct($target) then $target = getAgentByID($target) if not isDllStruct($skill) then $skill = getSkillById($skill) switch dllStructGetData($skill, "comboReq") case 1 return dllStructGetData($target, "laststrike") = 3 case 2 return dllStructGetData($target, "laststrike") = 1 case 4 return dllStructGetData($target, "laststrike") = 2 endSwitch return true endFunc
Code:
Func Killsin()
Local $timerskills
Local $timergetagentexist
Local $ldistance
Local $JSHITS = 0
Local $FFHITS = 0
Local $DBHITS = 0
Local $JS = 1
Local $FF = 2
Local $DB = 3
While getnumberoffoesinrangeofagent(-2, 1250) > 0
If GetIsDead(-2) Then ExitLoop
If Not GetTarget(-1) Then
$timergetagentexist = TimerInit()
Do
TargetNearestEnemy()
Sleep(getping() + 250)
Until GetAgentExists(-1) Or TimerDiff($timergetagentexist) > 4000
EndIf
If CheckEnchantments() Then
ControlSend(getwindowhandle(), "", "", "{space}") ;Moving to enemie
Sleep(getping() + 200)
$JSHITS = 0
$FFHITS = 1
$DBHITS = 1
Do
If $JSHITS = 0 Then
If getenergy(-2) >= 5 Then
If IsRecharged($JS) Then
$timerskills = TimerInit()
useskill($JS, -1)
Do
Sleep(getping() + 200)
Until Not IsRecharged($JS) Or getisdead(-1) Or getisdead(-2) Or Not GetAgentExists(-1) Or TimerDiff($timerskills) > 2500
If getisbleeding(-1) Then
$JSHITS += 1
$FFHITS = 0
EndIf
EndIf
ElseIf getenergy(-2) < 5 Then
Do
Sleep(getping())
Until getenergy(-2) >= 5 Or getisdead(-1) Or getisdead(-2) Or Not GetAgentExists(-1)
If $JSHITS = 0 Then
$timerskills = TimerInit()
useskill($JS, -1)
Do
Sleep(getping() + 200)
Until Not IsRecharged($JS) Or getisdead(-1) Or getisdead(-2) Or Not GetAgentExists(-1) Or TimerDiff($timerskills) > 2500
If getisbleeding(-1) Then
$JSHITS += 1
$FFHITS = 0
EndIf
EndIf
EndIf
EndIf
If $FFHITS = 0 Then
If getenergy(-2) >= 5 Then
If IsRecharged($FF) Then
$timerskills = TimerInit()
useskill($FF, -1)
Do
Sleep(getping() + 200)
Until Not IsRecharged($FF) Or getisdead(-1) Or getisdead(-2) Or Not GetAgentExists(-1) Or TimerDiff($timerskills) > 2500
$FFHITS += 1
$DBHITS = 0
EndIf
ElseIf getenergy(-2) < 5 Then
Do
Sleep(getping() + 100)
Until getenergy(-2) >= 5 Or getisdead(-1) Or getisdead(-2) Or Not GetAgentExists(-1)
If $FFHITS = 0 Then
$timerskills = TimerInit()
useskill($FF, -1)
Do
Sleep(getping() + 200)
Until Not IsRecharged($FF) Or getisdead(-1) Or getisdead(-2) Or Not GetAgentExists(-1) Or TimerDiff($timerskills) > 2500
$FFHITS += 1
$DBHITS = 0
EndIf
EndIf
EndIf
If $DBHITS = 0 Then
If getenergy(-2) >= 5 Then
If IsRecharged($DB) Then
$timerskills = TimerInit()
useskill($DB, -1)
Do
Sleep(getping() + 200)
Until Not IsRecharged($DB) Or getisdead(-1) Or getisdead(-2) Or Not GetAgentExists(-1) Or TimerDiff($timerskills) > 2500
$DBHITS += 1
$JSHITS = 0
EndIf
ElseIf getenergy(-2) < 5 Then
Do
Sleep(getping() + 100)
Until getenergy(-2) >= 5 Or getisdead(-1) Or getisdead(-2) Or Not GetAgentExists(-1)
If $DBHITS = 0 Then
$timerskills = TimerInit()
useskill($DB, -1)
Do
Sleep(getping() + 200)
Until Not IsRecharged($DB) Or getisdead(-1) Or getisdead(-2) Or Not GetAgentExists(-1) Or TimerDiff($timerskills) > 2500
$DBHITS += 1
$JSHITS = 0
EndIf
EndIf
EndIf
Until GetIsDead(-1) Or getisdead(-2) Or Not GetAgentExists(-1)
EndIf
WEnd
Return False
EndFunc ;==>Killsin