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


