Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Module Food
- Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer)
- Private Function checkFood() As Integer
- Dim _myBytes(3) As Byte
- ReadProcessMemory(_targetProcessHandle, addr_ArrowID, _myBytes, 4, vbNull)
- Dim foundID = BitConverter.ToInt32(_myBytes, 0).ToString
- Return CInt(foundID)
- End Function
- Public Sub eatfood(posX, posY)
- If getEatFood = True And checkFood() > 0 Then
- If getBusy = False Then
- getBusy = True
- AppActivate(_targetProcess.Id)
- Cursor.Position() = New Point(posX, posY)
- System.Threading.Thread.Sleep(100)
- mouse_event(&H8, 0, 0, 0, 0)
- System.Threading.Thread.Sleep(100)
- mouse_event(&H10, 0, 0, 0, 0)
- System.Threading.Thread.Sleep(100)
- getBusy = False
- End If
- End If
- End Sub
- End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement