Advertisement
Guest User

Food.vb

a guest
Aug 14th, 2018
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.05 KB | None | 0 0
  1. Module Food
  2.     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)
  3.  
  4.     Private Function checkFood() As Integer
  5.         Dim _myBytes(3) As Byte
  6.         ReadProcessMemory(_targetProcessHandle, addr_ArrowID, _myBytes, 4, vbNull)
  7.         Dim foundID = BitConverter.ToInt32(_myBytes, 0).ToString
  8.         Return CInt(foundID)
  9.     End Function
  10.  
  11.     Public Sub eatfood(posX, posY)
  12.         If getEatFood = True And checkFood() > 0 Then
  13.             If getBusy = False Then
  14.                 getBusy = True
  15.                 AppActivate(_targetProcess.Id)
  16.                 Cursor.Position() = New Point(posX, posY)
  17.                 System.Threading.Thread.Sleep(100)
  18.                 mouse_event(&H8, 0, 0, 0, 0)
  19.                 System.Threading.Thread.Sleep(100)
  20.                 mouse_event(&H10, 0, 0, 0, 0)
  21.                 System.Threading.Thread.Sleep(100)
  22.                 getBusy = False
  23.             End If
  24.         End If
  25.     End Sub
  26. End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement