• Log in or sign up for an account here: https://www.sythe.org/login

[Release: Function] IsFight

Joined
Jan 22, 2007
Sythe Gold
0
Messages
289
Location
Finland
Code:
Public Function IsFight()
Dim x As Long, y As Long, test As Long, WndRECT As RECT
GetWindowRect SelWnd, WndRECT
test = GetDC(SelWnd)
For y = 70 To 163
  For x = 220 To 329
   If GetPixel(test, x, y) = 65280 Then
     IsFight = True
     Exit Function
    End If
  Next x
Next y
IsFight = False
End Function

Example Uses:
Code:
Sub AutoMine ()
Do Until Running = 0
If IsFight = True Then
RunAway (North)
Else
MineRocks
End If
Wait 1000, 400
Loop
End Sub
Code:
Sub AutoFight ()
Do Until Running = 0
If IsFight = 0 Then AttackEnemy
Wait 100,50
If CheckHP < WhenEat.Text Then EatFood (Food.text)
Wait 500,100
Loop
End Sub
Please give credits for me if you use this. :)
 
Good job mate, thank you. I'm sure someone will find this useful. =)
 
duelarena.gg
Back
Top