Page 1 of 3 123 LastLast
Results 1 to 15 of 34
  1. #1
    franklin01's Avatar
    Join Date
    May 2013
    Gender
    male
    Posts
    27
    Reputation
    10
    Thanks
    198

    Arrow [Release][Alpha] PokeMMO bot

    Regarding this message: https://www.mpgh.net/forum/247-other-...ml#post8833984
    Since PokeMMO multibot is no longer supported I will try to provide another one.

    First release still in work but can be used: The UglyBot !

    Features:
    *walk around in square/line
    *fight pokemons
    *can switch to train another one
    *can use another attack

    Bugs:
    *it will not decline or accept other players invitations, make sure you are set to automatically decline things
    *I don't know how it reacts to evolve and new moves learning as it didn't happen to me yet but will figure something when time comes

    How to use:
    Set game to 1024x768 !
    At first start it will generate a setting.ini file with setings, read and edit it.
    Find a grassy area and start the thing.

    Note: It is a very early thing that work but can and probably will be improved. Tested on win xp x64 and win 7 x86.
    I don't know what was in the PokeMMO Multibot so request features here and I will try to make it happen.
    If you want to support you can throw a penny here.
    LTC: LfHAabU9Lqzn6sgdYcfoLZFoZjf36PW3rf
    NMC: N7P667yC5aMTUFb4h7S1UVbMzvvmfZsXjw

    Virus scan:
    uglybot-bin.zip MD5:bd689623ac3159ff2eeba432abc7c9b2 - VirSCAN.org 8% Scanner(s) (3/37) found malware!
    https://www.virustotal.com/fr/file/9...is/1386458012/
    Attachment:
    *uglybot-bin_mpgh.net.zip includes everything
    *pp.png and pp2.png are for people that want to build from source. If done so you will need dlls for imagesearch that can be found on google.

    Source (autoit):
    Code:
    ; note: can be improved, if so please share with the comunity
    ; If you want to support you can throw a penny here.
    ; LTC: LfHAabU9Lqzn6sgdYcfoLZFoZjf36PW3rf
    ; NMC: N7P667yC5aMTUFb4h7S1UVbMzvvmfZsXjw
    
    
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Misc.au3>
    #Include <Array.au3>
    #Include <File.au3>
    #include <GDIPlus.au3>
    #include <ScreenCapture.au3>
    #include <WinAPI.au3>
    #include <ScrollBarConstants.au3>
    #include <WindowsConstants.au3>
    #Include <GuiComboBox.au3>
    #Include <GuiListBox.au3>
    #include <GuiButton.au3>
    #include <EditConstants.au3>
    #include <ButtonConstants.au3>
    #include <Math.au3>
    #include <GuiListBox.au3>
    
    
    Opt("WinTitleMatchMode", 1)
    Opt("PixelCoordMode", 2)
    Opt("MouseCoordMode", 2)
    
    If Not FileExists("config.ini") Then
    IniWrite("config.ini", "setting", "log", "0")
    IniWrite("config.ini", "setting", "user", '"user"')
    IniWrite("config.ini", "setting", "pass", '"pass"')
    IniWrite("config.ini", "setting", "debug", "0")
    IniWrite("config.ini", "setting", "train", "0")
    IniWrite("config.ini", "setting", "square", "1")
    IniWrite("config.ini", "setting", "walktime", "500")
    IniWrite("config.ini", "setting", "abutton", "z")
    IniWrite("config.ini", "setting", "bbutton", "x")
    IniWrite("config.ini", "setting", "How to use:", "")
    IniWrite("config.ini", "setting", "log = 1 enable autologin, if used make sure you have set your ids", "")
    IniWrite("config.ini", "setting", 'user and pass must be in "quotation mark" in order to be used.', "")
    IniWrite("config.ini", "setting", "debug enable logging so you can see where it get stuck if it does.", "")
    IniWrite("config.ini", "setting", "train = 1 enable pokemon switching, used to train a low level by fighting with the second pokemon.", "")
    IniWrite("config.ini", "setting", "square = 1 enable walking in square, if set to 0 then walk on a straight line up/down, if set to 2 left/right", "")
    IniWrite("config.ini", "setting", "walktime = time in ms that you walk (in each direction) recomended 500 for small squares/lines or 1000 for longer trip", "")
    IniWrite("config.ini", "setting", 'abutton = key set to A, must be in "quotation mark"', "")
    IniWrite("config.ini", "setting", 'bbutton = key set to B, must be in "quotation mark"', "")
    EndIf
    
    Dim $abutton = IniRead("config.ini", "setting", "abutton", "z")
    Dim $bbutton = IniRead("config.ini", "setting", "bbutton", "x")
    Dim $square = IniRead("config.ini", "setting", "square", "1")
    Dim $walktime = IniRead("config.ini", "setting", "walktime", "500")
    Dim $job
    Dim $Label1
    Dim $Label2
    Dim $Label3
    Dim $Label4
    Dim $Label5
    Dim $info1
    Dim $info2
    Dim $info3
    Dim $info4 = "Press [Pause] to pause / F11 to resume / F12 to quit"
    Dim $info5 = "Debug enabled"
    Dim $image
    Dim $image2
    Dim $pos
    Dim $walk = 0
    Dim $log = IniRead("config.ini", "setting", "log", "0")
    Dim $dll = DllOpen("user32.dll")
    Global $x, $y, $image
    Dim $user = IniRead("config.ini", "setting", "user", "")
    Dim $pass = IniRead("config.ini", "setting", "pass", "")
    Dim $debug = IniRead("config.ini", "setting", "debug", "0")
    Dim $change = 0
    Dim $train = IniRead("config.ini", "setting", "train", "0")
    
    
    $job = start()
    
    HotKeySet("{PAUSE}", "TogglePause")
    
    If $debug = 1 Then
    	GUICreate("uglybot", 225, 300, 20, 0, BitOr($WS_BORDER, $WS_POPUP), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
    	$Label5 = GUICtrlCreateList("debug menu", 0, 96, 225, 200, BitOr($WS_BORDER, $WS_VSCROLL))
    
    	GUICtrlSetLimit(-1, 200)
    Else
    	GUICreate("uglybot", 225, 100, 20, 0, BitOr($WS_BORDER, $WS_POPUP), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
    EndIf
    
    $Label1 = GUICtrlCreateLabel("Label1", 0, 0, 225, 25)
    $Label2 = GUICtrlCreateLabel("Label2", 0, 24, 225, 25)
    $Label3 = GUICtrlCreateLabel("Label3", 0, 48, 225, 25)
    $Label4 = GUICtrlCreateLabel("Label3", 0, 72, 225, 25)
    
    GUISetState()
    
     While 1
    	Sleep(100)
    	If _IsPressed("7B", $dll) Then
    		Exit
    	EndIf
    	GUICtrlSetData($Label1, $info1)
    	GUICtrlSetData($Label2, $info2)
    	GUICtrlSetData($label3, $info3)
    	GUICtrlSetData($label4, $info4)
    	If $debug = 1 Then
    		$info5 = "Processing..."
    		_GUICtrlListBox_BeginUpdate($label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($label5, $iIndex)
    	EndIf
    
    	Switch $job
    		Case 1
    			$job = start()
    		Case 2
    			$job = state()
    		Case 3
    			$job = fight()
    		Case 4
    			$job = walk()
    		Case 5
    			$job = login()
       EndSwitch
    WEnd
    
    Func fight()
    		If $debug = 1 Then
    		$info5 = "In fight"
    		_GUICtrlListBox_BeginUpdate($label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($label5, $iIndex)
    	EndIf
    	$image = PixelSearch( 110, 395, 540, 540, 0xCFA806, 5)
    	If IsArray($image) Then
    		Sleep(50)
    		Send($bbutton)
    			If $debug = 1 Then
    		$info5 = "In attack"
    		_GUICtrlListBox_BeginUpdate($label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($label5, $iIndex)
    	EndIf
    		If $train = 1 And $change = 0 Then
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{DOWN}")
    			Sleep(50)
    			Send("{DOWN}")
    			Sleep(50)
    			Send($abutton)
    			Sleep(50)
    			Send("{RIGHT}")
    			Sleep(50)
    			Send($abutton)
    			Sleep(500)
    			$change = 1
    		Else
    			$info3 = "Attacking."
    			GUICtrlSetData($label3, $info3)
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{UP}")
    			Sleep(50)
    			Send("{UP}")
    			Sleep(50)
    			Send($abutton)
    			Sleep(50)
    			$i = 0
    			While $i < 3
    				If $debug = 1 Then
    					$info5 = "in pp check"
    					_GUICtrlListBox_BeginUpdate($label5)
    					_GUICtrlListBox_InsertString($Label5, $info5)
    					_GUICtrlListBox_EndUpdate($Label5)
    					$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    					$iIndex = $iIndex + 1
    					_GUICtrlListBox_SetCurSel($label5, $iIndex)
    				EndIf
    				$info3 = "Got PP?"
    				GUICtrlSetData($label3, $info3)
    				Sleep(500)
    				$i = $i + 1
    				$image2 = _ImageSearchArea('pp2.png', 1, 100, 300, 520, 570, $x, $y, 80)
    				$image = _ImageSearchArea('pp.png', 1, 110, 400, 320, 470, $x, $y, 50)
    				If $image = 1 Or $image2 = 1 Then
    					$info3 = "Warning no PP"
    					GUICtrlSetData($label3, $info3)
    					Send("{LEFT}")
    					Sleep(50)
    					Send("{UP}")
    					Sleep(50)
    					Send("{RIGHT}")
    					Sleep(50)
    					Send($abutton)
    					Sleep(50)
    					Return 1
    				EndIf
    			WEnd
    			If $debug = 1 Then
    			$info5 = "pp checked and ok"
    			_GUICtrlListBox_BeginUpdate($label5)
    			_GUICtrlListBox_InsertString($Label5, $info5)
    			_GUICtrlListBox_EndUpdate($Label5)
    			$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    			$iIndex = $iIndex + 1
    			_GUICtrlListBox_SetCurSel($label5, $iIndex)
    			EndIf
    			$info3 = "Still some PP..."
    			GUICtrlSetData($label3, $info3)
    			$i = 0
    			Send($abutton)
    			Sleep(50)
    		EndIf
    		Return 1
    	EndIf
    	$image = PixelSearch( 875, 515, 895, 535, 0xFFFFFF, 5)
    	If IsArray($image) Then
    			If $debug = 1 Then
    		$info5 = "input required"
    		_GUICtrlListBox_BeginUpdate($label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($label5, $iIndex)
    	EndIf
    		$info3 = "Input needed."
    		GUICtrlSetData($label3, $info3)
    		Sleep(50)
    		Send($bbutton)
    		Sleep(50)
    		Return 1
    	EndIf
    		If $debug = 1 Then
    		$info5 = "right stick fight check"
    		_GUICtrlListBox_BeginUpdate($label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($label5, $iIndex)
    	EndIf
    	Sleep(50)
    	Send("{RIGHT}")
    	Return 1
    EndFunc
    
    
    Func walk()
    	$change = 0
    	If $debug = 1 Then
    		$info5 = "in walk"
    		_GUICtrlListBox_BeginUpdate($label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($label5, $iIndex)
    	EndIf
    	If $square = 1 Then
    		If $walk < 1 Then
    				If $debug = 1 Then
    				$info5 = "walking down"
    				_GUICtrlListBox_BeginUpdate($label5)
    				_GUICtrlListBox_InsertString($Label5, $info5)
    				_GUICtrlListBox_EndUpdate($Label5)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($label5, $iIndex)
    			EndIf
    			$info3 = "Walking down."
    			GUICtrlSetData($label3, $info3)
    			Send("{DOWN down}")
    			Sleep(Random($walktime, $walktime + 100, 1))
    			Send("{DOWN up}")
    			$walk = 1
    			Sleep(50)
    			Return 1
    		EndIf
    
    		If $walk < 2 Then
    				If $debug = 1 Then
    				$info5 = "walking left"
    				_GUICtrlListBox_BeginUpdate($label5)
    				_GUICtrlListBox_InsertString($Label5, $info5)
    				_GUICtrlListBox_EndUpdate($Label5)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($label5, $iIndex)
    			EndIf
    			$info3 = "Walking left."
    			GUICtrlSetData($label3, $info3)
    			Send("{LEFT down}")
    			Sleep(Random($walktime, $walktime + 100, 1))
    			Send("{LEFT up}")
    			$walk = 2
    			Sleep(50)
    			Return 1
    		EndIf
    
    		If $walk < 3 Then
    				If $debug = 1 Then
    				$info5 = "walking up"
    				_GUICtrlListBox_BeginUpdate($label5)
    				_GUICtrlListBox_InsertString($Label5, $info5)
    				_GUICtrlListBox_EndUpdate($Label5)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($label5, $iIndex)
    			EndIf
    			$info3 = "Walking up."
    			GUICtrlSetData($label3, $info3)
    			Send("{UP down}")
    			Sleep(Random($walktime, $walktime + 100, 1))
    			Send("{UP up}")
    			$walk = 3
    			Sleep(50)
    			Return 1
    		EndIf
    
    		If $walk < 4 Then
    				If $debug = 1 Then
    				$info5 = "walking right"
    				_GUICtrlListBox_BeginUpdate($label5)
    				_GUICtrlListBox_InsertString($Label5, $info5)
    				_GUICtrlListBox_EndUpdate($Label5)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($label5, $iIndex)
    			EndIf
    			$info3 = "Walking right."
    			GUICtrlSetData($label3, $info3)
    			Send("{RIGHT down}")
    			Sleep(Random($walktime, $walktime + 100, 1))
    			Send("{RIGHT up}")
    			$walk = 0
    			Sleep(50)
    			Return 1
    		EndIf
    	EndIf
    
    	If $square = 0 Then
    		If $walk < 1 Then
    			If $debug = 1 Then
    				$info5 = "walking down"
    				_GUICtrlListBox_BeginUpdate($label5)
    				_GUICtrlListBox_InsertString($Label5, $info5)
    				_GUICtrlListBox_EndUpdate($Label5)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($label5, $iIndex)
    			EndIf
    			$info3 = "Walking down."
    			GUICtrlSetData($label3, $info3)
    			Send("{DOWN down}")
    			Sleep(Random($walktime, $walktime + 100, 1))
    			Send("{DOWN up}")
    			$walk = 1
    			Sleep(50)
    			Return 1
    		EndIf
    
    		If $walk < 2 Then
    			If $debug = 1 Then
    				$info5 = "walking up"
    				_GUICtrlListBox_BeginUpdate($label5)
    				_GUICtrlListBox_InsertString($Label5, $info5)
    				_GUICtrlListBox_EndUpdate($Label5)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($label5, $iIndex)
    			EndIf
    			$info3 = "Walking up."
    			GUICtrlSetData($label3, $info3)
    			Send("{UP down}")
    			Sleep(Random($walktime, $walktime + 100, 1))
    			Send("{UP up}")
    			$walk = 0
    			Sleep(50)
    			Return 1
    		EndIf
    	EndIf
    	If $square = 2 Then
    		If $walk < 1 Then
    			If $debug = 1 Then
    				$info5 = "walking left"
    				_GUICtrlListBox_BeginUpdate($label5)
    				_GUICtrlListBox_InsertString($Label5, $info5)
    				_GUICtrlListBox_EndUpdate($Label5)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($label5, $iIndex)
    			EndIf
    			$info3 = "Walking left."
    			GUICtrlSetData($label3, $info3)
    			Send("{LEFT down}")
    			Sleep(Random($walktime, $walktime + 100, 1))
    			Send("{LEFT up}")
    			$walk = 1
    			Sleep(50)
    			Return 1
    		EndIf
    
    		If $walk < 2 Then
    			If $debug = 1 Then
    				$info5 = "walking right"
    				_GUICtrlListBox_BeginUpdate($label5)
    				_GUICtrlListBox_InsertString($Label5, $info5)
    				_GUICtrlListBox_EndUpdate($Label5)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($label5, $iIndex)
    			EndIf
    			$info3 = "Walking right."
    			GUICtrlSetData($label3, $info3)
    			Send("{RIGHT down}")
    			Sleep(Random($walktime, $walktime + 100, 1))
    			Send("{RIGHT up}")
    			$walk = 0
    			Sleep(50)
    			Return 1
    		EndIf
    	EndIf
    Return 1
    EndFunc
    
    Func login();return 3 -OK
    		If $debug = 1 Then
    		$info5 = "in login"
    		_GUICtrlListBox_BeginUpdate($label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($label5, $iIndex)
    	EndIf
    	  If $log = 1 Then
    		  	If $debug = 1 Then
    		$info5 = "loggin in"
    		_GUICtrlListBox_BeginUpdate($label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($label5, $iIndex)
    	EndIf
    		$info3 = "Loggin in..."
    		GUICtrlSetData($label3, $info3)
    		 Sleep(500)
    		 MouseClick("left", 582, 351, 2, 0);login
    		 Sleep(50)
    		 Send("{BS down}")
    		 Sleep(1700)
    		 Send("{BS up}")
    		 Sleep(50)
    		 Send("{DEL down}")
    		 Sleep(1700)
    		 Send("{DEL up}")
    		 Sleep(50)
    		 Send($user)
    		 Sleep(50)
    		 MouseClick("left", 590, 382, 2, 0);pass
    		 Sleep(50)
    		 Send("{BS down}")
    		 Sleep(1500)
    		 Send("{BS up}")
    		 Sleep(50)
    		 Send("{DEL down}")
    		 Sleep(1500)
    		 Send("{DEL up}")
    		 Sleep(50)
    		 Send($pass)
    		 Sleep(50)
    		 MouseClick("left", 574, 414, 2, 0);pass
    		 Sleep(3000)
    		 MouseClick("left", 598, 288, 2, 0);pass
    		 Sleep(3000)
    		 MouseClick("left", 504, 368, 2, 0);pass
    		 Sleep(3000)
    		$info3 = "Logged in."
    		GUICtrlSetData($label3, $info3)
    		 Return 1;start
    	 Else
    		 	If $debug = 1 Then
    		$info5 = "autolog set to no"
    		_GUICtrlListBox_BeginUpdate($label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($label5, $iIndex)
    	EndIf
    		$info3 = "Autologin not enabled, please login."
    		GUICtrlSetData($label3, $info3)
    		Return 1;start
    	  EndIf
    EndFunc
    
    
    Func state()
    		If $debug = 1 Then
    		$info5 = "in state"
    		_GUICtrlListBox_BeginUpdate($label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($label5, $iIndex)
    	EndIf
    	$image = PixelSearch( 200, 400, 700, 420, 0x1D415D, 3)
    	If IsArray($image) Then
    			If $debug = 1 Then
    		$info5 = "fight found"
    		_GUICtrlListBox_BeginUpdate($label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($label5, $iIndex)
    	EndIf
    		$info2 = "Player is fighting."
    		GUICtrlSetData($label2, $info2)
    		Sleep(50)
    		Return 3
    	EndIf
    	$image = PixelSearch( 500, 85, 520, 95, 0xF3EA6D, 3)
    	If IsArray($image) Then
    			If $debug = 1 Then
    		$info5 = "login found"
    		_GUICtrlListBox_BeginUpdate($label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($label5, $iIndex)
    	EndIf
    		$info2 = "Player is at login."
    		GUICtrlSetData($label2, $info2)
    		Sleep(50)
    		Return 5
    	EndIf
    		If $debug = 1 Then
    		$info5 = "nothing found"
    		_GUICtrlListBox_BeginUpdate($label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($label5, $iIndex)
    	EndIf
    	$info2 = "Player is looking for pokemon."
    	GUICtrlSetData($label2, $info2)
    	Sleep(50)
    	Return 4
    EndFunc
    
    
     Func start()
        If Not WinExists("[CLASS:LWJGL]") Then
    		$info1 = "Window not found, waiting for game."
    		GUICtrlSetData($label1, $info1)
    		Sleep(50)
    		Return 1
    	EndIf
    	WinActivate("[CLASS:LWJGL]")
    	$info1 = "Window found, waiting for game focus."
    	GUICtrlSetData($label1, $info1)
    	Sleep(50)
    	If WinActive("[CLASS:LWJGL]") Then
    		$pos = WinGetPos("[CLASS:LWJGL]")
    		$info1 = "Window found, focus OK."
    		WinMove("[CLASS:LWJGL]", "", $pos[0], $pos[1], 1032, 795)
    		GUICtrlSetData($label1, $info1)
    		Sleep(50)
    		Return 2
    	EndIf
    	Sleep(50)
    	Return 1
    EndFunc
    
    Func _ImageSearchArea($FindImage, $ResultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $Tolerance)
       If $Tolerance > 0 Then $FindImage = "*" & $Tolerance & " " & $FindImage
    
       If  @autoItX64 Then
    	  $Result = DllCall("ImageSearchDLL_x64.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $FindImage)
       Else
    	  $Result = DllCall("ImageSearchDLL.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $FindImage)
       EndIf
    
       If $Result = "0" Then Return 0
    
       $Array = StringSplit($Result[0], "|")
    
       If (UBound($Array) >= 4) Then
    	  $x = Int(Number($Array[2]))
    	  $y = Int(Number($Array[3]))
    
    	  If $ResultPosition = 1 Then
    		 $x = $x + Int(Number($Array[4]) / 2)
    		 $y = $y + Int(Number($Array[5]) / 2)
    	  EndIf
    	  Return 1
       EndIf
    EndFunc
    
    Func TogglePause()
    	While 1
    		$info1 = "PAUSED PRESS F11 TO RESUME / F12 to quit"
    		GUICtrlSetData($label1, $info1)
    		Sleep(100)
    		TrayTip("", "Paused", 500000000)
    		If _IsPressed("7B", $dll) Then
    			Exit
    		EndIf
    		If _IsPressed("7A", $dll) Then
    			Return 1
    		EndIf
    	WEnd
    EndFunc


    (being bad at text formating in someone want to make this post nicer feel free to do so)
    Attached Thumbnails Attached Thumbnails
    pp2.png  

    pp.png  

    <b>Downloadable Files</b> Downloadable Files
    Last edited by franklin01; 12-07-2013 at 04:05 PM.

  2. The Following 119 Users Say Thank You to franklin01 For This Useful Post:

    ALvl4Ninja (07-04-2014),antivrirr (01-12-2015),ArnoVanDijk (10-22-2014),arpakuutio (06-29-2014),atuladaokhach (12-01-2014),azimdaniel00 (11-16-2014),B1GB0SS (11-23-2014),Bacchus11 (10-10-2023),BackFront (09-22-2020),Badis-Dz (10-07-2014),beccarmt (12-07-2015),Berseke23 (09-17-2020),blaka17 (07-29-2014),blanqq (04-29-2019),bo7sen (08-10-2014),BolinhoDeArrozBR (08-31-2016),bossbaby322 (07-03-2019),botas11 (01-17-2014),BubblesPR94 (02-09-2024),C4mtasia (11-29-2014),Celebi (09-06-2014),Cougar57 (03-08-2014),CrazyMoonkey (02-20-2014),cyclonexhazard (08-20-2014),dentheman (07-16-2020),Derth (11-06-2015),desertions (03-23-2014),dr34k (08-23-2018),ElMarto (03-03-2015),fak0ring (09-18-2014),fandub1211 (12-29-2018),Ferny1106xd (01-18-2019),fireflashhh (08-20-2014),Focus16 (05-13-2014),Fonzzy (03-08-2016),harutora9 (02-10-2018),helloitsmeok (04-17-2020),heohanwuoc (09-13-2014),Ibe0ke (08-20-2020),idkkkda (06-29-2020),ImortalHul2 (02-25-2016),itsjusthacks (02-26-2014),JKyleWallace (01-16-2014),jmentor (03-23-2015),junior5639 (09-12-2016),junkess (12-17-2014),junyan996 (01-13-2019),karanjit99 (12-21-2013),Keeilza (09-21-2017),kentashi (08-29-2014),Kinola (05-08-2014),kostasmangos (12-20-2013),LanceStorm (09-25-2018),lionix (09-27-2015),Lolfakeer (06-30-2021),lologramme (01-10-2021),longkubx (02-01-2014),loniwolfi (09-23-2014),LordsPlay (03-30-2016),macksonlim2607 (02-02-2021),manyouaresobad (05-11-2014),mikasonwar (01-01-2015),mouse123500 (09-18-2015),MrSandman22 (06-29-2021),nathan789 (08-20-2018),nemvouusar (01-21-2016),NeoBerserk (09-15-2015),NeverTryM3 (03-08-2019),Nexoloft (01-13-2021),OZOZ212 (04-02-2015),Pikamew1925 (05-29-2014),pokemmotest (09-11-2018),pon5826891 (09-03-2014),portuguesdesumilde (02-25-2024),Puciaty25 (03-06-2014),raydin007 (03-23-2019),rekarion (01-07-2014),riyi (10-08-2014),Ruanf25 (07-03-2014),seanyap882 (08-25-2015),sfvsdfsddfsdf (08-18-2015),Sjuen (01-07-2014),Slowpiri (11-14-2014),Smash3D (01-10-2014),souheiln (05-17-2016),stalk1342 (12-03-2014),superaris0601 (09-04-2015),suzuno (11-10-2020),Telkhor (08-05-2014),theguy619 (08-21-2021),thenate217 (08-14-2014),TheQualityHacker (12-02-2020),thesatic (05-02-2014),thug4bily (03-20-2014),tomike444 (10-19-2014),TommyFerreira34 (06-13-2018),ToonZy44 (03-04-2019),toxicnipples (04-01-2014),Trinityseven1337 (10-08-2017),troliopoe (02-07-2020),twistediniquity (03-19-2014),UltraB (02-03-2019),urmomismine (05-16-2021),vegetto122 (08-23-2015),volzzy (03-11-2014),wafi166 (07-22-2019),wasi0011 (01-09-2015),wezeedz (01-12-2015),White_Alone (09-26-2014),wind321 (06-06-2014),WindSneaker (12-29-2014),wojtech19 (12-02-2021),wwj04698 (12-12-2015),yozhirap (04-20-2019),Yureiko (04-28-2020),zakaria66 (07-11-2019),zeluism011 (06-21-2014),zxcvtyu (03-10-2014),{ } (07-23-2016)

  3. #2
    Bernard's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Location
    Purgatory
    Posts
    26,364
    Reputation
    3488
    Thanks
    3,546
    My Mood
    Lurking
    Looks alright.

    #Approved
    Rep. Power: 126

    Minion: 11/28/12-3/15/14

  4. #3
    franklin01's Avatar
    Join Date
    May 2013
    Gender
    male
    Posts
    27
    Reputation
    10
    Thanks
    198

    Arrow

    Update 1



    Changelog:
    Code:
    *fixed move detection
    *fixed death detection
    *added fishbot
    *added gui configuration
    *added sound alarm for move detection
    *changed hotkeys
    *missing files detection
    *small fixes
    Note:

    Things got updated.
    In order to use FishBot make sure you ticked off "draw weather change" in game option otherwise it wont work at night.
    Make sure you are under a Pokemon Center, strait line up/down.
    Password is now kinda encrypted in setting file.
    If Auto forget move is set to no, a sound alarm will be activated so you can choose the move.
    Hotkeys have been changed to: F7 = pause / F8 = resume / F9 = quit
    If for some reason you have low fps, turn off gui in game (F12).
    You still need to be running using 1024x768 settings but it might work on other settings, not tested yet.
    FishBot was not testes using FireRed only, try or use HeartGold textures.

    Virus scan for uglybot + sourcev0.1.zip:
    https://www.virustotal.com/fr/file/1...is/1386610666/
    uglybot + sourcev0.1.zip MD5:4daee95bc11cd87a1eb7ff2965307d2b - VirSCAN.org 8% Scanner(s) (3/37) found malware!

    As always tested on Win xp x64 / Win 7 x86 / Win 8 x64.

    You can report bug or request features.

    UglyBot v0.1 source:

    Code:
    ; note: can be improved, if so please share with the comunity
    ; If you want to support you can throw a penny here.
    ; LTC: LfHAabU9Lqzn6sgdYcfoLZFoZjf36PW3rf
    ; NMC: N7P667yC5aMTUFb4h7S1UVbMzvvmfZsXjw
    
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Misc.au3>
    #include <Array.au3>
    #include <File.au3>
    #include <GDIPlus.au3>
    #include <ScreenCapture.au3>
    #include <WinAPI.au3>
    #include <ScrollBarConstants.au3>
    #include <WindowsConstants.au3>
    #include <GuiComboBox.au3>
    #include <GuiListBox.au3>
    #include <GuiButton.au3>
    #include <EditConstants.au3>
    #include <ButtonConstants.au3>
    #include <Math.au3>
    #include <GuiListBox.au3>
    
    Opt("WinTitleMatchMode", 1)
    Opt("PixelCoordMode", 2)
    Opt("MouseCoordMode", 2)
    
    If Not FileExists("ImageSearchDLL.dll") Then
    	MsgBox(4096, "ImageSearchDLL.dll not found, some features will not be available.", 10)
    EndIf
    If Not FileExists("ImageSearchDLL_x64.dll") Then
    	MsgBox(4096, "ImageSearchDLL_x64.dll not found, some features will not be available.", 10)
    EndIf
    If Not FileExists("move.png") Then
    	MsgBox(4096, "move.png not found, some features will not be available.", 10)
    EndIf
    If Not FileExists("pp.png") Then
    	MsgBox(4096, "pp.png not found, some features will not be available.", 10)
    EndIf
    If Not FileExists("pp.png") Then
    	MsgBox(4096, "pp2.png not found, some features will not be available.", 10)
    EndIf
    If Not FileExists("move.wav") Then
    	MsgBox(4096, "move.wav not found, some features will not be available.", 10)
    EndIf
    
    If Not FileExists("config.ini") Then
    	MsgBox(4096, "config.ini not found, creating a new one.", 10)
    EndIf
    
    Dim $abutton
    Dim $bbutton
    Dim $square
    Dim $walktime
    Dim $moveforget
    Dim $job
    Dim $Label1
    Dim $Label2
    Dim $Label3
    Dim $Label4
    Dim $read = 0
    Dim $fish
    Dim $hurt = 1
    Dim $canebutton = "{F5}"
    Dim $Label5
    dim $atk
    Dim $count = 0
    Dim $something = 0
    Dim $info1
    Dim $info2
    Dim $info3
    Dim $info4 = "Press [Pause] to pause / F11 to resume / F12 to quit"
    Dim $info5 = "Debug enabled"
    Dim $image
    Dim $image2
    Dim $pos
    Dim $walk = 0
    Dim $log
    Dim $dll = DllOpen("user32.dll")
    Global $x, $y, $image
    Dim $user
    Dim $pass
    Dim $debug
    Dim $change = 0
    Dim $train
    
    $job = setting()
    
    HotKeySet("{F7}", "TogglePause")
    HotKeySet("{F9}", "quit")
    
    If $debug = 1 Then
    	GUICreate("uglybot", 225, 300, 20, 0, BitOR($WS_BORDER, $WS_POPUP), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
    	$Label5 = GUICtrlCreateList("debug menu", 0, 96, 225, 200, BitOR($WS_BORDER, $WS_VSCROLL))
    
    	GUICtrlSetLimit(-1, 200)
    Else
    	GUICreate("uglybot", 225, 100, 20, 0, BitOR($WS_BORDER, $WS_POPUP), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
    EndIf
    
    $Label1 = GUICtrlCreateLabel("Label1", 0, 0, 225, 25)
    $Label2 = GUICtrlCreateLabel("Label2", 0, 24, 225, 25)
    $Label3 = GUICtrlCreateLabel("Label3", 0, 48, 225, 25)
    $Label4 = GUICtrlCreateLabel("Label3", 0, 72, 225, 25)
    
    GUISetState()
    
    While 1
    	Sleep(100)
    	GUICtrlSetData($Label1, $info1)
    	GUICtrlSetData($Label2, $info2)
    	GUICtrlSetData($Label3, $info3)
    	GUICtrlSetData($Label4, $info4)
    	If $debug = 1 Then
    		$info5 = "Processing..."
    		_GUICtrlListBox_BeginUpdate($Label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    	EndIf
    
    	Switch $job
    		Case 1
    			$job = start()
    		Case 2
    			$job = state()
    		Case 3
    			$job = fight()
    		Case 4
    			$job = walk()
    		Case 5
    			$job = login()
    		Case 5
    			$job = setting()
    		Case 6
    			$job = fishbot()
    	EndSwitch
    WEnd
    
    Func fight()
    	If $something = 1 Then
    		$count = $count + 1
    		$something = 0
    	EndIf
    
    	If $debug = 1 Then
    		$info5 = "In fight"
    		_GUICtrlListBox_BeginUpdate($Label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    	EndIf
    	$image = PixelSearch(110, 395, 750, 540, 0x8DC655, 5);greenbar
    	If IsArray($image) Then
    		MouseClick("left", $image[0], $image[1], 1, 0)
    		Sleep(50)
    		Send($bbutton)
    		Sleep(50)
    		Return 1
    	EndIf
    
    	$image = PixelSearch(110, 395, 540, 540, 0xCFA806, 5);orange
    	If IsArray($image) Then
    		Sleep(50)
    		Send($bbutton)
    		If $debug = 1 Then
    			$info5 = "In attack"
    			_GUICtrlListBox_BeginUpdate($Label5)
    			_GUICtrlListBox_InsertString($Label5, $info5)
    			_GUICtrlListBox_EndUpdate($Label5)
    			$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    			$iIndex = $iIndex + 1
    			_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    		EndIf
    		If $train = 1 And $change = 0 Then
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{DOWN}")
    			Sleep(50)
    			Send("{DOWN}")
    			Sleep(50)
    			Send($abutton)
    			Sleep(50)
    			Send("{RIGHT}")
    			Sleep(50)
    			Send($abutton)
    			Sleep(500)
    			$change = 1
    		Else
    			$info3 = "Attacking."
    			GUICtrlSetData($Label3, $info3)
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{UP}")
    			Sleep(50)
    			Send("{UP}")
    			Sleep(50)
    			Send($abutton)
    			Sleep(50)
    			$i = 0
    			$atk = Random(1, 5)
    			Sleep(50)
    			If $atk > 4 Then
    					Send("{LEFT}")
    					Sleep(50)
    					Send("{UP}")
    					Sleep(50)
    					Send("{RIGHT}")
    					Sleep(50)
    					Send($abutton)
    					Sleep(50)
    					Return 1
    			EndIf
    			While $i < 3
    				If $debug = 1 Then
    					$info5 = "in pp check"
    					_GUICtrlListBox_BeginUpdate($Label5)
    					_GUICtrlListBox_InsertString($Label5, $info5)
    					_GUICtrlListBox_EndUpdate($Label5)
    					$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    					$iIndex = $iIndex + 1
    					_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    				EndIf
    				$info3 = "Got PP?"
    				GUICtrlSetData($Label3, $info3)
    				Sleep(500)
    				$i = $i + 1
    				$image2 = _ImageSearchArea('pp2.png', 1, 100, 300, 520, 570, $x, $y, 80)
    				$image = _ImageSearchArea('pp.png', 1, 110, 400, 320, 470, $x, $y, 50)
    				If $image = 1 Or $image2 = 1 Then
    					$info3 = "Warning no PP"
    					GUICtrlSetData($Label3, $info3)
    					Send("{LEFT}")
    					Sleep(50)
    					Send("{UP}")
    					Sleep(50)
    					Send("{RIGHT}")
    					Sleep(50)
    					Send($abutton)
    					Sleep(50)
    					Return 1
    				EndIf
    			WEnd
    			If $debug = 1 Then
    				$info5 = "pp checked and ok"
    				_GUICtrlListBox_BeginUpdate($Label5)
    				_GUICtrlListBox_InsertString($Label5, $info5)
    				_GUICtrlListBox_EndUpdate($Label5)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    			EndIf
    			$info3 = "Still some PP..."
    			GUICtrlSetData($Label3, $info3)
    			$i = 0
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{UP}")
    			Sleep(50)
    			Send($abutton)
    			Sleep(50)
    		EndIf
    		Return 1
    	EndIf
    	$image = PixelSearch(875, 515, 895, 535, 0xFFFFFF, 5)
    	If IsArray($image) Then
    		If $debug = 1 Then
    			$info5 = "input required"
    			_GUICtrlListBox_BeginUpdate($Label5)
    			_GUICtrlListBox_InsertString($Label5, $info5)
    			_GUICtrlListBox_EndUpdate($Label5)
    			$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    			$iIndex = $iIndex + 1
    			_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    		EndIf
    		$info3 = "Input needed."
    		GUICtrlSetData($Label3, $info3)
    		Sleep(50)
    		Send($bbutton)
    		Sleep(50)
    		Return 1
    	EndIf
    	If $debug = 1 Then
    		$info5 = "right stick fight check"
    		_GUICtrlListBox_BeginUpdate($Label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    	EndIf
    	Sleep(50)
    	Send("{RIGHT}")
    	Sleep(50)
    
    	$image = PixelSearch(780, 430, 800, 450, 0x839299, 5)
    	If IsArray($image) Then
    		If $moveforget = 1 Then
    			$info3 = "Move detected"
    			GUICtrlSetData($Label3, $info3)
    			Sleep(50)
    			MouseClick("left", $image[0], $image[1], 1, 0)
    			Sleep(50)
    			MouseClick("left", 509, 377, 1, 0)
    			Sleep(50)
    			Return 1
    		Else
    			SoundPlay("move.wav", 1)
    			Sleep(500)
    			Return 1
    		EndIf
    	EndIf
    	Return 1
    EndFunc   ;==>fight
    
    Func walk()
    	$change = 0
    	If $debug = 1 Then
    		$info5 = "in walk"
    		_GUICtrlListBox_BeginUpdate($Label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    	EndIf
    	If $square = 1 Then
    		If $walk < 1 Then
    			If $debug = 1 Then
    				$info5 = "walking down"
    				_GUICtrlListBox_BeginUpdate($Label5)
    				_GUICtrlListBox_InsertString($Label5, $info5)
    				_GUICtrlListBox_EndUpdate($Label5)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    			EndIf
    			$info3 = "Walking down."
    			GUICtrlSetData($Label3, $info3)
    			Send("{DOWN down}")
    			Sleep(Random($walktime, $walktime + 100, 1))
    			Send("{DOWN up}")
    			$walk = 1
    			Sleep(50)
    			Return 1
    		EndIf
    
    		If $walk < 2 Then
    			If $debug = 1 Then
    				$info5 = "walking left"
    				_GUICtrlListBox_BeginUpdate($Label5)
    				_GUICtrlListBox_InsertString($Label5, $info5)
    				_GUICtrlListBox_EndUpdate($Label5)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    			EndIf
    			$info3 = "Walking left."
    			GUICtrlSetData($Label3, $info3)
    			Send("{LEFT down}")
    			Sleep(Random($walktime, $walktime + 100, 1))
    			Send("{LEFT up}")
    			$walk = 2
    			Sleep(50)
    			Return 1
    		EndIf
    
    		If $walk < 3 Then
    			If $debug = 1 Then
    				$info5 = "walking up"
    				_GUICtrlListBox_BeginUpdate($Label5)
    				_GUICtrlListBox_InsertString($Label5, $info5)
    				_GUICtrlListBox_EndUpdate($Label5)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    			EndIf
    			$info3 = "Walking up."
    			GUICtrlSetData($Label3, $info3)
    			Send("{UP down}")
    			Sleep(Random($walktime, $walktime + 100, 1))
    			Send("{UP up}")
    			$walk = 3
    			Sleep(50)
    			Return 1
    		EndIf
    
    		If $walk < 4 Then
    			If $debug = 1 Then
    				$info5 = "walking right"
    				_GUICtrlListBox_BeginUpdate($Label5)
    				_GUICtrlListBox_InsertString($Label5, $info5)
    				_GUICtrlListBox_EndUpdate($Label5)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    			EndIf
    			$info3 = "Walking right."
    			GUICtrlSetData($Label3, $info3)
    			Send("{RIGHT down}")
    			Sleep(Random($walktime, $walktime + 100, 1))
    			Send("{RIGHT up}")
    			$walk = 0
    			Sleep(50)
    			Return 1
    		EndIf
    	EndIf
    
    	If $square = 0 Then
    		If $walk < 1 Then
    			If $debug = 1 Then
    				$info5 = "walking down"
    				_GUICtrlListBox_BeginUpdate($Label5)
    				_GUICtrlListBox_InsertString($Label5, $info5)
    				_GUICtrlListBox_EndUpdate($Label5)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    			EndIf
    			$info3 = "Walking down."
    			GUICtrlSetData($Label3, $info3)
    			Send("{DOWN down}")
    			Sleep(Random($walktime, $walktime + 100, 1))
    			Send("{DOWN up}")
    			$walk = 1
    			Sleep(50)
    			Return 1
    		EndIf
    
    		If $walk < 2 Then
    			If $debug = 1 Then
    				$info5 = "walking up"
    				_GUICtrlListBox_BeginUpdate($Label5)
    				_GUICtrlListBox_InsertString($Label5, $info5)
    				_GUICtrlListBox_EndUpdate($Label5)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    			EndIf
    			$info3 = "Walking up."
    			GUICtrlSetData($Label3, $info3)
    			Send("{UP down}")
    			Sleep(Random($walktime, $walktime + 100, 1))
    			Send("{UP up}")
    			$walk = 0
    			Sleep(50)
    			Return 1
    		EndIf
    	EndIf
    	If $square = 2 Then
    		If $walk < 1 Then
    			If $debug = 1 Then
    				$info5 = "walking left"
    				_GUICtrlListBox_BeginUpdate($Label5)
    				_GUICtrlListBox_InsertString($Label5, $info5)
    				_GUICtrlListBox_EndUpdate($Label5)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    			EndIf
    			$info3 = "Walking left."
    			GUICtrlSetData($Label3, $info3)
    			Send("{LEFT down}")
    			Sleep(Random($walktime, $walktime + 100, 1))
    			Send("{LEFT up}")
    			$walk = 1
    			Sleep(50)
    			Return 1
    		EndIf
    
    		If $walk < 2 Then
    			If $debug = 1 Then
    				$info5 = "walking right"
    				_GUICtrlListBox_BeginUpdate($Label5)
    				_GUICtrlListBox_InsertString($Label5, $info5)
    				_GUICtrlListBox_EndUpdate($Label5)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    			EndIf
    			$info3 = "Walking right."
    			GUICtrlSetData($Label3, $info3)
    			Send("{RIGHT down}")
    			Sleep(Random($walktime, $walktime + 100, 1))
    			Send("{RIGHT up}")
    			$walk = 0
    			Sleep(50)
    			Return 1
    		EndIf
    	EndIf
    	Return 1
    EndFunc   ;==>walk
    
    Func login();return 3 -OK
    	If $debug = 1 Then
    		$info5 = "in login"
    		_GUICtrlListBox_BeginUpdate($Label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    	EndIf
    	If $log = 1 Then
    		If $debug = 1 Then
    			$info5 = "loggin in"
    			_GUICtrlListBox_BeginUpdate($Label5)
    			_GUICtrlListBox_InsertString($Label5, $info5)
    			_GUICtrlListBox_EndUpdate($Label5)
    			$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    			$iIndex = $iIndex + 1
    			_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    		EndIf
    		$info3 = "Loggin in..."
    		GUICtrlSetData($Label3, $info3)
    		Sleep(500)
    		MouseClick("left", 582, 351, 2, 0);login
    		Sleep(50)
    		Send("{BS down}")
    		Sleep(1700)
    		Send("{BS up}")
    		Sleep(50)
    		Send("{DEL down}")
    		Sleep(1700)
    		Send("{DEL up}")
    		Sleep(50)
    		Send($user)
    		Sleep(50)
    		Send("{TAB}")
    		Sleep(50)
    		Send("{BS down}")
    		Sleep(1500)
    		Send("{BS up}")
    		Sleep(50)
    		Send("{DEL down}")
    		Sleep(1500)
    		Send("{DEL up}")
    		Sleep(50)
    		Send($pass)
    		Sleep(50)
    		Send("{ENTER}")
    		Sleep(3000)
    		Send("{ENTER}")
    		Sleep(3000)
    		Send("{ENTER}")
    		Sleep(3000)
    		$info3 = "Logged in."
    		GUICtrlSetData($Label3, $info3)
    		Return 1;start
    	Else
    		If $debug = 1 Then
    			$info5 = "autolog set to no"
    			_GUICtrlListBox_BeginUpdate($Label5)
    			_GUICtrlListBox_InsertString($Label5, $info5)
    			_GUICtrlListBox_EndUpdate($Label5)
    			$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    			$iIndex = $iIndex + 1
    			_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    		EndIf
    		$info3 = "Autologin not enabled, please login."
    		GUICtrlSetData($Label3, $info3)
    		Return 1;start
    	EndIf
    EndFunc   ;==>login
    
    Func state()
    	If $debug = 1 Then
    		$info5 = "in state"
    		_GUICtrlListBox_BeginUpdate($Label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    	EndIf
    	$image = PixelSearch(200, 400, 700, 420, 0x1D415D, 3)
    	If IsArray($image) Then
    		If $debug = 1 Then
    			$info5 = "fight found"
    			_GUICtrlListBox_BeginUpdate($Label5)
    			_GUICtrlListBox_InsertString($Label5, $info5)
    			_GUICtrlListBox_EndUpdate($Label5)
    			$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    			$iIndex = $iIndex + 1
    			_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    		EndIf
    		$info2 = "Player is fighting."
    		GUICtrlSetData($Label2, $info2)
    		Sleep(50)
    		Return 3
    	EndIf
    	$image = PixelSearch(500, 85, 520, 95, 0xF3EA6D, 3)
    	If IsArray($image) Then
    		If $debug = 1 Then
    			$info5 = "login found"
    			_GUICtrlListBox_BeginUpdate($Label5)
    			_GUICtrlListBox_InsertString($Label5, $info5)
    			_GUICtrlListBox_EndUpdate($Label5)
    			$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    			$iIndex = $iIndex + 1
    			_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    		EndIf
    		$info2 = "Player is at login."
    		GUICtrlSetData($Label2, $info2)
    		Sleep(50)
    		Return 5
    	EndIf
    	If $debug = 1 Then
    		$info5 = "nothing found"
    		_GUICtrlListBox_BeginUpdate($Label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    	EndIf
    	$info2 = "Player is looking for pokemon."
    	GUICtrlSetData($Label2, $info2)
    	Sleep(50)
    	If $fish = 1 Then
    		Return 6
    	Else
    		Return 4
    	EndIf
    Return 1
    EndFunc   ;==>state
    
    Func start()
    	$info1 = "Running..."
    	GUICtrlSetData($Label1, $info1)
    				If $read = 0 Then
    					$log = IniRead("config.ini", "setting", "log", "0")
    					If $log = 1 Then
    						$user =  IniRead("config.ini", "setting", "user", "")
    						$pass = BinaryToString(IniRead("config.ini", "setting", "pass", '"passdefault"'), 4)
    					EndIf
    					$debug = IniRead("config.ini", "setting", "debug", "0")
    					$train = IniRead("config.ini", "setting", "train", "0")
    					$square = IniRead("config.ini", "setting", "square", "0")
    					$walktime = IniRead("config.ini", "setting", "walktime", "800")
    					$abutton = IniRead("config.ini", "setting", "abutton", "z")
    					$bbutton = IniRead("config.ini", "setting", "bbutton", "x")
    					$moveforget = IniRead("config.ini", "setting", "moveforget", "0")
    					$fish = IniRead("config.ini", "setting", "fish", "0")
    					$read = 1
    				EndIf
    
    	$info4 = "F7 to pause / F8 to resume / F9 to quit"
    	If Not WinExists("[CLASS:LWJGL]") Then
    		$info1 = "Window not found, waiting for game."
    		GUICtrlSetData($Label1, $info1)
    		Sleep(50)
    		Return 1
    	EndIf
    	If WinActive("[CLASS:LWJGL]") Then
    		$pos = WinGetPos("[CLASS:LWJGL]")
    		$info1 = "Window found, focus OK."
    		WinMove("[CLASS:LWJGL]", "", $pos[0], $pos[1], 1032, 795)
    		GUICtrlSetData($Label1, $info1)
    		Sleep(50)
    		Return 2
    	EndIf
    	WinActivate("[CLASS:LWJGL]")
    	$info1 = "Window found, waiting for game focus."
    	GUICtrlSetData($Label1, $info1)
    	Sleep(50)
    	Return 1
    EndFunc   ;==>start
    
    Func _ImageSearchArea($FindImage, $ResultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $Tolerance)
    	If $Tolerance > 0 Then $FindImage = "*" & $Tolerance & " " & $FindImage
    
    	If    @autoItX64 Then
    		$Result = DllCall("ImageSearchDLL_x64.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $FindImage)
    	Else
    		$Result = DllCall("ImageSearchDLL.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $FindImage)
    	EndIf
    
    	If $Result = "0" Then Return 0
    
    	$Array = StringSplit($Result[0], "|")
    
    	If (UBound($Array) >= 4) Then
    		$x = Int(Number($Array[2]))
    		$y = Int(Number($Array[3]))
    
    		If $ResultPosition = 1 Then
    			$x = $x + Int(Number($Array[4]) / 2)
    			$y = $y + Int(Number($Array[5]) / 2)
    		EndIf
    		Return 1
    	EndIf
    EndFunc   ;==>_ImageSearchArea
    
    Func TogglePause()
    	While 1
    		$info1 = "PAUSED PRESS F8 TO RESUME / F9 TO QUIT"
    		GUICtrlSetData($Label1, $info1)
    		Sleep(100)
    		If _IsPressed("77", $dll) Then
    			Return 1
    		EndIf
    	WEnd
    EndFunc   ;==>TogglePause
    
    Func quit()
    		Sleep(100)
    			Exit
    EndFunc   ;==>TogglePause
    
    Func setting()
    
    	#region ### START Koda GUI section ### Form=C:\Documents and Settings\Administrator\Desktop\pokemmo bot\koda\Forms\Form1.kxf
    	$Form1 = GUICreate("UglyBot Setting", 466, 294, 287, 138)
    	$Label1 = GUICtrlCreateLabel("Auto Login", 16, 8, 55, 17)
    	$Label2 = GUICtrlCreateLabel("Username", 16, 36, 52, 17)
    	$Label3 = GUICtrlCreateLabel("Password", 16, 63, 50, 17)
    	$Label4 = GUICtrlCreateLabel("Debug Mode", 16, 91, 66, 17)
    	$Label5 = GUICtrlCreateLabel("Training", 16, 118, 42, 17)
    	$Label6 = GUICtrlCreateLabel("Walking type", 16, 146, 66, 17)
    	$Label7 = GUICtrlCreateLabel("Walking time (ms)", 16, 173, 85, 17)
    	$Label8 = GUICtrlCreateLabel("Button A", 16, 201, 45, 17)
    	$Label9 = GUICtrlCreateLabel("Button B", 16, 228, 45, 17)
    	$Button1 = GUICtrlCreateButton("Save and start", 16, 256, 89, 25)
    	$Checkbox1 = GUICtrlCreateCheckbox("", 104, 8, 97, 17)
    	$Checkbox2 = GUICtrlCreateCheckbox("", 104, 89, 17, 17)
    	$Radio1 = GUICtrlCreateRadio("Square", 104, 143, 113, 17)
    	$Radio2 = GUICtrlCreateRadio("Left/Right", 224, 144, 113, 17)
    	$Radio3 = GUICtrlCreateRadio("Up/Down", 344, 144, 113, 17)
    	$Input3 = GUICtrlCreateInput("500", 104, 170, 121, 21)
    	$Input4 = GUICtrlCreateInput("Z", 104, 197, 121, 21)
    	$Input5 = GUICtrlCreateInput("X", 104, 224, 121, 21)
    	$Checkbox3 = GUICtrlCreateCheckbox("", 104, 116, 17, 17)
    	$Checkbox4 = GUICtrlCreateCheckbox("Forget new Moves", 144, 116, 107, 17)
    	$Checkbox5 = GUICtrlCreateCheckbox("FishBot (F5)", 144, 89, 107, 17)
    	GUISetState(@SW_SHOW)
    	#endregion ### END Koda GUI section ###
    
    	If Not FileExists("config.ini") Then
    		IniWrite("config.ini", "setting", "log", "0")
    		IniWrite("config.ini", "setting", "user", '"user"')
    		IniWrite("config.ini", "setting", "pass", '"pass"')
    		IniWrite("config.ini", "setting", "debug", "0")
    		IniWrite("config.ini", "setting", "train", "0")
    		IniWrite("config.ini", "setting", "square", "1")
    		IniWrite("config.ini", "setting", "walktime", "500")
    		IniWrite("config.ini", "setting", "abutton", "z")
    		IniWrite("config.ini", "setting", "bbutton", "x")
    		IniWrite("config.ini", "setting", "moveforget", "0")
    		IniWrite("config.ini", "setting", "fish", "0")
    	EndIf
    
    
    	If IniRead("config.ini", "setting", "log", "0") = 1 Then
    		_GUICtrlButton_SetCheck($Checkbox1)
    		$Input1 = GUICtrlCreateInput("", 104, 35, 97, 21)
    		$Input2 = GUICtrlCreateInput("", 104, 62, 97, 21, $ES_PASSWORD)
    		GUICtrlSetData($Input1, IniRead("config.ini", "setting", "user", '"userdefault"'))
    		$pass = BinaryToString(IniRead("config.ini", "setting", "pass", '"passdefault"'), 4)
    		GUICtrlSetData($Input2, $pass)
    		$log = 1
    	Else
    		$log = 0
    	EndIf
    	If IniRead("config.ini", "setting", "debug", "0") = 1 Then
    		_GUICtrlButton_SetCheck($Checkbox2)
    		$debug = 1
    	Else
    		$debug = 0
    	EndIf
    	If IniRead("config.ini", "setting", "train", "0") = 1 Then
    		_GUICtrlButton_SetCheck($Checkbox3)
    		$train = 1
    	Else
    		$train = 0
    	EndIf
    	If IniRead("config.ini", "setting", "square", "1") = 0 Then
    		_GUICtrlButton_SetCheck($Radio3)
    		_GUICtrlButton_SetCheck($Radio1, $BST_UNCHECKED)
    		_GUICtrlButton_SetCheck($Radio2, $BST_UNCHECKED)
    		$square = 0
    	EndIf
    	If IniRead("config.ini", "setting", "square", "1") = 2 Then
    		_GUICtrlButton_SetCheck($Radio2)
    		_GUICtrlButton_SetCheck($Radio1, $BST_UNCHECKED)
    		_GUICtrlButton_SetCheck($Radio3, $BST_UNCHECKED)
    		$square = 2
    	EndIf
    	If IniRead("config.ini", "setting", "square", "1") = 1 Then
    		_GUICtrlButton_SetCheck($Radio1)
    		_GUICtrlButton_SetCheck($Radio3, $BST_UNCHECKED)
    		_GUICtrlButton_SetCheck($Radio2, $BST_UNCHECKED)
    		$square = 1
    	EndIf
    	If Not IniRead("config.ini", "setting", "square", "1") = 1 And Not IniRead("config.ini", "setting", "square", "1") = 0 And Not IniRead("config.ini", "setting", "square", "1") = 2 Then
    		_GUICtrlButton_SetCheck($Radio3)
    		_GUICtrlButton_SetCheck($Radio1, $BST_UNCHECKED)
    		_GUICtrlButton_SetCheck($Radio2, $BST_UNCHECKED)
    		$square = 0
    	EndIf
    	GUICtrlSetData($Input3, IniRead("config.ini", "setting", "walktime", "500"))
    	GUICtrlSetData($Input4, IniRead("config.ini", "setting", "abutton", "z"))
    	GUICtrlSetData($Input5, IniRead("config.ini", "setting", "bbutton", "x"))
    	If IniRead("config.ini", "setting", "moveforget", "1") = 1 Then
    		_GUICtrlButton_SetCheck($checkbox4)
    		$moveforget = 1
    	Else
    		$moveforget = 0
    	EndIf
    
    	If IniRead("config.ini", "setting", "fish", "0") = 1 Then
    		_GUICtrlButton_SetCheck($checkbox5)
    		$fish = 1
    	Else
    		$fish = 0
    	EndIf
    
    	While 1
    		$nMsg = GUIGetMsg()
    		Sleep(50)
    		If $log = 1 Then
    			$user = GUICtrlRead($Input1, 1)
    			$pass = GUICtrlRead($Input2, 1)
    		EndIf
    		$walktime = GUICtrlRead($Input3, 1)
    		$abutton = GUICtrlRead($Input4, 1)
    		$bbutton = GUICtrlRead($Input5, 1)
    
    		Switch $nMsg
    			Case $GUI_EVENT_CLOSE
    				Exit
    			Case $Button1
    				IniWrite("config.ini", "setting", "log", $log)
    				If $log = 1 Then
    					IniWrite("config.ini", "setting", "user", $user)
    					IniWrite("config.ini", "setting", "pass", StringToBinary($pass, 4))
    				EndIf
    				IniWrite("config.ini", "setting", "debug", $debug)
    				IniWrite("config.ini", "setting", "train", $train)
    				IniWrite("config.ini", "setting", "square", $square)
    				IniWrite("config.ini", "setting", "walktime", $walktime)
    				IniWrite("config.ini", "setting", "abutton", $abutton)
    				IniWrite("config.ini", "setting", "bbutton", $bbutton)
    				IniWrite("config.ini", "setting", "moveforget", $moveforget)
    				IniWrite("config.ini", "setting", "fish", $fish)
    				GUIDelete($Form1)
    				Return 1
    			Case $Checkbox1
    				If _GUICtrlButton_GetCheck($Checkbox1) Then
    					$log = 1
    					$Input1 = GUICtrlCreateInput("", 104, 35, 97, 21)
    					$Input2 = GUICtrlCreateInput("", 104, 62, 97, 21, $ES_PASSWORD)
    				Else
    					$log = 0
    					GUICtrlDelete($Input1)
    					GUICtrlDelete($Input2)
    				EndIf
    			Case $Radio1
    				If _GUICtrlButton_GetCheck($Radio1) Then
    					$square = 1
    					_GUICtrlButton_SetCheck($Radio2, $BST_UNCHECKED)
    					_GUICtrlButton_SetCheck($Radio3, $BST_UNCHECKED)
    				EndIf
    			Case $Radio2
    				If _GUICtrlButton_GetCheck($Radio2) Then
    					$square = 2
    					_GUICtrlButton_SetCheck($Radio1, $BST_UNCHECKED)
    					_GUICtrlButton_SetCheck($Radio3, $BST_UNCHECKED)
    				EndIf
    			Case $Radio3
    				If _GUICtrlButton_GetCheck($Radio3) Then
    					$square = 0
    					_GUICtrlButton_SetCheck($Radio1, $BST_UNCHECKED)
    					_GUICtrlButton_SetCheck($Radio2, $BST_UNCHECKED)
    				EndIf
    			Case $Checkbox2
    				If _GUICtrlButton_GetCheck($Checkbox2) Then
    					$debug = 1
    				Else
    					$debug = 0
    				EndIf
    
    			Case $Checkbox3
    				If _GUICtrlButton_GetCheck($Checkbox3) Then
    					$train = 1
    				Else
    					$train = 0
    				EndIf
    			Case $checkbox4
    				If _GUICtrlButton_GetCheck($checkbox4) Then
    					$moveforget = 1
    				Else
    					$moveforget = 0
    				EndIf
    			Case $checkbox5
    				If _GUICtrlButton_GetCheck($checkbox5) Then
    					$fish = 1
    				Else
    					$fish = 0
    				EndIf
    		EndSwitch
    	WEnd
    
    EndFunc   ;==>setting
    
    Func fishbot()
    	$change = 0
    	If $count = 20 Then
    		$hurt = 1
    		$count = 0
    	EndIf
    
    	$image = PixelSearch(500, 170, 510, 180, 0xE08098, 1)
    	If IsArray($image) And $hurt = 1 Then
    		Send("{UP up}")
    		Sleep(2000)
    		Send($abutton);talk nurse
    		Sleep(2000)
    		Send($abutton); say hi
    		Sleep(2000)
    		Send($abutton);heal
    		Sleep(2000)
    		Send($abutton);waiting
    		Sleep(2000)
    		Send($bbutton);thanks
    		Sleep(2000)
    		Send($bbutton);bye
    		Sleep(2000)
    		Send($bbutton);yeah love you too
    		Sleep(2000)
    		Send($bbutton);stop talking to me psycho
    		Sleep(2000)
    		Send($bbutton);im gonna call your manager!
    		Sleep(2000)
    		$hurt = 0
    		Return 1
    	EndIf
    
    	$image = PixelSearch(500, 410, 510, 420, 0x4878D8, 1)
    	If IsArray($image) And $hurt = 0 Then
    		Send("{DOWN up}")
    		Sleep(500)
    		Send("{DOWN}");make sure you look ok
    		Sleep(50)
    		Send($canebutton);see water
    		$something = 0
    		Sleep(5000)
    		Send($abutton);somenthing?
    		Sleep(500)
    		Send("{DOWN}")
    		$something = 1
    		Return 1
    	EndIf
    
    	If $hurt = 1 Then
    		Send("{UP down}")
    		Return 1
    	EndIf
    
    	If $hurt = 0 Then
    		Send("{DOWN down}")
    		Return 1
    	EndIf
    Return 1
    EndFunc


    Note to moderation: Can you put this one in first post? Thank you.
    <b>Downloadable Files</b> Downloadable Files
    Last edited by franklin01; 12-09-2013 at 11:41 AM. Reason: added screenshot + bad at formating

  5. The Following 20 Users Say Thank You to franklin01 For This Useful Post:

    azimdaniel00 (11-16-2014),Badis-Dz (02-02-2014),catsik (12-11-2013),cleiton amaral (03-15-2019),cmd7 (05-13-2019),crazypenguin10 (12-10-2013),diamonteh (01-27-2014),fireflashhh (08-20-2014),Haruninho (12-10-2014),heohanwuoc (09-13-2014),imyaj123 (08-07-2014),JKyleWallace (01-16-2014),Lightell (12-10-2013),limkangxian1999 (01-01-2015),pokemmotest (09-11-2018),qazsedc1234 (04-04-2014),superaris0601 (11-23-2014),theguy619 (08-21-2021),todorokisam (07-05-2021),Uchilas (11-08-2014)

  6. #4
    Austin's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Great White North
    Posts
    30,484
    Reputation
    6104
    Thanks
    8,326
    My Mood
    Lurking
    approved .




    VIP Support // May 2011
    CF Minion // January 2012
    Newsforce // August 2012
    Minion+ // March 2013
    Moderator // August 2014
    Former Staff // January 2015
    General Minion // July 2015
    Publicist // December 2015





  7. #5
    hujakt78's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0
    My Mood
    Cold
    What would be great for this bot:
    1. To select which Move use: 1 and 2 and 3, or 1, or 2 and 4. I think you get what i want to say.
    2. Catch Mode.
    Last edited by hujakt78; 12-10-2013 at 03:17 AM.

  8. #6
    franklin01's Avatar
    Join Date
    May 2013
    Gender
    male
    Posts
    27
    Reputation
    10
    Thanks
    198
    At the moment, move 1 (top left) is used and 1/5 times move 2 (top right) is used. Also is move 1 has no PP then move 2 is used.
    I will try to see if I can manage to make move selection work.

    About catching stuff, it can be done but I am waiting to encounter a shiney pokemon as it will be the thing you want to catch and not 2856 magicarp.

    But dully noted.

  9. #7
    franklin01's Avatar
    Join Date
    May 2013
    Gender
    male
    Posts
    27
    Reputation
    10
    Thanks
    198

    Arrow UglyBot Update v0.2

    Update v0.2

    Changelog:
    from v0.1 to v0.2
    *added move selection
    *rewritted pp detection code
    *rewritted attack selection
    *small fixes
    *catching pokemon
    *pokeball detection
    *added casino play

    bug:
    *if in pokemon selection after a death and no full health pokemon, then stuck
    *if everyone dies, keep running in pokecenter.
    *if catch enabled and if end up in a fight with a trainer and pokemon is not in pokedex will try to catch it.

    Note:

    About Casino stuff, start playing and then click the button, also I dont see the point as in my test I ended up with less coin at the end but I might be unlucky. Casino might seem slow but it is actually fast enough to not send duplicate commands.
    About Fishbot, it will try to heal pokemon before going to fish. This is for you to check if the path is ok, basically any pokemon center with water below it will work.
    About Move selection, at least 1 move must be selected, if none are set move 1 (top left) will be used. If pp in selected move are depleted then a random move will be selected.
    About Catching Pokemon, it will attempt to capture any pokemon you do not already own. It does not detect shiney thing because I didn't find one yet to add some detection pattern. If in a fight against a trainer it will try to capture the pokemon if not owned but luckily will run out of pokeballs and fight.
    About pokeballs detection, if none are left then catch will be disabled.

    About background botting:
    Short version, hit "windows key + P" and select "extended desktop".
    Now move the PokeMMO window to the right side so it is barely visible.
    Start your movie/video.
    Start the bot.

    Long version:
    This is a pixelsearch and click bot so two things are needed, focus and visibility. Focus is not needed if you want to watch a movie/video but visibility might be an issue so here is a little trick.
    Hitting winkey + p will pop out a menu for screen configuration. If you select "extended Desktop" another desktop will be added to the right side of your screen and shown on a second screen if present.
    The trick is that the bot needs to be able to see what is on screen but you as a person dont need to see it.
    So if you move the PokeMMO windows to this second desktop (that you won't see unless you have a second monitor), then the primary desktop (what you usually see) will be available to display all kind of things such as movies.
    Because of focus and input requirement you can't use this method to browse the web or do other thing than wathcing stuff but it might be already a good thing.
    This trick might work with other bots as long as they detect windows position.


    New gui:


    As always tested on multiple things but feel free to ask about bugs and or request it will be noted.

    Feature request and bug report are appreciated so don't be shy.

    Virus scan:
    uglybot sourcev0.2.zip MD5:d94847b9363adcf63415fab9e9fcf48b - VirSCAN.org 3% Scanner(s) (1/37) found malware!
    https://www.virustotal.com/fr/file/4...is/1386796988/

    Source code:
    Code:
    ; note: can be improved, if so please share with the comunity
    ; If you want to support you can throw a penny here.
    ; LTC: LfHAabU9Lqzn6sgdYcfoLZFoZjf36PW3rf
    ; NMC: N7P667yC5aMTUFb4h7S1UVbMzvvmfZsXjw
    
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Misc.au3>
    #include <Array.au3>
    #include <File.au3>
    #include <GDIPlus.au3>
    #include <ScreenCapture.au3>
    #include <WinAPI.au3>
    #include <ScrollBarConstants.au3>
    #include <WindowsConstants.au3>
    #include <GuiComboBox.au3>
    #include <GuiListBox.au3>
    #include <GuiButton.au3>
    #include <EditConstants.au3>
    #include <ButtonConstants.au3>
    #include <Math.au3>
    #include <GuiListBox.au3>
    
    Opt("WinTitleMatchMode", 1)
    Opt("PixelCoordMode", 2)
    Opt("MouseCoordMode", 2)
    
    If Not FileExists("ImageSearchDLL.dll") Then
    MsgBox(4096, "ImageSearchDLL.dll not found, some features will not be available.", 10)
    EndIf
    If Not FileExists("ImageSearchDLL_x64.dll") Then
    MsgBox(4096, "ImageSearchDLL_x64.dll not found, some features will not be available.", 10)
    EndIf
    If Not FileExists("move.png") Then
    MsgBox(4096, "move.png not found, some features will not be available.", 10)
    EndIf
    If Not FileExists("pp.png") Then
    MsgBox(4096, "pp.png not found, some features will not be available.", 10)
    EndIf
    If Not FileExists("pp.png") Then
    MsgBox(4096, "pp2.png not found, some features will not be available.", 10)
    EndIf
    If Not FileExists("move.wav") Then
    MsgBox(4096, "move.wav not found, some features will not be available.", 10)
    EndIf
    
    If Not FileExists("config.ini") Then
    MsgBox(4096, "config.ini not found, creating a new one.", 10)
    EndIf
    
    Dim $casino = 0
    Dim $abutton
    Dim $bbutton
    Dim $square
    Dim $walktime
    Dim $moveforget
    Dim $catch = 0
    Dim $catched = 1
    Dim $job
    Dim $pp1 = 1
    Dim $pp2 = 1
    Dim $pp3 = 1
    Dim $pp4 = 1
    Dim $Label1
    Dim $e = -1
    Dim $selectedatk[4]
    Dim $pp = 1
    Dim $Label2
    Dim $Label3
    Dim $Label4
    Dim $read = 0
    Dim $fish
    Dim $hurt = 1
    Dim $canebutton = "{F5}"
    Dim $Label5
    dim $atk
    Dim $totalcount = 0
    Dim $count = 0
    Dim $something = 0
    Dim $move1
    Dim $move2
    Dim $move3
    Dim $move4
    Dim $info1
    Dim $info2
    Dim $info3
    Dim $info4 = "Press [Pause] to pause / F11 to resume / F12 to quit"
    Dim $info5 = "Debug enabled"
    Dim $image
    Dim $image2
    Dim $pos
    Dim $walk = 0
    Dim $log
    Dim $dll = DllOpen("user32.dll")
    Global $x, $y, $image
    Dim $user
    Dim $pass
    Dim $debug
    Dim $change = 0
    Dim $train
    
    $job = setting()
    
    HotKeySet("{F7}", "TogglePause")
    HotKeySet("{F9}", "quit")
    
    If $debug = 1 Then
    GUICreate("uglybot", 225, 300, 20, 0, BitOR($WS_BORDER, $WS_POPUP), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
    $Label5 = GUICtrlCreateList("debug menu", 0, 96, 225, 200, BitOR($WS_BORDER, $WS_VSCROLL))
    
    GUICtrlSetLimit(-1, 200)
    Else
    GUICreate("uglybot", 225, 100, 20, 0, BitOR($WS_BORDER, $WS_POPUP), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
    EndIf
    
    $Label1 = GUICtrlCreateLabel("Label1", 0, 0, 225, 25)
    $Label2 = GUICtrlCreateLabel("Label2", 0, 24, 225, 25)
    $Label3 = GUICtrlCreateLabel("Label3", 0, 48, 225, 25)
    $Label4 = GUICtrlCreateLabel("Label3", 0, 72, 225, 25)
    
    GUISetState()
    
    While 1
    Sleep(100)
    GUICtrlSetData($Label1, $info1)
    GUICtrlSetData($Label2, $info2)
    GUICtrlSetData($Label3, $info3)
    GUICtrlSetData($Label4, $info4)
    
    If $debug = 1 Then
    $info5 = "Processing..."
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    
    Switch $job
    Case 1
    $job = start()
    Case 2
    $job = state()
    Case 3
    $job = fight()
    Case 4
    $job = walk()
    Case 5
    $job = login()
    Case 5
    $job = setting()
    Case 6
    $job = fishbot()
    Case 7
    	$job = casinobot()
    EndSwitch
    WEnd
    
    Func fight()
    If $something = 1 Then
    $count = $count + 1
    $totalcount = $totalcount + 1
    $something = 0
    EndIf
    
    If $debug = 1 Then
    $info5 = "In fight"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    
    $image = PixelSearch(110, 395, 750, 540, 0x8DC655, 5);greenbar
    If IsArray($image) Then
    MouseClick("left", $image[0], $image[1], 1, 0)
    Sleep(50)
    Send($bbutton)
    Sleep(50)
    Return 1
    EndIf
    
    $image = PixelSearch(110, 395, 540, 540, 0xCFA806, 5);orange
    If IsArray($image) Then
    Sleep(50)
    Send($bbutton)
    If $debug = 1 Then
    $info5 = "In attack"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    If $catch = 1 Then
    	$catched = 0
    	$i = 0
    	While $i < 3
    		If $debug = 1 Then
    			$info5 = "Checking Pokedex..."
    			_GUICtrlListBox_BeginUpdate($Label5)
    			_GUICtrlListBox_InsertString($Label5, $info5)
    			_GUICtrlListBox_EndUpdate($Label5)
    			$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    			$iIndex = $iIndex + 1
    			_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    		EndIf
    	Sleep(50)
    	$image = PixelSearch(160, 105, 400, 115, 0xA80000, 5);redpokeball
    	$i = $i + 1
    	If IsArray($image) Then
    	If $debug = 1 Then
    	$info5 = "Ok already in."
    	_GUICtrlListBox_BeginUpdate($Label5)
    	_GUICtrlListBox_InsertString($Label5, $info5)
    	_GUICtrlListBox_EndUpdate($Label5)
    	$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    	$iIndex = $iIndex + 1
    	_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    	EndIf
    	$catched = 1
    	EndIf
    	WEnd
    
    	If $catched = 0 Then
    		If $debug = 1 Then
    			$info5 = "Not Captured yet..."
    			_GUICtrlListBox_BeginUpdate($Label5)
    			_GUICtrlListBox_InsertString($Label5, $info5)
    			_GUICtrlListBox_EndUpdate($Label5)
    			$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    			$iIndex = $iIndex + 1
    			_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    		EndIf
    		Sleep(50)
    		Send("{RIGHT}")
    		Sleep(50)
    		Send("{UP}")
    		Sleep(50)
    		Send($abutton)
    		Sleep(50)
    		Send("{RIGHT}")
    		Sleep(50)
    		Send("{RIGHT}")
    		Sleep(50)
    		$i = 0
    		While $i < 3
    			Sleep(50)
    		$image = PixelSearch(117, 443, 459, 474, 0xCFA806, 5);orange
    		$i = $i + 1
    		If IsArray($image) Then
    			Send($abutton)
    			Sleep(500)
    			Return 1
    		Else;no balls
    		If $debug = 1 Then
    			$info5 = "Warning NO balls - Catching disabled "
    			_GUICtrlListBox_BeginUpdate($Label5)
    			_GUICtrlListBox_InsertString($Label5, $info5)
    			_GUICtrlListBox_EndUpdate($Label5)
    			$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    			$iIndex = $iIndex + 1
    			_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    		EndIf
    		$catch = 0
    		Sleep(50)
    		Send($bbutton)
    		Sleep(50)
    		Return 1
    		EndIf
    		WEnd
    
    	EndIf
    	EndIf
    	If $train = 1 And $change = 0 Then
    	Sleep(50)
    	Send("{LEFT}")
    	Sleep(50)
    	Send("{LEFT}")
    	Sleep(50)
    	Send("{DOWN}")
    	Sleep(50)
    	Send("{DOWN}")
    	Sleep(50)
    	Send($abutton)
    	Sleep(50)
    	Send("{RIGHT}")
    	Sleep(50)
    	Send($abutton)
    	Sleep(500)
    	$change = 1
    	Else
    	$info3 = "Attacking."
    	GUICtrlSetData($Label3, $info3)
    	Sleep(50)
    	Send("{LEFT}")
    	Sleep(50)
    	Send("{LEFT}")
    	Sleep(50)
    	Send("{UP}")
    	Sleep(50)
    	Send("{UP}")
    	Sleep(50)
    	Send($abutton)
    	Sleep(50)
    	$pp1 = 1
    	$pp2 = 1
    	$pp3 = 1
    	$pp4 = 1
    	$i = 0
    	While $i < 3
    	If $debug = 1 Then
    	$info5 = "in pp check"
    	_GUICtrlListBox_BeginUpdate($Label5)
    	_GUICtrlListBox_InsertString($Label5, $info5)
    	_GUICtrlListBox_EndUpdate($Label5)
    	$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    	$iIndex = $iIndex + 1
    	_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    	EndIf
    	$info3 = "Got PP?"
    	GUICtrlSetData($Label3, $info3)
    	Sleep(50)
    	$i = $i + 1
    	$image2 = _ImageSearchArea('pp2.png', 1, $pos[0]+122, $pos[1]+453, $pos[0]+227, $pos[1]+501, $x, $y, 80)
    	$image = _ImageSearchArea('pp.png', 1, $pos[0]+122, $pos[1]+453, $pos[0]+227, $pos[1]+501, $x, $y, 80)
    	If $image = 1 Or $image2 = 1 Then
    	$info3 = "Warning no PP"
    	GUICtrlSetData($Label3, $info3)
    	$pp1 = 0
    	If $debug = 1 Then
    	$info5 = "move 1 no pp"
    	_GUICtrlListBox_BeginUpdate($Label5)
    	_GUICtrlListBox_InsertString($Label5, $info5)
    	_GUICtrlListBox_EndUpdate($Label5)
    	$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    	$iIndex = $iIndex + 1
    	_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    	EndIf
    	EndIf
    
    	$image2 = _ImageSearchArea('pp2.png', 1, $pos[0] + 335, $pos[1] + 454, $pos[0] + 437, $pos[1] + 496, $x, $y, 80)
    	$image = _ImageSearchArea('pp.png', 1, $pos[0] + 335, $pos[1] + 454, $pos[0] + 437, $pos[1] + 496, $x, $y, 80)
    	If $image = 1 Or $image2 = 1 Then
    	$info3 = "Warning no PP"
    	GUICtrlSetData($Label3, $info3)
    	$pp2 = 0
    	If $debug = 1 Then
    	$info5 = "move 2 no pp"
    	_GUICtrlListBox_BeginUpdate($Label5)
    	_GUICtrlListBox_InsertString($Label5, $info5)
    	_GUICtrlListBox_EndUpdate($Label5)
    	$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    	$iIndex = $iIndex + 1
    	_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    	EndIf
    	EndIf
    
    	$image2 = _ImageSearchArea('pp2.png', 1, $pos[0] + 125, $pos[1] + 507, $pos[0] + 220, $pos[1] + 555, $x, $y, 80)
    	$image = _ImageSearchArea('pp.png', 1, $pos[0] + 125, $pos[1] + 507, $pos[0] + 220, $pos[1] + 555, $x, $y, 80)
    	If $image = 1 Or $image2 = 1 Then
    	$info3 = "Warning no PP"
    	GUICtrlSetData($Label3, $info3)
    	$pp3 = 0
    	If $debug = 1 Then
    	$info5 = "move 3 no pp"
    	_GUICtrlListBox_BeginUpdate($Label5)
    	_GUICtrlListBox_InsertString($Label5, $info5)
    	_GUICtrlListBox_EndUpdate($Label5)
    	$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    	$iIndex = $iIndex + 1
    	_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    	EndIf
    	EndIf
    
    	$image2 = _ImageSearchArea('pp2.png', 1, $pos[0] + 336, $pos[1] + 509, $pos[0] + 440, $pos[1] + 555, $x, $y, 80)
    	$image = _ImageSearchArea('pp.png', 1, $pos[0] + 336, $pos[1] + 509, $pos[0] + 440, $pos[1] + 555, $x, $y, 80)
    	If $image = 1 Or $image2 = 1 Then
    	$info3 = "Warning no PP"
    	GUICtrlSetData($Label3, $info3)
    	$pp4 = 0
    	If $debug = 1 Then
    	$info5 = "move 4 no pp"
    	_GUICtrlListBox_BeginUpdate($Label5)
    	_GUICtrlListBox_InsertString($Label5, $info5)
    	_GUICtrlListBox_EndUpdate($Label5)
    	$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    	$iIndex = $iIndex + 1
    	_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    	EndIf
    	EndIf
    
    	WEnd
    
    	$e = -1
    
    	If $move1 = 1  And $pp1 = 1 Then
    	$e = $e+1
    	$selectedatk[$e] = "$move1"
    	EndIf
    	If $move2 = 1  And $pp2 = 1 Then
    	$e = $e+1
    	$selectedatk[$e] = "$move2"
    	EndIf
    	If $move3 = 1  And $pp3 = 1 Then
    	$e = $e+1
    	$selectedatk[$e] = "$move3"
    	EndIf
    	If $move4 = 1  And $pp4 = 1 Then
    	$e = $e+1
    	$selectedatk[$e] = "$move4"
    	EndIf
    
    	If $e = -1 Then
    		$e = $e+1
    		$selectedatk[$e] = "$move4"
    		$e = $e+1
    		$selectedatk[$e] = "$move3"
    		$e = $e+1
    		$selectedatk[$e] = "$move2"
    		$e = $e+1
    		$selectedatk[$e] = "$move1"
    	EndIf
    
    
    	$nothing = ""
    	$empty = _ArraySearch($selectedatk, $nothing)
    
    	If $empty > 0 Then
    	_ArrayDelete($selectedatk, $empty)
    	$empty = _ArraySearch($selectedatk, $nothing)
    	EndIf
    	If $empty > 0 Then
    	_ArrayDelete($selectedatk, $empty)
    	$empty = _ArraySearch($selectedatk, $nothing)
    	EndIf
    	If $empty > 0 Then
    	_ArrayDelete($selectedatk, $empty)
    	$empty = _ArraySearch($selectedatk, $nothing)
    	EndIf
    	If $empty > 0 Then
    	_ArrayDelete($selectedatk, $empty)
    	$empty = _ArraySearch($selectedatk, $nothing)
    	EndIf
    
    	$pick = Random(0,$e, 1)
    
    	$e = -1
    	If $selectedatk[$pick] = "$move1" Then
    	Send("{LEFT}")
    	Sleep(50)
    	Send("{UP}")
    	Sleep(50)
    	Send($abutton)
    	Sleep(50)
    	Return 1
    	EndIf
    	If $selectedatk[$pick] = "$move2" Then
    	Send("{RIGHT}")
    	Sleep(50)
    	Send("{UP}")
    	Sleep(50)
    	Send($abutton)
    	Sleep(50)
    	Return 1
    	EndIf
    	If $selectedatk[$pick] = "$move3" Then
    	Send("{LEFT}")
    	Sleep(50)
    	Send("{DOWN}")
    	Sleep(50)
    	Send($abutton)
    	Sleep(50)
    	Return 1
    	EndIf
    	If $selectedatk[$pick] = "$move4" Then
    	Send("{RIGHT}")
    	Sleep(50)
    	Send("{DOWN}")
    	Sleep(50)
    	Send($abutton)
    	Sleep(50)
    	Return 1
    	EndIf
    
    	EndIf
    	Return 1
    	EndIf
    	$image = PixelSearch(875, 515, 895, 535, 0xFFFFFF, 5);fleche blanche
    	If IsArray($image) Then
    	If $debug = 1 Then
    	$info5 = "input required"
    	_GUICtrlListBox_BeginUpdate($Label5)
    	_GUICtrlListBox_InsertString($Label5, $info5)
    	_GUICtrlListBox_EndUpdate($Label5)
    	$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    	$iIndex = $iIndex + 1
    	_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    	EndIf
    	$info3 = "Input needed."
    	GUICtrlSetData($Label3, $info3)
    	Sleep(50)
    	Send($bbutton)
    	Sleep(50)
    	Return 1
    	EndIf
    	If $debug = 1 Then
    	$info5 = "right stick fight check"
    	_GUICtrlListBox_BeginUpdate($Label5)
    	_GUICtrlListBox_InsertString($Label5, $info5)
    	_GUICtrlListBox_EndUpdate($Label5)
    	$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    	$iIndex = $iIndex + 1
    	_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    	EndIf
    	Sleep(50)
    	Send("{RIGHT}");juste au cas ou on perde le focus
    	Sleep(50)
    
    	$image = PixelSearch(780, 430, 800, 450, 0x839299, 5);
    	If IsArray($image) Then
    	If $moveforget = 1 Then
    	$info3 = "Move detected"
    	GUICtrlSetData($Label3, $info3)
    	Sleep(50)
    	MouseClick("left", $image[0], $image[1], 1, 0)
    	Sleep(50)
    	MouseClick("left", 509, 377, 1, 0)
    	Sleep(50)
    	Return 1
    	Else
    	SoundPlay("move.wav", 1)
    	Sleep(500)
    	Return 1
    	EndIf
    	EndIf
    ;~ 	EndIf
    	Return 1
    EndFunc   ;==>fight
    
    Func walk()
    $something = 1
    $change = 0
    If $debug = 1 Then
    $info5 = "in walk"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    If $square = 1 Then
    If $walk < 1 Then
    If $debug = 1 Then
    $info5 = "walking down"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    $info3 = "Walking down."
    GUICtrlSetData($Label3, $info3)
    Send("{DOWN down}")
    Sleep(Random($walktime, $walktime + 100, 1))
    Send("{DOWN up}")
    $walk = 1
    Sleep(50)
    Return 1
    EndIf
    
    If $walk < 2 Then
    If $debug = 1 Then
    $info5 = "walking left"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    $info3 = "Walking left."
    GUICtrlSetData($Label3, $info3)
    Send("{LEFT down}")
    Sleep(Random($walktime, $walktime + 100, 1))
    Send("{LEFT up}")
    $walk = 2
    Sleep(50)
    Return 1
    EndIf
    
    If $walk < 3 Then
    If $debug = 1 Then
    $info5 = "walking up"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    $info3 = "Walking up."
    GUICtrlSetData($Label3, $info3)
    Send("{UP down}")
    Sleep(Random($walktime, $walktime + 100, 1))
    Send("{UP up}")
    $walk = 3
    Sleep(50)
    Return 1
    EndIf
    
    If $walk < 4 Then
    If $debug = 1 Then
    $info5 = "walking right"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    $info3 = "Walking right."
    GUICtrlSetData($Label3, $info3)
    Send("{RIGHT down}")
    Sleep(Random($walktime, $walktime + 100, 1))
    Send("{RIGHT up}")
    $walk = 0
    Sleep(50)
    Return 1
    EndIf
    EndIf
    
    If $square = 0 Then
    If $walk < 1 Then
    If $debug = 1 Then
    $info5 = "walking down"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    $info3 = "Walking down."
    GUICtrlSetData($Label3, $info3)
    Send("{DOWN down}")
    Sleep(Random($walktime, $walktime + 100, 1))
    Send("{DOWN up}")
    $walk = 1
    Sleep(50)
    Return 1
    EndIf
    
    If $walk < 2 Then
    If $debug = 1 Then
    $info5 = "walking up"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    $info3 = "Walking up."
    GUICtrlSetData($Label3, $info3)
    Send("{UP down}")
    Sleep(Random($walktime, $walktime + 100, 1))
    Send("{UP up}")
    $walk = 0
    Sleep(50)
    Return 1
    EndIf
    EndIf
    If $square = 2 Then
    If $walk < 1 Then
    If $debug = 1 Then
    $info5 = "walking left"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    $info3 = "Walking left."
    GUICtrlSetData($Label3, $info3)
    Send("{LEFT down}")
    Sleep(Random($walktime, $walktime + 100, 1))
    Send("{LEFT up}")
    $walk = 1
    Sleep(50)
    Return 1
    EndIf
    
    If $walk < 2 Then
    If $debug = 1 Then
    $info5 = "walking right"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    $info3 = "Walking right."
    GUICtrlSetData($Label3, $info3)
    Send("{RIGHT down}")
    Sleep(Random($walktime, $walktime + 100, 1))
    Send("{RIGHT up}")
    $walk = 0
    Sleep(50)
    Return 1
    EndIf
    EndIf
    Return 1
    EndFunc   ;==>walk
    
    Func login();return 3 -OK
    If $debug = 1 Then
    $info5 = "in login"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    If $log = 1 Then
    If $debug = 1 Then
    $info5 = "loggin in"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    $info3 = "Loggin in..."
    GUICtrlSetData($Label3, $info3)
    Sleep(500)
    MouseClick("left", 582, 351, 2, 0);login
    Sleep(50)
    Send("{BS down}")
    Sleep(1700)
    Send("{BS up}")
    Sleep(50)
    Send("{DEL down}")
    Sleep(1700)
    Send("{DEL up}")
    Sleep(50)
    Send($user)
    Sleep(50)
    Send("{TAB}")
    Sleep(50)
    Send("{BS down}")
    Sleep(1500)
    Send("{BS up}")
    Sleep(50)
    Send("{DEL down}")
    Sleep(1500)
    Send("{DEL up}")
    Sleep(50)
    Send($pass)
    Sleep(50)
    Send("{ENTER}")
    Sleep(3000)
    Send("{ENTER}")
    Sleep(3000)
    Send("{ENTER}")
    Sleep(3000)
    $info3 = "Logged in."
    GUICtrlSetData($Label3, $info3)
    Return 1;start
    Else
    If $debug = 1 Then
    $info5 = "autolog set to no"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    $info3 = "Autologin not enabled, please login."
    GUICtrlSetData($Label3, $info3)
    Return 1;start
    EndIf
    EndFunc   ;==>login
    
    Func state()
    If $debug = 1 Then
    $info5 = "in state"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    $image = PixelSearch(503, 715, 515, 720, 0x242C31, 1)
    If IsArray($image) And $catch = 1 And $casino = 0 Then
    Send("{F12}")
    Sleep(500)
    Return 1
    EndIf
    
    $image = PixelSearch(200, 400, 700, 420, 0x1D415D, 3)
    If IsArray($image) Then
    If $debug = 1 Then
    $info5 = "fight found"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    $info2 = "Player is fighting."
    GUICtrlSetData($Label2, $info2)
    Sleep(50)
    Return 3
    EndIf
    $image = PixelSearch(500, 85, 520, 95, 0xF3EA6D, 3)
    If IsArray($image) Then
    If $debug = 1 Then
    $info5 = "login found"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    $info2 = "Player is at login."
    GUICtrlSetData($Label2, $info2)
    Sleep(50)
    Return 5
    EndIf
    If $debug = 1 Then
    $info5 = "nothing found"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    $info2 = "Player is looking for pokemon."
    GUICtrlSetData($Label2, $info2)
    Sleep(50)
    If $fish = 1 Then
    Return 6
    EndIf
    If $casino = 1 Then
    	Return 7
    EndIf
    Return 4
    
    
    EndFunc   ;==>state
    
    Func start()
    $info1 = "Running..."
    GUICtrlSetData($Label1, $info1)
    If $read = 0 Then
    $log = IniRead("config.ini", "setting", "log", "0")
    If $log = 1 Then
    $user =  IniRead("config.ini", "setting", "user", "")
    $pass = BinaryToString(IniRead("config.ini", "setting", "pass", '"passdefault"'), 4)
    EndIf
    $debug = IniRead("config.ini", "setting", "debug", "0")
    $train = IniRead("config.ini", "setting", "train", "0")
    $square = IniRead("config.ini", "setting", "square", "0")
    $walktime = IniRead("config.ini", "setting", "walktime", "800")
    $abutton = IniRead("config.ini", "setting", "abutton", "z")
    $bbutton = IniRead("config.ini", "setting", "bbutton", "x")
    $moveforget = IniRead("config.ini", "setting", "moveforget", "0")
    $fish = IniRead("config.ini", "setting", "fish", "0")
    $read = 1
    $move1 = IniRead("config.ini", "setting", "move1", "1")
    $move2 = IniRead("config.ini", "setting", "move2", "0")
    $move3 = IniRead("config.ini", "setting", "move3", "0")
    $move4 = IniRead("config.ini", "setting", "move4", "0")
    EndIf
    
    $info4 = "Number of Pokemon fought: "&$totalcount
    If Not WinExists("[CLASS:LWJGL]") Then
    $info1 = "Window not found, waiting for game."
    GUICtrlSetData($Label1, $info1)
    Sleep(50)
    Return 1
    EndIf
    If WinActive("[CLASS:LWJGL]") Then
    $pos = WinGetPos("[CLASS:LWJGL]")
    $info1 = "Window found, focus OK."
    WinMove("[CLASS:LWJGL]", "", $pos[0], $pos[1], 1032, 795)
    GUICtrlSetData($Label1, $info1)
    Sleep(50)
    Return 2
    EndIf
    WinActivate("[CLASS:LWJGL]")
    $info1 = "Window found, waiting for game focus."
    GUICtrlSetData($Label1, $info1)
    Sleep(50)
    Return 1
    EndFunc   ;==>start
    
    Func _ImageSearchArea($FindImage, $ResultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $Tolerance)
    If $Tolerance > 0 Then $FindImage = "*" & $Tolerance & " " & $FindImage
    
    If  @autoItX64 Then
    $Result = DllCall("ImageSearchDLL_x64.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $FindImage)
    Else
    $Result = DllCall("ImageSearchDLL.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $FindImage)
    EndIf
    
    If $Result = "0" Then Return 0
    
    $Array = StringSplit($Result[0], "|")
    
    If (UBound($Array) >= 4) Then
    $x = Int(Number($Array[2]))
    $y = Int(Number($Array[3]))
    
    If $ResultPosition = 1 Then
    $x = $x + Int(Number($Array[4]) / 2)
    $y = $y + Int(Number($Array[5]) / 2)
    EndIf
    Return 1
    EndIf
    EndFunc   ;==>_ImageSearchArea
    
    Func TogglePause()
    While 1
    $info1 = "PAUSED PRESS F8 TO RESUME / F9 TO QUIT"
    GUICtrlSetData($Label1, $info1)
    Sleep(100)
    If _IsPressed("77", $dll) Then
    Return 1
    EndIf
    WEnd
    EndFunc   ;==>TogglePause
    
    Func quit()
    Sleep(100)
    Exit
    EndFunc   ;==>TogglePause
    
    Func setting()
    #region ### START Koda GUI section ### Form=C:\Documents and Settings\Administrator\Desktop\pokemmo bot\koda\Forms\Form1.kxf
    $Form1 = GUICreate("UglyBot Setting", 466, 294, 287, 138)
    $Label1 = GUICtrlCreateLabel("Auto Login", 16, 8, 55, 17)
    $Label2 = GUICtrlCreateLabel("Username", 16, 36, 52, 17)
    $Label3 = GUICtrlCreateLabel("Password", 16, 63, 50, 17)
    $Label4 = GUICtrlCreateLabel("Debug Mode", 16, 91, 66, 17)
    $Label5 = GUICtrlCreateLabel("Training", 16, 118, 42, 17)
    $Label6 = GUICtrlCreateLabel("Walking type", 16, 146, 66, 17)
    $Label7 = GUICtrlCreateLabel("Walking time (ms)", 16, 173, 85, 17)
    $Label8 = GUICtrlCreateLabel("Button A", 16, 201, 45, 17)
    $Label9 = GUICtrlCreateLabel("Button B", 16, 228, 45, 17)
    $Button1 = GUICtrlCreateButton("Save and start", 16, 256, 89, 25)
    $Checkbox1 = GUICtrlCreateCheckbox("", 104, 8, 97, 17)
    $Checkbox2 = GUICtrlCreateCheckbox("", 104, 89, 17, 17)
    $Radio1 = GUICtrlCreateRadio("Square", 104, 143, 113, 17)
    $Radio2 = GUICtrlCreateRadio("Left/Right", 224, 144, 113, 17)
    $Radio3 = GUICtrlCreateRadio("Up/Down", 344, 144, 113, 17)
    $Input3 = GUICtrlCreateInput("500", 104, 170, 121, 21)
    $Input4 = GUICtrlCreateInput("Z", 104, 197, 121, 21)
    $Input5 = GUICtrlCreateInput("X", 104, 224, 121, 21)
    $Checkbox3 = GUICtrlCreateCheckbox("", 104, 116, 17, 17)
    $Checkbox4 = GUICtrlCreateCheckbox("Forget new Moves", 144, 116, 107, 17)
    $Checkbox5 = GUICtrlCreateCheckbox("FishBot (F5)", 144, 89, 107, 17)
    $Checkbox6 = GUICtrlCreateCheckbox("Move 1", 224, 40, 97, 17)
    $Checkbox8 = GUICtrlCreateCheckbox("Move 3", 224, 64, 97, 17)
    $Checkbox7 = GUICtrlCreateCheckbox("Move 2", 336, 40, 97, 17)
    $Checkbox9 = GUICtrlCreateCheckbox("Move 4", 336, 64, 97, 17)
    $Checkbox10 = GUICtrlCreateCheckbox("Catch new pokemons", 336, 88, 97, 17)
    $Label10 = GUICtrlCreateLabel("Move to use", 224, 16, 79, 17)
    $Button2 = GUICtrlCreateButton("Casino bot", 312, 256, 73, 25)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###
    
    If Not FileExists("config.ini") Then
    IniWrite("config.ini", "setting", "log", "0")
    IniWrite("config.ini", "setting", "user", '"user"')
    IniWrite("config.ini", "setting", "pass", '"pass"')
    IniWrite("config.ini", "setting", "debug", "0")
    IniWrite("config.ini", "setting", "train", "0")
    IniWrite("config.ini", "setting", "square", "1")
    IniWrite("config.ini", "setting", "walktime", "500")
    IniWrite("config.ini", "setting", "abutton", "z")
    IniWrite("config.ini", "setting", "bbutton", "x")
    IniWrite("config.ini", "setting", "moveforget", "0")
    IniWrite("config.ini", "setting", "fish", "0")
    IniWrite("config.ini", "setting", "move1", "1")
    IniWrite("config.ini", "setting", "move2", "0")
    IniWrite("config.ini", "setting", "move3", "0")
    IniWrite("config.ini", "setting", "move4", "0")
    IniWrite("config.ini", "setting", "catch", "0")
    EndIf
    
    
    If IniRead("config.ini", "setting", "log", "0") = 1 Then
    _GUICtrlButton_SetCheck($Checkbox1)
    $Input1 = GUICtrlCreateInput("", 104, 35, 97, 21)
    $Input2 = GUICtrlCreateInput("", 104, 62, 97, 21, $ES_PASSWORD)
    GUICtrlSetData($Input1, IniRead("config.ini", "setting", "user", '"userdefault"'))
    $pass = BinaryToString(IniRead("config.ini", "setting", "pass", '"passdefault"'), 4)
    GUICtrlSetData($Input2, $pass)
    $log = 1
    Else
    $log = 0
    EndIf
    If IniRead("config.ini", "setting", "debug", "0") = 1 Then
    _GUICtrlButton_SetCheck($Checkbox2)
    $debug = 1
    Else
    $debug = 0
    EndIf
    If IniRead("config.ini", "setting", "catch", "0") = 1 Then
    _GUICtrlButton_SetCheck($Checkbox10)
    $catch = 1
    Else
    $catch = 0
    EndIf
    If IniRead("config.ini", "setting", "train", "0") = 1 Then
    _GUICtrlButton_SetCheck($Checkbox3)
    $train = 1
    Else
    $train = 0
    EndIf
    If IniRead("config.ini", "setting", "move1", "0") = 1 Then
    _GUICtrlButton_SetCheck($Checkbox6)
    $move1 = 1
    Else
    $move1 = 0
    EndIf
    If IniRead("config.ini", "setting", "move2", "0") = 1 Then
    _GUICtrlButton_SetCheck($Checkbox7)
    $move2 = 1
    Else
    $move2 = 0
    EndIf
    If IniRead("config.ini", "setting", "move3", "0") = 1 Then
    _GUICtrlButton_SetCheck($Checkbox8)
    $move3 = 1
    Else
    $move3 = 0
    EndIf
    If IniRead("config.ini", "setting", "move4", "0") = 1 Then
    _GUICtrlButton_SetCheck($Checkbox9)
    $move4 = 1
    Else
    $move4 = 0
    EndIf
    If $move1 = 0 And $move2 = 0 And $move3 = 0 And $move4 = 0 Then
    _GUICtrlButton_SetCheck($Checkbox6)
    $move1 = 1
    EndIf
    If IniRead("config.ini", "setting", "square", "1") = 0 Then
    _GUICtrlButton_SetCheck($Radio3)
    _GUICtrlButton_SetCheck($Radio1, $BST_UNCHECKED)
    _GUICtrlButton_SetCheck($Radio2, $BST_UNCHECKED)
    $square = 0
    EndIf
    If IniRead("config.ini", "setting", "square", "1") = 2 Then
    _GUICtrlButton_SetCheck($Radio2)
    _GUICtrlButton_SetCheck($Radio1, $BST_UNCHECKED)
    _GUICtrlButton_SetCheck($Radio3, $BST_UNCHECKED)
    $square = 2
    EndIf
    If IniRead("config.ini", "setting", "square", "1") = 1 Then
    _GUICtrlButton_SetCheck($Radio1)
    _GUICtrlButton_SetCheck($Radio3, $BST_UNCHECKED)
    _GUICtrlButton_SetCheck($Radio2, $BST_UNCHECKED)
    $square = 1
    EndIf
    If Not IniRead("config.ini", "setting", "square", "1") = 1 And Not IniRead("config.ini", "setting", "square", "1") = 0 And Not IniRead("config.ini", "setting", "square", "1") = 2 Then
    _GUICtrlButton_SetCheck($Radio3)
    _GUICtrlButton_SetCheck($Radio1, $BST_UNCHECKED)
    _GUICtrlButton_SetCheck($Radio2, $BST_UNCHECKED)
    $square = 0
    EndIf
    GUICtrlSetData($Input3, IniRead("config.ini", "setting", "walktime", "500"))
    GUICtrlSetData($Input4, IniRead("config.ini", "setting", "abutton", "z"))
    GUICtrlSetData($Input5, IniRead("config.ini", "setting", "bbutton", "x"))
    If IniRead("config.ini", "setting", "moveforget", "1") = 1 Then
    _GUICtrlButton_SetCheck($checkbox4)
    $moveforget = 1
    Else
    $moveforget = 0
    EndIf
    
    If IniRead("config.ini", "setting", "fish", "0") = 1 Then
    _GUICtrlButton_SetCheck($checkbox5)
    $fish = 1
    Else
    $fish = 0
    EndIf
    
    While 1
    $nMsg = GUIGetMsg()
    Sleep(50)
    If $log = 1 Then
    $user = GUICtrlRead($Input1, 1)
    $pass = GUICtrlRead($Input2, 1)
    EndIf
    $walktime = GUICtrlRead($Input3, 1)
    $abutton = GUICtrlRead($Input4, 1)
    $bbutton = GUICtrlRead($Input5, 1)
    If $move1 = 0 And $move2 = 0 And $move3 = 0 And $move4 = 0 Then
    _GUICtrlButton_SetCheck($Checkbox6)
    $move1 = 1
    EndIf
    
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    IniWrite("config.ini", "setting", "log", $log)
    If $log = 1 Then
    IniWrite("config.ini", "setting", "user", $user)
    IniWrite("config.ini", "setting", "pass", StringToBinary($pass, 4))
    EndIf
    IniWrite("config.ini", "setting", "debug", $debug)
    IniWrite("config.ini", "setting", "train", $train)
    IniWrite("config.ini", "setting", "square", $square)
    IniWrite("config.ini", "setting", "walktime", $walktime)
    IniWrite("config.ini", "setting", "abutton", $abutton)
    IniWrite("config.ini", "setting", "bbutton", $bbutton)
    IniWrite("config.ini", "setting", "moveforget", $moveforget)
    IniWrite("config.ini", "setting", "fish", $fish)
    IniWrite("config.ini", "setting", "move1", $move1)
    IniWrite("config.ini", "setting", "move2", $move2)
    IniWrite("config.ini", "setting", "move3", $move3)
    IniWrite("config.ini", "setting", "move4", $move4)
    IniWrite("config.ini", "setting", "catch", $catch)
    GUIDelete($Form1)
    Return 1
    Case $Button2
    	GUIDelete($Form1)
    	$casino = 1
    	Return 1
    
    Case $Checkbox1
    If _GUICtrlButton_GetCheck($Checkbox1) Then
    $log = 1
    $Input1 = GUICtrlCreateInput("", 104, 35, 97, 21)
    $Input2 = GUICtrlCreateInput("", 104, 62, 97, 21, $ES_PASSWORD)
    Else
    $log = 0
    GUICtrlDelete($Input1)
    GUICtrlDelete($Input2)
    EndIf
    Case $Radio1
    If _GUICtrlButton_GetCheck($Radio1) Then
    $square = 1
    _GUICtrlButton_SetCheck($Radio2, $BST_UNCHECKED)
    _GUICtrlButton_SetCheck($Radio3, $BST_UNCHECKED)
    EndIf
    Case $Radio2
    If _GUICtrlButton_GetCheck($Radio2) Then
    $square = 2
    _GUICtrlButton_SetCheck($Radio1, $BST_UNCHECKED)
    _GUICtrlButton_SetCheck($Radio3, $BST_UNCHECKED)
    EndIf
    Case $Radio3
    If _GUICtrlButton_GetCheck($Radio3) Then
    $square = 0
    _GUICtrlButton_SetCheck($Radio1, $BST_UNCHECKED)
    _GUICtrlButton_SetCheck($Radio2, $BST_UNCHECKED)
    EndIf
    Case $Checkbox2
    If _GUICtrlButton_GetCheck($Checkbox2) Then
    $debug = 1
    Else
    $debug = 0
    EndIf
    
    Case $Checkbox3
    If _GUICtrlButton_GetCheck($Checkbox3) Then
    $train = 1
    Else
    $train = 0
    EndIf
    Case $checkbox4
    If _GUICtrlButton_GetCheck($checkbox4) Then
    $moveforget = 1
    Else
    $moveforget = 0
    EndIf
    Case $checkbox5
    If _GUICtrlButton_GetCheck($checkbox5) Then
    $fish = 1
    Else
    $fish = 0
    EndIf
    Case $checkbox6
    If _GUICtrlButton_GetCheck($checkbox6) Then
    $move1 = 1
    Else
    $move1 = 0
    EndIf
    Case $checkbox7
    If _GUICtrlButton_GetCheck($checkbox7) Then
    $move2 = 1
    Else
    $move2 = 0
    EndIf
    Case $checkbox8
    If _GUICtrlButton_GetCheck($checkbox8) Then
    $move3 = 1
    Else
    $move3 = 0
    EndIf
    Case $checkbox9
    If _GUICtrlButton_GetCheck($checkbox9) Then
    $move4 = 1
    Else
    $move4 = 0
    EndIf
    Case $checkbox10
    If _GUICtrlButton_GetCheck($checkbox10) Then
    $catch = 1
    Else
    $catch = 0
    EndIf
    EndSwitch
    WEnd
    
    EndFunc   ;==>setting
    
    Func casinobot()
    WinActivate("[CLASS:LWJGL]")
    $image = PixelSearch(700, 500, 710, 510, 0xE8A800, 1)
    If IsArray($image)Then;in slot
    	$info1 = "Gambling..."
    	GUICtrlSetData($Label1, $info1)
    	Sleep(Random(100,500,1))
    	WinActivate("[CLASS:LWJGL]")
    	Send("{DOWN}")
    	Sleep(Random(100,500,1))
    	WinActivate("[CLASS:LWJGL]")
    	Send("{DOWN}")
    	Sleep(Random(100,500,1))
    	WinActivate("[CLASS:LWJGL]")
    	Send("{DOWN}")
    	Sleep(Random(500,1000,1))
    	WinActivate("[CLASS:LWJGL]")
    	Send("{Z}")
    	Sleep(Random(100,500,1))
    	WinActivate("[CLASS:LWJGL]")
    	Send("{Z}")
    	Sleep(Random(100,500,1))
    	WinActivate("[CLASS:LWJGL]")
    	Send("{Z}")
    	Sleep(Random(100,500,1))
    	WinActivate("[CLASS:LWJGL]")
    	Send("{Z}")
    	Sleep(Random(100,500,1))
    	WinActivate("[CLASS:LWJGL]")
    	Send("{Z}")
    	Sleep(Random(3000,4500,1))
    	Return 1
    Else
    	$info1 = "Go to casino and open menu first"
    	GUICtrlSetData($Label1, $info1)
    	Sleep(500)
    	Return 1
    EndIf
    Return 1
    EndFunc
    
    
    Func fishbot()
    $change = 0
    If $count = 20 Then
    $hurt = 1
    $count = 0
    EndIf
    
    $image = PixelSearch(500, 170, 510, 180, 0xE08098, 1)
    $image2 = PixelSearch(500, 165, 510, 180, 0xD06878, 1)
    If $hurt = 1 Then
    If IsArray($image) Or IsArray($image2) Then
    Send("{UP up}")
    Sleep(2000)
    Send($abutton);talk nurse
    Sleep(2000)
    Send($abutton); say hi
    Sleep(2000)
    Send($abutton);heal
    Sleep(2000)
    Send($abutton);waiting
    Sleep(2000)
    Send($bbutton);thanks
    Sleep(2000)
    Send($bbutton);bye
    Sleep(2000)
    Send($bbutton);yeah love you too
    Sleep(2000)
    Send($bbutton);stop talking to me psycho
    Sleep(2000)
    Send($bbutton);im gonna call your manager!
    Sleep(2000)
    $hurt = 0
    Return 1
    EndIf
    EndIf
    
    
    $image = PixelSearch(500, 410, 510, 420, 0x4878D8, 1)
    If IsArray($image) And $hurt = 0 Then
    Send("{DOWN up}")
    Sleep(500)
    Send("{DOWN}");make sure you look ok
    Sleep(50)
    Send($canebutton);see water
    $something = 0
    Sleep(5000)
    Send($abutton);somenthing?
    Sleep(500)
    Send("{DOWN}")
    $something = 1
    Return 1
    EndIf
    
    If $hurt = 1 Then
    Send("{UP down}")
    Return 1
    EndIf
    
    If $hurt = 0 Then
    Send("{DOWN down}")
    Return 1
    EndIf
    Return 1
    EndFunc
    Attached Thumbnails Attached Thumbnails
    ub02.png  

    <b>Downloadable Files</b> Downloadable Files
    Last edited by franklin01; 12-11-2013 at 02:42 PM.

  10. The Following 15 Users Say Thank You to franklin01 For This Useful Post:

    andijama (01-13-2014),atuladaokhach (12-01-2014),brandonjw12345 (01-16-2016),Haruninho (12-10-2014),hujakt78 (12-12-2013),junkess (12-17-2014),ladronesss (10-21-2020),Lightell (12-11-2013),limkangxian1999 (01-01-2015),Mureffes (03-29-2014),mushssg (01-10-2019),pokemmotest (09-11-2018),Riki_chu (07-16-2020),teddys2 (09-09-2018),wallblack (01-03-2014)

  11. #8
    Austin's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Great White North
    Posts
    30,484
    Reputation
    6104
    Thanks
    8,326
    My Mood
    Lurking
    approved .




    VIP Support // May 2011
    CF Minion // January 2012
    Newsforce // August 2012
    Minion+ // March 2013
    Moderator // August 2014
    Former Staff // January 2015
    General Minion // July 2015
    Publicist // December 2015





  12. #9
    hujakt78's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0
    My Mood
    Cold
    No matter whats is first or second pokemon, at battle start it always select second, if second dead, then select others. If this is function, for training two, then selecting on GUI would be perfect to train One or Two pokemons.
    Fishbot dont work with catch mode, its just trying to go down after pokecenter.
    And when launching bot, it say that move.png is missing.

    Getting error and then bot stop. Its happen after some time in fights (testes with Pikachu, Nidorino, Gloom,) and if using only Training, without Catch mode, then everything okey.
    I cant post link, so this is what it write:

    AutoIT Error

    Line 7558 (File "C:\ZmogelisA\Desktop\uglybot sourcev0.2_mpgh.net\uglybot sourcev0.2.exe"):


    Error: Array variable has incorrected number of subscripts or subscript dimension range exeeded.

  13. #10
    franklin01's Avatar
    Join Date
    May 2013
    Gender
    male
    Posts
    27
    Reputation
    10
    Thanks
    198
    Thanks for the report I will check that.
    I will update module for training and pokemon selection when dead.

    Fishbot is supposed to go down after pokemon center and find water to use the rod. If there is no water under it it will fail.

    Error are known and are already fixed in 0.3 that will be released when enough work has been done.

  14. #11
    christianjsp's Avatar
    Join Date
    Mar 2013
    Gender
    male
    Location
    In Your Heart
    Posts
    20
    Reputation
    10
    Thanks
    1
    My Mood
    Yeehaw
    Quote Originally Posted by hujakt78 View Post
    No matter whats is first or second pokemon, at battle start it always select second, if second dead, then select others. If this is function, for training two, then selecting on GUI would be perfect to train One or Two pokemons.
    Fishbot dont work with catch mode, its just trying to go down after pokecenter.
    And when launching bot, it say that move.png is missing.

    Getting error and then bot stop. Its happen after some time in fights (testes with Pikachu, Nidorino, Gloom,) and if using only Training, without Catch mode, then everything okey.
    I cant post link, so this is what it write:

    AutoIT Error

    Line 7558 (File "C:\ZmogelisA\Desktop\uglybot sourcev0.2_mpgh.net\uglybot sourcev0.2.exe"):


    Error: Array variable has incorrected number of subscripts or subscript dimension range exeeded.
    me too.
    I got error same like you.

  15. #12
    franklin01's Avatar
    Join Date
    May 2013
    Gender
    male
    Posts
    27
    Reputation
    10
    Thanks
    198

    UglyBot 0.3.2 + source

    !!! Does anyone uses this thing or should I stop? !!!

    UglyBot Update 0.3.2:

    Changelog v0.3:
    Code:
    *fixed death detection
    *fixed pp detection
    *enable pokecenter detection + waypoint test
    *small fixes
    Note:
    Waypoint and offscreen are in test but not finished.
    Offscreen moves enables extended screen and move the window to the extended screen.
    Waypoint uses waypoint.txt file to go from the outside of the pokemon center to your farm zone. Current wp is set for Pewter City.
    Steps are processed so you have to disable autorun or it will be offroad.
    Coding is autoit so be smart.

    Virus scan:
    Code:
    https://www.virustotal.com/fr/file/9b7ef4ea6721c823839dcd7009532cbc8e81086abfeb27d9ea7cb8ee38c5a1d7/analysis/1387540151/
    https://r.virscan.org/report/9bc5a4ded0f7c6374db4e9d1f39b1919.html
    Source:
    Code:
    ; note: can be improved, if so please share with the comunity
    ; If you want to support you can throw a penny here.
    ; LTC: LfHAabU9Lqzn6sgdYcfoLZFoZjf36PW3rf
    ; NMC: N7P667yC5aMTUFb4h7S1UVbMzvvmfZsXjw
    
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Misc.au3>
    #include <Array.au3>
    #include <File.au3>
    #include <GDIPlus.au3>
    #include <ScreenCapture.au3>
    #include <WinAPI.au3>
    #include <ScrollBarConstants.au3>
    #include <WindowsConstants.au3>
    #include <GuiComboBox.au3>
    #include <GuiListBox.au3>
    #include <GuiButton.au3>
    #include <EditConstants.au3>
    #include <ButtonConstants.au3>
    #include <Math.au3>
    #include <GuiListBox.au3>
    
    Opt("WinTitleMatchMode", 1)
    Opt("PixelCoordMode", 2)
    Opt("MouseCoordMode", 2)
    
    If Not FileExists("ImageSearchDLL.dll") Then
    MsgBox(4096,"", "ImageSearchDLL.dll not found, some features will not be available.", 10)
    EndIf
    If Not FileExists("ImageSearchDLL_x64.dll") Then
    MsgBox(4096,"", "ImageSearchDLL_x64.dll not found, some features will not be available.", 10)
    EndIf
    If Not FileExists("pp.png") Then
    MsgBox(4096,"", "pp.png not found, some features will not be available.", 10)
    EndIf
    If Not FileExists("pp2.png") Then
    MsgBox(4096,"", "pp2.png not found, some features will not be available.", 10)
    EndIf
    If Not FileExists("move.wav") Then
    MsgBox(4096,"", "move.wav not found, some features will not be available.", 10)
    EndIf
    If Not FileExists("config.ini") Then
    MsgBox(4096,"", "config.ini not found, creating a new one.", 10)
    EndIf
    If Not FileExists("hp.png") Then
    MsgBox(4096,"", "hp.png not found, some features will not be available.", 10)
    EndIf
    
    
    
    Dim $casino = 0
    Dim $abutton
    Dim $bbutton
    Dim $square
    Dim $walktime
    Dim $pokecenter = 0
    Dim $walked = 0
    Dim $moveforget
    Dim $catch = 0
    Dim $waypoint = 1
    Dim $catched = 1
    Dim $job
    Dim $pp1 = 1
    Dim $pp2 = 1
    Dim $pp3 = 1
    Dim $pp4 = 1
    Dim $align = 0
    Dim $Label1
    Dim $check = 0
    Dim $e = -1
    Dim $selectedatk[10]
    Dim $pp = 1
    Dim $Label2
    Dim $Label3
    Dim $Label4
    Dim $read = 0
    Dim $fish
    Dim $hurt = 1
    Dim $canebutton = "{F5}"
    Dim $Label5
    dim $atk
    Dim $totalcount = 0
    Dim $count = 0
    Dim $something = 0
    Dim $move1
    Dim $move2
    Dim $move3
    Dim $move4
    Dim $info1
    Dim $info2
    Dim $info3
    Dim $info4 = "Press [Pause] to pause / F11 to resume / F12 to quit"
    Dim $info5 = "Debug enabled"
    Dim $image
    Dim $image2
    Dim $pos
    Dim $walk = 0
    Dim $log
    Dim $dll = DllOpen("user32.dll")
    Global $x, $y, $image
    Dim $user
    Dim $pass
    Dim $debug
    Dim $change = 0
    Dim $train
    Dim $iIndex2
    Dim $iIndex
    Dim $offscreen = 0
    
    $job = setting()
    
    HotKeySet("{F7}", "TogglePause")
    HotKeySet("{F9}", "quit")
    
    If $debug = 1 Then
    GUICreate("uglybot", 225, 300, 20, 0, BitOR($WS_BORDER, $WS_POPUP), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
    $Label5 = GUICtrlCreateList("debug menu", 0, 96, 112, 200, BitOR($WS_BORDER, $WS_VSCROLL))
    $Label6 = GUICtrlCreateList("debug menu", 112, 96, 113, 200, BitOR($WS_BORDER, $WS_VSCROLL))
    
    GUICtrlSetLimit(-1, 200)
    Else
    GUICreate("uglybot", 225, 100, 20, 0, BitOR($WS_BORDER, $WS_POPUP), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
    EndIf
    
    $Label1 = GUICtrlCreateLabel("Label1", 0, 0, 225, 25)
    $Label2 = GUICtrlCreateLabel("Label2", 0, 24, 225, 25)
    $Label3 = GUICtrlCreateLabel("Label3", 0, 48, 225, 25)
    $Label4 = GUICtrlCreateLabel("Label3", 0, 72, 225, 25)
    
    GUISetState()
    
    While 1;100ms(50)
    ;~ 	Sleep(100)
    Sleep(50)
    $info2 = "RUNNING PRESS F7 TO PAUSE / F9 TO QUIT"
    GUICtrlSetData($Label2, $info2)
    If $debug = 1 Then
    $info5 = "In loop"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    
    GUICtrlSetData($Label1, $info1)
    GUICtrlSetData($Label2, $info2)
    GUICtrlSetData($Label3, $info3)
    GUICtrlSetData($Label4, $info4)
    
    Switch $job
    	Case 1
    		$info3 = "Function start()"
    GUICtrlSetData($Label3, $info3)
    $job = start()
    Case 2
    	$info3 = "Function state()"
    GUICtrlSetData($Label3, $info3)
    $job = state()
    Case 3
    	$info3 = "Function fight()"
    GUICtrlSetData($Label3, $info3)
    $job = fight()
    Case 4
    	$info3 = "Function walk()"
    GUICtrlSetData($Label3, $info3)
    $job = walk()
    Case 5
    	$info3 = "Function login()"
    GUICtrlSetData($Label3, $info3)
    $job = login()
    Case 6
    	$info3 = "Function fishbot()"
    GUICtrlSetData($Label3, $info3)
    $job = fishbot()
    Case 7
    	$info3 = "Function casinobot()"
    GUICtrlSetData($Label3, $info3)
    $job = casinobot()
    Case 8
    $job = setting()
    EndSwitch
    WEnd
    
    Func fight();0-100ms 1/20
    $check = $check + 1
    If $debug = 1 Then
    $info5 = "In fight"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    If $something = 1 Then
    $count = $count + 1
    $totalcount = $totalcount + 1
    $something = 0
    EndIf
    ;~ $image = PixelSearch(110, 395, 750, 540, 0x8DC655, 5);greenbar
    ;~ If IsArray($image) Then
    ;~ If $debug = 1 Then
    ;~ $info6 = "Mousclick left - greenbar"
    ;~ _GUICtrlListBox_BeginUpdate($Label6)
    ;~ _GUICtrlListBox_InsertString($Label6, $info6)
    ;~ _GUICtrlListBox_EndUpdate($Label6)
    ;~ $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    ;~ $iIndex = $iIndex + 1
    ;~ _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    ;~ EndIf
    ;~ MouseClick("left", $image[0], $image[1], 1, 0)
    ;~ Sleep(50)
    ;~ If $debug = 1 Then
    ;~ $info6 = "B button sent"
    ;~ _GUICtrlListBox_BeginUpdate($Label6)
    ;~ _GUICtrlListBox_InsertString($Label6, $info6)
    ;~ _GUICtrlListBox_EndUpdate($Label6)
    ;~ $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    ;~ $iIndex = $iIndex + 1
    ;~ _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    ;~ EndIf
    ;~ Send($bbutton)
    ;~ Sleep(50)
    ;~ Return 1
    ;~ EndIf
    
    	$image = _ImageSearchArea('hp.png', 1, $pos[0]+129, $pos[1]+456, $pos[0]+756, $pos[1]+556, $x, $y, 80)
    	If $image = 1 Then;50ms
    	$info3 = "Warning one guy died"
    	GUICtrlSetData($Label3, $info3)
    		Sleep(50)
    		$image = _ImageSearchArea('hp.png', 1, $pos[0]+129, $pos[1]+456, $pos[0]+336, $pos[1]+504, $x, $y, 80)
    		If $image = 1 Then
    ;~ 			$poke1 = 0
    		Else
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{UP}")
    			Sleep(50)
    			Send($abutton)
    			Sleep(50)
    			Send($bbutton)
    			Return 1
    		EndIf
    		$image = _ImageSearchArea('hp.png', 1, $pos[0]+337, $pos[1]+456, $pos[0]+544, $pos[1]+504, $x, $y, 80)
    		If $image = 1 Then
    ;~ 			$poke2 = 0
    		Else
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{RIGHT}")
    			Sleep(50)
    			Send("{UP}")
    			Sleep(50)
    			Send($abutton)
    			Sleep(50)
    			Send($bbutton)
    			Return 1
    		EndIf
    		$image = _ImageSearchArea('hp.png', 1, $pos[0]+551, $pos[1]+456, $pos[0]+754, $pos[1]+504, $x, $y, 80)
    		If $image = 1 Then
    ;~ 			$poke3 = 0
    		Else
    			Sleep(50)
    			Send("{RIGHT}")
    			Sleep(50)
    			Send("{RIGHT}")
    			Sleep(50)
    			Send("{UP}")
    			Sleep(50)
    			Send($abutton)
    			Sleep(50)
    			Send($bbutton)
    			Return 1
    		EndIf
    		$image = _ImageSearchArea('hp.png', 1, $pos[0]+129, $pos[1]+511, $pos[0]+336, $pos[1]+554, $x, $y, 80)
    		If $image = 1 Then
    ;~ 			$poke4 = 0
    		Else
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{DOWN}")
    			Sleep(50)
    			Send($abutton)
    			Sleep(50)
    			Send($bbutton)
    			Return 1
    		EndIf
    		$image = _ImageSearchArea('hp.png', 1, $pos[0]+337, $pos[1]+511, $pos[0]+544, $pos[1]+554, $x, $y, 80)
    		If $image = 1 Then
    ;~ 			$poke5 = 0
    		Else
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{RIGHT}")
    			Sleep(50)
    			Send("{DOWN}")
    			Sleep(50)
    			Send($abutton)
    			Sleep(50)
    			Send($bbutton)
    			Return 1
    		EndIf
    		$image = _ImageSearchArea('hp.png', 1, $pos[0]+551, $pos[1]+511, $pos[0]+754, $pos[1]+554, $x, $y, 80)
    		If $image = 1 Then
    ;~ 			$poke6 = 0
    		Else
    			Sleep(50)
    			Send("{RIGHT}")
    			Sleep(50)
    			Send("{RIGHT}")
    			Sleep(50)
    			Send("{DOWN}")
    			Sleep(50)
    			Send($abutton)
    			Sleep(50)
    			Send($bbutton)
    			Return 1
    		EndIf
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{UP}")
    			Sleep(50)
    			Send($abutton)
    			Send($bbutton)
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{RIGHT}")
    			Sleep(50)
    			Send("{UP}")
    			Sleep(50)
    			Send($abutton)
    			Send($bbutton)
    			Sleep(50)
    			Send("{RIGHT}")
    			Sleep(50)
    			Send("{RIGHT}")
    			Sleep(50)
    			Send("{UP}")
    			Sleep(50)
    			Send($abutton)
    			Send($bbutton)
    			Sleep(50)
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{DOWN}")
    			Sleep(50)
    			Send($abutton)
    			Send($bbutton)
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{LEFT}")
    			Sleep(50)
    			Send("{RIGHT}")
    			Sleep(50)
    			Send("{DOWN}")
    			Sleep(50)
    			Send($abutton)
    			Send($bbutton)
    			Sleep(50)
    			Send("{RIGHT}")
    			Sleep(50)
    			Send("{RIGHT}")
    			Sleep(50)
    			Send("{DOWN}")
    			Sleep(50)
    			Send($abutton)
    			Send($bbutton)
    			Sleep(50)
    		Return 1
    	EndIf
    
    
    
    $image = PixelSearch(110, 395, 540, 540, 0xCFA806, 5);orange
    If IsArray($image) Then
    Sleep(50)
    If $debug = 1 Then
    $info6 = "B button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send($bbutton)
    If $catch = 1 Then
    	$catched = 0
    	$i = 0
    	While $i < 3
    	Sleep(50)
    	$image = PixelSearch(160, 105, 400, 115, 0xA80000, 5);redpokeball
    	$i = $i + 1
    	If IsArray($image) Then
    	$catched = 1
    	EndIf
    	WEnd
    	If $catched = 0 Then
    		Sleep(50)
    		If $debug = 1 Then
    $info6 = "Right stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    		Send("{RIGHT}")
    		Sleep(50)
    		If $debug = 1 Then
    $info6 = "Up stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    		Send("{UP}")
    		Sleep(50)
    		If $debug = 1 Then
    $info6 = "A button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    		Send($abutton)
    		Sleep(50)
    		If $debug = 1 Then
    $info6 = "Right stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    		Send("{RIGHT}")
    		Sleep(50)
    		If $debug = 1 Then
    $info6 = "Right stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    		Send("{RIGHT}")
    		Sleep(50)
    		$i = 0
    		While $i < 3
    			Sleep(50)
    		$image = PixelSearch(117, 443, 459, 474, 0xCFA806, 5);orange
    		$i = $i + 1
    		If IsArray($image) Then
    			If $debug = 1 Then
    $info6 = "A button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    			Send($abutton)
    			Sleep(500)
    			Return 1
    		Else;no balls
    		$catch = 0
    		Sleep(50)
    		If $debug = 1 Then
    $info6 = "B button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    		Send($bbutton)
    		Sleep(50)
    		Return 1
    		EndIf
    		WEnd
    	EndIf
    	EndIf
    	If $train = 1 And $change = 0 Then
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "Left stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send("{LEFT}")
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "Left stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send("{LEFT}")
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "Down stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send("{DOWN}")
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "Down stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send("{DOWN}")
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "A button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send($abutton)
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "Right stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send("{RIGHT}")
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "A button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send($abutton)
    	Sleep(500)
    	$change = 1
    	Else
    	$info3 = "Attacking."
    	GUICtrlSetData($Label3, $info3)
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "Left stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send("{LEFT}")
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "Left stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send("{LEFT}")
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "Up stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send("{UP}")
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "Up stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send("{UP}")
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "A button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send($abutton)
    	Sleep(50)
    	$pp1 = 1
    	$pp2 = 1
    	$pp3 = 1
    	$pp4 = 1
    	$i = 0
    	While $i < 3
    	$info3 = "Got PP?"
    	GUICtrlSetData($Label3, $info3)
    	Sleep(50)
    	$i = $i + 1
    	$image2 = _ImageSearchArea('pp2.png', 1, $pos[0]+122, $pos[1]+453, $pos[0]+227, $pos[1]+501, $x, $y, 80)
    	$image = _ImageSearchArea('pp.png', 1, $pos[0]+122, $pos[1]+453, $pos[0]+227, $pos[1]+501, $x, $y, 80)
    	If $image = 1 Or $image2 = 1 Then
    	$info3 = "Warning no PP"
    	GUICtrlSetData($Label3, $info3)
    	$pp1 = 0
    	EndIf
    
    	$image2 = _ImageSearchArea('pp2.png', 1, $pos[0] + 335, $pos[1] + 454, $pos[0] + 437, $pos[1] + 496, $x, $y, 80)
    	$image = _ImageSearchArea('pp.png', 1, $pos[0] + 335, $pos[1] + 454, $pos[0] + 437, $pos[1] + 496, $x, $y, 80)
    	If $image = 1 Or $image2 = 1 Then
    	$info3 = "Warning no PP"
    	GUICtrlSetData($Label3, $info3)
    	$pp2 = 0
    	EndIf
    
    	$image2 = _ImageSearchArea('pp2.png', 1, $pos[0] + 125, $pos[1] + 507, $pos[0] + 220, $pos[1] + 555, $x, $y, 80)
    	$image = _ImageSearchArea('pp.png', 1, $pos[0] + 125, $pos[1] + 507, $pos[0] + 220, $pos[1] + 555, $x, $y, 80)
    	If $image = 1 Or $image2 = 1 Then
    	$info3 = "Warning no PP"
    	GUICtrlSetData($Label3, $info3)
    	$pp3 = 0
    	EndIf
    
    	$image2 = _ImageSearchArea('pp2.png', 1, $pos[0] + 336, $pos[1] + 509, $pos[0] + 440, $pos[1] + 555, $x, $y, 80)
    	$image = _ImageSearchArea('pp.png', 1, $pos[0] + 336, $pos[1] + 509, $pos[0] + 440, $pos[1] + 555, $x, $y, 80)
    	If $image = 1 Or $image2 = 1 Then
    	$info3 = "Warning no PP"
    	GUICtrlSetData($Label3, $info3)
    	$pp4 = 0
    	EndIf
    
    	WEnd
    	Dim $selectedatk[10]
    	$e = -1
    
    	If $move1 = 1  And $pp1 = 1 Then
    	$e = $e+1
    	$selectedatk[$e] = "$move1"
    	EndIf
    	If $move2 = 1  And $pp2 = 1 Then
    	$e = $e+1
    	$selectedatk[$e] = "$move2"
    	EndIf
    	If $move3 = 1  And $pp3 = 1 Then
    	$e = $e+1
    	$selectedatk[$e] = "$move3"
    	EndIf
    	If $move4 = 1  And $pp4 = 1 Then
    	$e = $e+1
    	$selectedatk[$e] = "$move4"
    	EndIf
    
    	If $e = -1 Then
    		$e = $e+1
    		$selectedatk[$e] = "$move4"
    		$e = $e+1
    		$selectedatk[$e] = "$move3"
    		$e = $e+1
    		$selectedatk[$e] = "$move2"
    		$e = $e+1
    		$selectedatk[$e] = "$move1"
    	EndIf
    
    
    	$nothing = ""
    	$empty = _ArraySearch($selectedatk, $nothing)
    
    	If $empty > 0 Then
    	_ArrayDelete($selectedatk, $empty)
    	$empty = _ArraySearch($selectedatk, $nothing)
    	EndIf
    	If $empty > 0 Then
    	_ArrayDelete($selectedatk, $empty)
    	$empty = _ArraySearch($selectedatk, $nothing)
    	EndIf
    	If $empty > 0 Then
    	_ArrayDelete($selectedatk, $empty)
    	$empty = _ArraySearch($selectedatk, $nothing)
    	EndIf
    	If $empty > 0 Then
    	_ArrayDelete($selectedatk, $empty)
    	$empty = _ArraySearch($selectedatk, $nothing)
    	EndIf
    
    	$pick = Random(0,$e, 1)
    
    	$e = -1
    	If $selectedatk[$pick] = "$move1" Then
    		If $debug = 1 Then
    $info6 = "Left stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send("{LEFT}")
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "Up stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send("{UP}")
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "A button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send($abutton)
    	Sleep(50)
    	Return 1
    	EndIf
    	If $selectedatk[$pick] = "$move2" Then
    		If $debug = 1 Then
    $info6 = "Right stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send("{RIGHT}")
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "Up stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send("{UP}")
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "A button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send($abutton)
    	Sleep(50)
    	Return 1
    	EndIf
    	If $selectedatk[$pick] = "$move3" Then
    		If $debug = 1 Then
    $info6 = "Left stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send("{LEFT}")
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "Down stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send("{DOWN}")
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "A button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send($abutton)
    	Sleep(50)
    	Return 1
    	EndIf
    	If $selectedatk[$pick] = "$move4" Then
    		If $debug = 1 Then
    $info6 = "Right stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send("{RIGHT}")
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "Down stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send("{DOWN}")
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "A button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send($abutton)
    	Sleep(50)
    	Return 1
    	EndIf
    
    	EndIf
    	Return 1
    	EndIf
    	$image = PixelSearch(875, 515, 895, 535, 0xFFFFFF, 5);fleche blanche
    	If IsArray($image) Then
    	$info3 = "Input needed."
    	GUICtrlSetData($Label3, $info3)
    	Sleep(50)
    	If $debug = 1 Then
    $info6 = "B button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send($bbutton)
    	Sleep(50)
    	Return 1
    	EndIf
    
    If $check > 20 Then;100ms  1/20
    	Sleep(50)
    	If $debug = 1 Then
    		$info6 = "Right stick"
    		_GUICtrlListBox_BeginUpdate($Label6)
    		_GUICtrlListBox_InsertString($Label6, $info6)
    		_GUICtrlListBox_EndUpdate($Label6)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label6)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($Label6, $iIndex)
    	EndIf
    	Send("{RIGHT}");juste au cas ou on perde le focus
    	Sleep(50)
    	$check = 0
    EndIf
    
    
    	$image = PixelSearch(780, 430, 800, 450, 0x839299, 5);b de move
    	If IsArray($image) Then
    		If $moveforget = 1 Then
    			$info3 = "Move detected"
    			GUICtrlSetData($Label3, $info3)
    			Sleep(50)
    			MouseClick("left", $image[0], $image[1], 1, 0)
    			Sleep(50)
    			MouseClick("left", 509, 377, 1, 0)
    			Sleep(50)
    			Return 1
    		Else
    			SoundPlay("move.wav", 1)
    			Sleep(500)
    			Return 1
    		EndIf
    	EndIf
    	Return 1
    EndFunc   ;==>fight
    
    Func walk();0
    	If $debug = 1 Then
    		$info5 = "In walk"
    		_GUICtrlListBox_BeginUpdate($Label5)
    		_GUICtrlListBox_InsertString($Label5, $info5)
    		_GUICtrlListBox_EndUpdate($Label5)
    		$iIndex = _GUICtrlListBox_GetCurSel($Label5)
    		$iIndex = $iIndex + 1
    		_GUICtrlListBox_SetCurSel($Label5, $iIndex)
    	EndIf
    	if $waypoint = 1 Then
    		Sleep(100)
    		$image = _ImageSearchArea('poke.png', 1, $pos[0], $pos[1], $pos[2], $pos[3], $x, $y, 55)
    			If $image = 1 Then;in pc but where?
    			$pokecenter = 1;set waypoint for after pokecenter
    			if $align = 0 Then
    				If $x < $pos[0]+490 Then;perso a droite donc send gauche
    					Sleep(100)
    					Send("{LEFT down}")
    					Sleep(100)
    					Send("{LEFT up}")
    					Sleep(100)
    					Return 1
    				EndIf
    				If $x > $pos[0]+550 Then;perso a gauche donc send droite
    					Sleep(100)
    					Send("{RIGHT down}")
    					Sleep(100)
    					Send("{RIGHT up}")
    					Sleep(100)
    					Return 1
    				EndIf
    				If $y < $pos[1]+275 Then;perso en bas donc send haut
    					Sleep(100)
    					Send("{UP down}")
    					Sleep(100)
    					Send("{UP up}")
    					Sleep(100)
    					Return 1
    				EndIf
    				If $y > $pos[1]+310 Then;perso en haut (wtf?) donc send bas
    					Sleep(100)
    					Send("{DOWN down}")
    					Sleep(100)
    					Send("{DOWN up}")
    					Sleep(100)
    					Return 1
    				EndIf
    				;sinon on est aligné tout va bien on sort
    				$align = 1
    			EndIf
    ;~ 			Sleep(100)
    			Send("{DOWN down}")
    			Sleep(300)
    			Send("{DOWN up}")
    ;~ 			Sleep(500)
    			Return 1
    		EndIf; on est dehors
    		$align = 0
    		;some kind of read waypoint file
    		;wp for pc2
    			If $pokecenter = 1 Then;here is wp 1  for pc2 if so can there be others
    			Send("{DOWN down}");first step is to exit PC
    			Sleep(250)
    			Send("{DOWN up}")
    			Sleep(2000);then wait for load
    ;~ 			$file = FileOpen("waypoint.txt", 0)
    Sleep(250)
    $File = @sCripTDir & '\waypoint.txt'
    Run @autoItExe & ' /AutoIt3ExecuteScript ' & FileGetShortName($File))
    Sleep(250)
    
    ;~ 			Send("{DOWN down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{DOWN up}")
    ;~ 			Send("{DOWN down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{DOWN up}")
    ;~ 			Send("{DOWN down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{DOWN up}")
    ;~ 			Send("{DOWN down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{DOWN up}")
    ;~ 			Send("{DOWN down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{DOWN up}")
    ;~ 			Send("{DOWN down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{DOWN up}")
    ;~ 			Send("{DOWN down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{DOWN up}")
    ;~ 			Send("{DOWN down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{DOWN up}")
    ;~ 			Send("{DOWN down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{DOWN up}")
    ;~ 			Send("{RIGHT down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{RIGHT up}")
    ;~ 			Send("{RIGHT down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{RIGHT up}")
    ;~ 			Send("{RIGHT down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{RIGHT up}")
    ;~ 			Send("{RIGHT down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{RIGHT up}")
    ;~ 			Send("{DOWN down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{DOWN up}")
    ;~ 			Send("{DOWN down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{DOWN up}")
    ;~ 			Send("{DOWN down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{DOWN up}")
    ;~ 			Send("{DOWN down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{DOWN up}")
    ;~ 			Send("{DOWN down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{DOWN up}")
    ;~ 			Send("{DOWN down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{DOWN up}")
    ;~ 			Send("{DOWN down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{DOWN up}")
    ;~ 			Send("{DOWN down}")
    ;~ 			Sleep(250)
    ;~ 			Send("{DOWN up}")
    ;~ 			Sleep(250)
    			$pokecenter = 0
    			Return 1
    		EndIf
    	EndIf
    
    $something = 1
    $change = 0
    
    If $square = 1 Then
    If $walk < 1 Then
    	If $walked < $walktime Then
    		$info3 = "Walking down."
    		GUICtrlSetData($Label3, $info3)
    		If $debug = 1 Then
    			$info6 = "Down stick"
    			_GUICtrlListBox_BeginUpdate($Label6)
    			_GUICtrlListBox_InsertString($Label6, $info6)
    			_GUICtrlListBox_EndUpdate($Label6)
    			$iIndex = _GUICtrlListBox_GetCurSel($Label6)
    			$iIndex = $iIndex + 1
    			_GUICtrlListBox_SetCurSel($Label6, $iIndex)
    		EndIf
    		Send("{DOWN down}")
    		Sleep(250)
    		Send("{DOWN up}")
    ;~ 		Sleep(50)
    		$walked = $walked + 1
    		Return 1
    	EndIf
    $walk = 1
    $walked = 0
    Return 1
    EndIf
    If $walk < 2 Then
    	If $walked < $walktime Then
    		$info3 = "Walking left."
    		GUICtrlSetData($Label3, $info3)
    		If $debug = 1 Then
    			$info6 = "Left stick"
    			_GUICtrlListBox_BeginUpdate($Label6)
    			_GUICtrlListBox_InsertString($Label6, $info6)
    			_GUICtrlListBox_EndUpdate($Label6)
    			$iIndex = _GUICtrlListBox_GetCurSel($Label6)
    			$iIndex = $iIndex + 1
    			_GUICtrlListBox_SetCurSel($Label6, $iIndex)
    		EndIf
    		Send("{LEFT down}")
    		Sleep(250)
    		Send("{LEFT up}")
    ;~ 		Sleep(50)
    		$walked = $walked + 1
    		Return 1
    	EndIf
    $walk = 2
    $walked = 0
    Return 1
    EndIf
    If $walk < 3 Then
    	If $walked < $walktime Then
    		$info3 = "Walking up."
    		GUICtrlSetData($Label3, $info3)
    		If $debug = 1 Then
    			$info6 = "Up stick"
    			_GUICtrlListBox_BeginUpdate($Label6)
    			_GUICtrlListBox_InsertString($Label6, $info6)
    			_GUICtrlListBox_EndUpdate($Label6)
    			$iIndex = _GUICtrlListBox_GetCurSel($Label6)
    			$iIndex = $iIndex + 1
    			_GUICtrlListBox_SetCurSel($Label6, $iIndex)
    		EndIf
    		Send("{UP down}")
    		Sleep(250)
    		Send("{UP up}")
    ;~ 		Sleep(50)
    		$walked = $walked + 1
    		Return 1
    	EndIf
    $walk = 3
    $walked = 0
    Return 1
    EndIf
    If $walk < 4 Then
    	If $walked < $walktime Then
    		$info3 = "Walking right."
    		GUICtrlSetData($Label3, $info3)
    		If $debug = 1 Then
    			$info6 = "Right stick"
    			_GUICtrlListBox_BeginUpdate($Label6)
    			_GUICtrlListBox_InsertString($Label6, $info6)
    			_GUICtrlListBox_EndUpdate($Label6)
    			$iIndex = _GUICtrlListBox_GetCurSel($Label6)
    			$iIndex = $iIndex + 1
    			_GUICtrlListBox_SetCurSel($Label6, $iIndex)
    		EndIf
    		Send("{RIGHT down}")
    		Sleep(250)
    		Send("{RIGHT up}")
    ;~ 		Sleep(50)
    		$walked = $walked + 1
    		Return 1
    	EndIf
    $walk = 0
    $walked = 0
    Return 1
    EndIf
    Return 1
    EndIf
    
    If $square = 0 Then
    	If $walk < 1 Then
    		If $walked < $walktime Then
    			$info3 = "Walking down."
    			GUICtrlSetData($Label3, $info3)
    			If $debug = 1 Then
    				$info6 = "Down stick"
    				_GUICtrlListBox_BeginUpdate($Label6)
    				_GUICtrlListBox_InsertString($Label6, $info6)
    				_GUICtrlListBox_EndUpdate($Label6)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label6)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($Label6, $iIndex)
    			EndIf
    			Send("{DOWN down}")
    			Sleep(200)
    			Send("{DOWN up}")
    ;~ 			Sleep(50)
    			$walked = $walked + 1
    			Return 1
    		EndIf
    		$walk = 1
    		$walked = 0
    		Return 1
    	EndIf
    	If $walk < 2 Then
    		If $walked < $walktime Then
    			$info3 = "Walking up."
    			GUICtrlSetData($Label3, $info3)
    			If $debug = 1 Then
    				$info6 = "Up stick"
    				_GUICtrlListBox_BeginUpdate($Label6)
    				_GUICtrlListBox_InsertString($Label6, $info6)
    				_GUICtrlListBox_EndUpdate($Label6)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label6)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($Label6, $iIndex)
    			EndIf
    			Send("{UP down}")
    			Sleep(200)
    			Send("{UP up}")
    ;~ 			Sleep(50)
    			$walked = $walked + 1
    			Return 1
    		EndIf
    		$walk = 0
    		$walked = 0
    		Return 1
    	EndIf
    	Return 1
    EndIf
    
    If $square = 2 Then
    	If $walk < 1 Then
    		If $walked < $walktime Then
    			$info3 = "Walking left."
    			GUICtrlSetData($Label3, $info3)
    			If $debug = 1 Then
    				$info6 = "Left stick"
    				_GUICtrlListBox_BeginUpdate($Label6)
    				_GUICtrlListBox_InsertString($Label6, $info6)
    				_GUICtrlListBox_EndUpdate($Label6)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label6)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($Label6, $iIndex)
    			EndIf
    			Send("{LEFT down}")
    			Sleep(200)
    			Send("{LEFT up}")
    ;~ 			Sleep(50)
    			$walked = $walked + 1
    			Return 1
    		EndIf
    		$walk = 1
    		$walked = 0
    		Return 1
    	EndIf
    
    	If $walk < 2 Then
    		If $walked < $walktime Then
    			$info3 = "Walking right."
    			GUICtrlSetData($Label3, $info3)
    			If $debug = 1 Then
    				$info6 = "Right stick"
    				_GUICtrlListBox_BeginUpdate($Label6)
    				_GUICtrlListBox_InsertString($Label6, $info6)
    				_GUICtrlListBox_EndUpdate($Label6)
    				$iIndex = _GUICtrlListBox_GetCurSel($Label6)
    				$iIndex = $iIndex + 1
    				_GUICtrlListBox_SetCurSel($Label6, $iIndex)
    			EndIf
    			Send("{RIGHT down}")
    			Sleep(200)
    			Send("{RIGHT up}")
    ;~ 			Sleep(50)
    			$walked = $walked + 1
    			Return 1
    		EndIf
    		$walk = 0
    		$walked = 0
    		Return 1
    	EndIf
    	Return 1
    EndIf
    Return 1
    EndFunc   ;==>walk
    
    Func login();
    If $debug = 1 Then
    $info5 = "In login"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    If $log = 1 Then
    $info3 = "Loggin in..."
    GUICtrlSetData($Label3, $info3)
    Sleep(500)
    If $debug = 1 Then
    $info6 = "Mouseclick - login input"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    MouseClick("left", 582, 351, 2, 0);login
    Sleep(50)
    If $debug = 1 Then
    $info6 = "Backspace sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send("{BS down}")
    Sleep(1700)
    Send("{BS up}")
    Sleep(50)
    If $debug = 1 Then
    $info6 = "Delete sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send("{DEL down}")
    Sleep(1700)
    Send("{DEL up}")
    Sleep(50)
    If $debug = 1 Then
    $info6 = "Username sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send($user)
    Sleep(50)
    If $debug = 1 Then
    $info6 = "Tabulation sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send("{TAB}")
    Sleep(50)
    If $debug = 1 Then
    $info6 = "Backspace sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send("{BS down}")
    Sleep(1500)
    Send("{BS up}")
    Sleep(50)
    If $debug = 1 Then
    $info6 = "Delete sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send("{DEL down}")
    Sleep(1500)
    Send("{DEL up}")
    Sleep(50)
    If $debug = 1 Then
    $info6 = "Password sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send($pass)
    Sleep(50)
    If $debug = 1 Then
    $info6 = "Enter sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send("{ENTER}")
    Sleep(3000)
    If $debug = 1 Then
    $info6 = "Enter sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send("{ENTER}")
    Sleep(3000)
    If $debug = 1 Then
    $info6 = "Enter sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send("{ENTER}")
    Sleep(3000)
    $info3 = "Logged in."
    GUICtrlSetData($Label3, $info3)
    Return 1;start
    Else
    $info3 = "Autologin not enabled, please login."
    GUICtrlSetData($Label3, $info3)
    Return 1;start
    EndIf
    EndFunc   ;==>login
    
    Func state();50ms + 50 (0)
    If WinGetPos("uglybot", "") <> WinGetPos("[CLASS:LWJGL]") Then
    	WinMove("uglybot", "", $pos[0]-225, $pos[1])
    EndIf
    
    If $debug = 1 Then
    $info5 = "In state"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    $image = PixelSearch(503, 715, 515, 720, 0x242C31, 1)
    If IsArray($image) And $catch = 1 And $casino = 0 Then;500 only 1
    Send("{F12}")
    Sleep(500)
    Return 1
    EndIf
    
    $image = PixelSearch(200, 400, 700, 420, 0x1D415D, 3);bleu fight 50ms
    If IsArray($image) Then
    ;~ Sleep(50)
    Return 3
    EndIf
    $image = PixelSearch(500, 85, 520, 95, 0xF3EA6D, 3);login mmo 50ms
    If IsArray($image) Then
    ;~ Sleep(50)
    Return 5
    EndIf
    ;~ Sleep(50) ;50ms
    If $fish = 1 Then
    Return 6
    EndIf
    If $casino = 1 Then
    	Return 7
    EndIf
    Return 4;walk 0ms
    EndFunc   ;==>state
    
    Func start();50ms (0)
    If $debug = 1 Then
    $info5 = "In start"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    $info1 = "Initialising..."
    GUICtrlSetData($Label1, $info1)
    If $read = 0 Then
    $log = IniRead("config.ini", "setting", "log", "0")
    If $log = 1 Then
    $user =  IniRead("config.ini", "setting", "user", "")
    $pass = BinaryToString(IniRead("config.ini", "setting", "pass", '"passdefault"'), 4)
    EndIf
    $debug = IniRead("config.ini", "setting", "debug", "0")
    $train = IniRead("config.ini", "setting", "train", "0")
    $square = IniRead("config.ini", "setting", "square", "0")
    $walktime = IniRead("config.ini", "setting", "walktime", "800")
    $abutton = IniRead("config.ini", "setting", "abutton", "z")
    $bbutton = IniRead("config.ini", "setting", "bbutton", "x")
    $moveforget = IniRead("config.ini", "setting", "moveforget", "0")
    $fish = IniRead("config.ini", "setting", "fish", "0")
    $read = 1
    $move1 = IniRead("config.ini", "setting", "move1", "1")
    $move2 = IniRead("config.ini", "setting", "move2", "0")
    $move3 = IniRead("config.ini", "setting", "move3", "0")
    $move4 = IniRead("config.ini", "setting", "move4", "0")
    EndIf
    
    If $casino = 1 Then
    $info4 = "Number of gamble: "&$totalcount
    Else
    $info4 = "Number of Pokemon fought: "&$totalcount
    EndIf
    
    If Not WinExists("[CLASS:LWJGL]") Then;50ms
    $info1 = "Window not found, waiting for game."
    GUICtrlSetData($Label1, $info1)
    Sleep(50)
    Return 1
    EndIf
    If WinActive("[CLASS:LWJGL]") Then;50ms
    	if $offscreen = 1 Then
    		WinMove("[CLASS:LWJGL]", "", @desktopWidth - 20, 0)
    	EndIf
    $pos = WinGetPos("[CLASS:LWJGL]")
    $info1 = "Window found, focus OK."
    WinMove("[CLASS:LWJGL]", "", $pos[0], $pos[1], 1032, 795)
    GUICtrlSetData($Label1, $info1)
    ;~ Sleep(50); 50ms
    Return 2;state
    EndIf
    WinActivate("[CLASS:LWJGL]")
    $info1 = "Window found, waiting for game focus."
    GUICtrlSetData($Label1, $info1)
    ;~ Sleep(50);50ms
    Return 1
    EndFunc   ;==>start
    
    Func _ImageSearchArea($FindImage, $ResultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $Tolerance)
    If $Tolerance > 0 Then $FindImage = "*" & $Tolerance & " " & $FindImage
    
    If @autoItX64 Then
    $Result = DllCall("ImageSearchDLL_x64.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $FindImage)
    Else
    $Result = DllCall("ImageSearchDLL.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $FindImage)
    EndIf
    
    If $Result = "0" Then Return 0
    
    $Array = StringSplit($Result[0], "|")
    
    If (UBound($Array) >= 4) Then
    $x = Int(Number($Array[2]))
    $y = Int(Number($Array[3]))
    
    If $ResultPosition = 1 Then
    $x = $x + Int(Number($Array[4]) / 2)
    $y = $y + Int(Number($Array[5]) / 2)
    EndIf
    Return 1
    EndIf
    EndFunc   ;==>_ImageSearchArea
    
    Func TogglePause()
    If $debug = 1 Then
    $info5 = "In pause"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    While 1
    $info2 = "PAUSED PRESS F8 TO RESUME / F9 TO QUIT"
    GUICtrlSetData($Label2, $info2)
    Sleep(100)
    If _IsPressed("77", $dll) Then
    Return 1
    EndIf
    WEnd
    EndFunc   ;==>TogglePause
    
    Func quit()
    	If $offscreen = 1 Then
    	WinMove("[CLASS:LWJGL]", "", 0, 0)
    	EndIf
    If $debug = 1 Then
    $info5 = "In quit"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    Sleep(100)
    Exit
    EndFunc   ;==>TogglePause
    
    Func setting()
    #region ### START Koda GUI section ### Form=C:\Documents and Settings\Administrator\Desktop\pokemmo bot\koda\Forms\Form1.kxf
    $Form1 = GUICreate("UglyBot Setting", 466, 294, 287, 138)
    $Label1 = GUICtrlCreateLabel("Auto Login", 16, 8, 55, 17)
    $Label2 = GUICtrlCreateLabel("Username", 16, 36, 52, 17)
    $Label3 = GUICtrlCreateLabel("Password", 16, 63, 50, 17)
    $Label4 = GUICtrlCreateLabel("Debug Mode", 16, 91, 66, 17)
    $Label5 = GUICtrlCreateLabel("Training", 16, 118, 42, 17)
    $Label6 = GUICtrlCreateLabel("Walking type", 16, 146, 66, 17)
    $Label7 = GUICtrlCreateLabel("Walking steps", 16, 173, 107, 17)
    $Label8 = GUICtrlCreateLabel("Button A", 16, 201, 45, 17)
    $Label9 = GUICtrlCreateLabel("Button B", 16, 228, 45, 17)
    $Button1 = GUICtrlCreateButton("Save and start", 16, 256, 89, 25)
    $Checkbox1 = GUICtrlCreateCheckbox("", 104, 8, 97, 17)
    $Checkbox2 = GUICtrlCreateCheckbox("", 104, 89, 17, 17)
    $Radio1 = GUICtrlCreateRadio("Square", 104, 143, 113, 17)
    $Radio2 = GUICtrlCreateRadio("Left/Right", 224, 144, 113, 17)
    $Radio3 = GUICtrlCreateRadio("Up/Down", 344, 144, 113, 17)
    $Input3 = GUICtrlCreateInput("500", 104, 170, 121, 21)
    $Input4 = GUICtrlCreateInput("Z", 104, 197, 121, 21)
    $Input5 = GUICtrlCreateInput("X", 104, 224, 121, 21)
    $Checkbox3 = GUICtrlCreateCheckbox("", 104, 116, 17, 17)
    $Checkbox4 = GUICtrlCreateCheckbox("Forget new Moves", 144, 116, 107, 17)
    $Checkbox5 = GUICtrlCreateCheckbox("FishBot (F5)", 144, 89, 107, 17)
    $Checkbox6 = GUICtrlCreateCheckbox("Move 1", 224, 40, 97, 17)
    $Checkbox8 = GUICtrlCreateCheckbox("Move 3", 224, 64, 97, 17)
    $Checkbox7 = GUICtrlCreateCheckbox("Move 2", 336, 40, 97, 17)
    $Checkbox9 = GUICtrlCreateCheckbox("Move 4", 336, 64, 97, 17)
    $Checkbox10 = GUICtrlCreateCheckbox("Catch new pokemons", 336, 88, 107, 17)
    $Checkbox11 = GUICtrlCreateCheckbox("Use waypoint", 336, 112, 107, 17)
    $Checkbox12 = GUICtrlCreateCheckbox("Use offscreen", 336, 196, 107, 17)
    $Label10 = GUICtrlCreateLabel("Move to use", 224, 16, 79, 17)
    $Button2 = GUICtrlCreateButton("Casino bot", 312, 256, 73, 25)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###
    
    If Not FileExists("config.ini") Then
    IniWrite("config.ini", "setting", "log", "0")
    IniWrite("config.ini", "setting", "user", '"user"')
    IniWrite("config.ini", "setting", "pass", '"pass"')
    IniWrite("config.ini", "setting", "debug", "0")
    IniWrite("config.ini", "setting", "train", "0")
    IniWrite("config.ini", "setting", "square", "1")
    IniWrite("config.ini", "setting", "walktime", "5")
    IniWrite("config.ini", "setting", "abutton", "z")
    IniWrite("config.ini", "setting", "bbutton", "x")
    IniWrite("config.ini", "setting", "moveforget", "0")
    IniWrite("config.ini", "setting", "fish", "0")
    IniWrite("config.ini", "setting", "move1", "1")
    IniWrite("config.ini", "setting", "move2", "0")
    IniWrite("config.ini", "setting", "move3", "0")
    IniWrite("config.ini", "setting", "move4", "0")
    IniWrite("config.ini", "setting", "catch", "0")
    IniWrite("config.ini", "setting", "waypoint", "0")
    IniWrite("config.ini", "setting", "offscreen", "0")
    EndIf
    
    
    If IniRead("config.ini", "setting", "log", "0") = 1 Then
    _GUICtrlButton_SetCheck($Checkbox1)
    $Input1 = GUICtrlCreateInput("", 104, 35, 97, 21)
    $Input2 = GUICtrlCreateInput("", 104, 62, 97, 21, $ES_PASSWORD)
    GUICtrlSetData($Input1, IniRead("config.ini", "setting", "user", '"userdefault"'))
    $pass = BinaryToString(IniRead("config.ini", "setting", "pass", '"passdefault"'), 4)
    GUICtrlSetData($Input2, $pass)
    $log = 1
    Else
    $log = 0
    EndIf
    If IniRead("config.ini", "setting", "debug", "0") = 1 Then
    _GUICtrlButton_SetCheck($Checkbox2)
    $debug = 1
    Else
    $debug = 0
    EndIf
    If IniRead("config.ini", "setting", "catch", "0") = 1 Then
    _GUICtrlButton_SetCheck($Checkbox10)
    $catch = 1
    Else
    $catch = 0
    EndIf
    If IniRead("config.ini", "setting", "train", "0") = 1 Then
    _GUICtrlButton_SetCheck($Checkbox3)
    $train = 1
    Else
    $train = 0
    EndIf
    If IniRead("config.ini", "setting", "move1", "0") = 1 Then
    _GUICtrlButton_SetCheck($Checkbox6)
    $move1 = 1
    Else
    $move1 = 0
    EndIf
    If IniRead("config.ini", "setting", "move2", "0") = 1 Then
    _GUICtrlButton_SetCheck($Checkbox7)
    $move2 = 1
    Else
    $move2 = 0
    EndIf
    If IniRead("config.ini", "setting", "move3", "0") = 1 Then
    _GUICtrlButton_SetCheck($Checkbox8)
    $move3 = 1
    Else
    $move3 = 0
    EndIf
    If IniRead("config.ini", "setting", "move4", "0") = 1 Then
    _GUICtrlButton_SetCheck($Checkbox9)
    $move4 = 1
    Else
    $move4 = 0
    EndIf
    If $move1 = 0 And $move2 = 0 And $move3 = 0 And $move4 = 0 Then
    _GUICtrlButton_SetCheck($Checkbox6)
    $move1 = 1
    EndIf
    If IniRead("config.ini", "setting", "square", "1") = 0 Then
    _GUICtrlButton_SetCheck($Radio3)
    _GUICtrlButton_SetCheck($Radio1, $BST_UNCHECKED)
    _GUICtrlButton_SetCheck($Radio2, $BST_UNCHECKED)
    $square = 0
    EndIf
    If IniRead("config.ini", "setting", "square", "1") = 2 Then
    _GUICtrlButton_SetCheck($Radio2)
    _GUICtrlButton_SetCheck($Radio1, $BST_UNCHECKED)
    _GUICtrlButton_SetCheck($Radio3, $BST_UNCHECKED)
    $square = 2
    EndIf
    If IniRead("config.ini", "setting", "square", "1") = 1 Then
    _GUICtrlButton_SetCheck($Radio1)
    _GUICtrlButton_SetCheck($Radio3, $BST_UNCHECKED)
    _GUICtrlButton_SetCheck($Radio2, $BST_UNCHECKED)
    $square = 1
    EndIf
    If Not IniRead("config.ini", "setting", "square", "1") = 1 And Not IniRead("config.ini", "setting", "square", "1") = 0 And Not IniRead("config.ini", "setting", "square", "1") = 2 Then
    _GUICtrlButton_SetCheck($Radio3)
    _GUICtrlButton_SetCheck($Radio1, $BST_UNCHECKED)
    _GUICtrlButton_SetCheck($Radio2, $BST_UNCHECKED)
    $square = 0
    EndIf
    GUICtrlSetData($Input3, IniRead("config.ini", "setting", "walktime", "5"))
    GUICtrlSetData($Input4, IniRead("config.ini", "setting", "abutton", "z"))
    GUICtrlSetData($Input5, IniRead("config.ini", "setting", "bbutton", "x"))
    If IniRead("config.ini", "setting", "moveforget", "1") = 1 Then
    _GUICtrlButton_SetCheck($checkbox4)
    $moveforget = 1
    Else
    $moveforget = 0
    EndIf
    
    If IniRead("config.ini", "setting", "fish", "0") = 1 Then
    _GUICtrlButton_SetCheck($checkbox5)
    $fish = 1
    Else
    $fish = 0
    EndIf
    
    If IniRead("config.ini", "setting", "waypoint", "0") = 1 Then
    _GUICtrlButton_SetCheck($checkbox11)
    $waypoint = 1
    Else
    $waypoint = 0
    EndIf
    
    If IniRead("config.ini", "setting", "offscreen", "0") = 1 Then
    _GUICtrlButton_SetCheck($checkbox12)
    $offscreen = 1
    Else
    $offscreen = 0
    EndIf
    
    While 1
    $nMsg = GUIGetMsg()
    Sleep(50)
    If $log = 1 Then
    $user = GUICtrlRead($Input1, 1)
    $pass = GUICtrlRead($Input2, 1)
    EndIf
    $walktime = GUICtrlRead($Input3, 1)
    $abutton = GUICtrlRead($Input4, 1)
    $bbutton = GUICtrlRead($Input5, 1)
    If $move1 = 0 And $move2 = 0 And $move3 = 0 And $move4 = 0 Then
    _GUICtrlButton_SetCheck($Checkbox6)
    $move1 = 1
    EndIf
    
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    IniWrite("config.ini", "setting", "log", $log)
    If $log = 1 Then
    IniWrite("config.ini", "setting", "user", $user)
    IniWrite("config.ini", "setting", "pass", StringToBinary($pass, 4))
    EndIf
    IniWrite("config.ini", "setting", "debug", $debug)
    IniWrite("config.ini", "setting", "train", $train)
    IniWrite("config.ini", "setting", "square", $square)
    IniWrite("config.ini", "setting", "walktime", $walktime)
    IniWrite("config.ini", "setting", "abutton", $abutton)
    IniWrite("config.ini", "setting", "bbutton", $bbutton)
    IniWrite("config.ini", "setting", "moveforget", $moveforget)
    IniWrite("config.ini", "setting", "fish", $fish)
    IniWrite("config.ini", "setting", "move1", $move1)
    IniWrite("config.ini", "setting", "move2", $move2)
    IniWrite("config.ini", "setting", "move3", $move3)
    IniWrite("config.ini", "setting", "move4", $move4)
    IniWrite("config.ini", "setting", "catch", $catch)
    IniWrite("config.ini", "setting", "waypoint", $waypoint)
    IniWrite("config.ini", "setting", "offscreen", $offscreen)
    GUIDelete($Form1)
    If $offscreen = 1 Then
    	send("{LWINDOWN}")
    	Sleep(1000)
    	send("p")
    	Sleep(1000)
    	Send("p")
    	Sleep(1000)
    	Send("p")
    	Sleep(1000)
    	send("{LWINUP}")
    	Sleep(1000)
    EndIf
    
    Return 1
    Case $Button2
    	GUIDelete($Form1)
    	If $offscreen = 1 Then
    	send("{LWINDOWN}")
    	Sleep(1000)
    	send("p")
    	Sleep(1000)
    	Send("p")
    	Sleep(1000)
    	Send("p")
    	Sleep(1000)
    	send("{LWINUP}")
    	Sleep(1000)
    EndIf
    	$casino = 1
    	Return 1
    
    Case $Checkbox1
    If _GUICtrlButton_GetCheck($Checkbox1) Then
    $log = 1
    $Input1 = GUICtrlCreateInput("", 104, 35, 97, 21)
    $Input2 = GUICtrlCreateInput("", 104, 62, 97, 21, $ES_PASSWORD)
    Else
    $log = 0
    GUICtrlDelete($Input1)
    GUICtrlDelete($Input2)
    EndIf
    Case $Radio1
    If _GUICtrlButton_GetCheck($Radio1) Then
    $square = 1
    _GUICtrlButton_SetCheck($Radio2, $BST_UNCHECKED)
    _GUICtrlButton_SetCheck($Radio3, $BST_UNCHECKED)
    EndIf
    Case $Radio2
    If _GUICtrlButton_GetCheck($Radio2) Then
    $square = 2
    _GUICtrlButton_SetCheck($Radio1, $BST_UNCHECKED)
    _GUICtrlButton_SetCheck($Radio3, $BST_UNCHECKED)
    EndIf
    Case $Radio3
    If _GUICtrlButton_GetCheck($Radio3) Then
    $square = 0
    _GUICtrlButton_SetCheck($Radio1, $BST_UNCHECKED)
    _GUICtrlButton_SetCheck($Radio2, $BST_UNCHECKED)
    EndIf
    Case $Checkbox2
    If _GUICtrlButton_GetCheck($Checkbox2) Then
    $debug = 1
    Else
    $debug = 0
    EndIf
    
    Case $Checkbox3
    If _GUICtrlButton_GetCheck($Checkbox3) Then
    $train = 1
    Else
    $train = 0
    EndIf
    Case $checkbox4
    If _GUICtrlButton_GetCheck($checkbox4) Then
    $moveforget = 1
    Else
    $moveforget = 0
    EndIf
    Case $checkbox5
    If _GUICtrlButton_GetCheck($checkbox5) Then
    $fish = 1
    Else
    $fish = 0
    EndIf
    Case $checkbox6
    If _GUICtrlButton_GetCheck($checkbox6) Then
    $move1 = 1
    Else
    $move1 = 0
    EndIf
    Case $checkbox7
    If _GUICtrlButton_GetCheck($checkbox7) Then
    $move2 = 1
    Else
    $move2 = 0
    EndIf
    Case $checkbox8
    If _GUICtrlButton_GetCheck($checkbox8) Then
    $move3 = 1
    Else
    $move3 = 0
    EndIf
    Case $checkbox9
    If _GUICtrlButton_GetCheck($checkbox9) Then
    $move4 = 1
    Else
    $move4 = 0
    EndIf
    Case $checkbox10
    If _GUICtrlButton_GetCheck($checkbox10) Then
    $catch = 1
    Else
    $catch = 0
    EndIf
    Case $checkbox11
    If _GUICtrlButton_GetCheck($checkbox11) Then
    $waypoint = 1
    Else
    $waypoint = 0
    EndIf
    Case $checkbox12
    If _GUICtrlButton_GetCheck($checkbox12) Then
    $offscreen = 1
    Else
    $offscreen = 0
    EndIf
    
    EndSwitch
    WEnd
    
    EndFunc   ;==>setting
    
    Func casinobot()
    If $debug = 1 Then
    $info5 = "In casino"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    WinActivate("[CLASS:LWJGL]")
    $image = PixelSearch(700, 500, 710, 510, 0xE8A800, 1)
    If IsArray($image)Then;in slot
    	Sleep(Random(100,500,1))
    	WinActivate("[CLASS:LWJGL]")
    	If $debug = 1 Then
    $info6 = "Down stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send("{DOWN}")
    	Sleep(Random(100,500,1))
    	WinActivate("[CLASS:LWJGL]")
    	If $debug = 1 Then
    $info6 = "Down stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send("{DOWN}")
    	Sleep(Random(100,500,1))
    	WinActivate("[CLASS:LWJGL]")
    	If $debug = 1 Then
    $info6 = "Down stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send("{DOWN}")
    	Sleep(Random(500,1000,1))
    	WinActivate("[CLASS:LWJGL]")
    	If $debug = 1 Then
    $info6 = "B button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send($bbutton)
    	Sleep(Random(100,500,1))
    	WinActivate("[CLASS:LWJGL]")
    	If $debug = 1 Then
    $info6 = "B button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send($bbutton)
    	Sleep(Random(100,500,1))
    	WinActivate("[CLASS:LWJGL]")
    	If $debug = 1 Then
    $info6 = "B button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send($bbutton)
    	Sleep(Random(100,500,1))
    	WinActivate("[CLASS:LWJGL]")
    	If $debug = 1 Then
    $info6 = "B button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send($bbutton)
    	Sleep(Random(100,500,1))
    	WinActivate("[CLASS:LWJGL]")
    	If $debug = 1 Then
    $info6 = "B button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    	Send($bbutton)
    	Sleep(Random(3000,4500,1))
    	Return 1
    Else
    	Sleep(500)
    	Return 1
    EndIf
    Return 1
    EndFunc
    
    Func fishbot()
    If $debug = 1 Then
    $info5 = "In fishbot"
    _GUICtrlListBox_BeginUpdate($Label5)
    _GUICtrlListBox_InsertString($Label5, $info5)
    _GUICtrlListBox_EndUpdate($Label5)
    $iIndex = _GUICtrlListBox_GetCurSel($Label5)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label5, $iIndex)
    EndIf
    $change = 0
    If $count = 9 Then
    $hurt = 1
    $count = 0
    EndIf
    
    $image = PixelSearch(500, 170, 510, 180, 0xE08098, 1)
    $image2 = PixelSearch(500, 165, 510, 180, 0xD06878, 1)
    If $hurt = 1 Then
    If IsArray($image) Or IsArray($image2) Then
    Send("{UP up}")
    Sleep(2000)
    If $debug = 1 Then
    $info6 = "A button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send($abutton);talk nurse
    Sleep(2000)
    If $debug = 1 Then
    $info6 = "A button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send($abutton); say hi
    Sleep(2000)
    If $debug = 1 Then
    $info6 = "A button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send($abutton);heal
    Sleep(2000)
    If $debug = 1 Then
    $info6 = "A button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send($abutton);waiting
    Sleep(2000)
    If $debug = 1 Then
    $info6 = "B button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send($bbutton);thanks
    Sleep(2000)
    If $debug = 1 Then
    $info6 = "B button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send($bbutton);bye
    Sleep(2000)
    If $debug = 1 Then
    $info6 = "B button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send($bbutton);yeah love you too
    Sleep(2000)
    If $debug = 1 Then
    $info6 = "B button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send($bbutton);stop talking to me psycho
    Sleep(2000)
    If $debug = 1 Then
    $info6 = "B button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send($bbutton);im gonna call your manager!
    Sleep(2000)
    $hurt = 0
    Return 1
    EndIf
    EndIf
    
    
    $image = PixelSearch(500, 410, 510, 420, 0x4878D8, 1)
    If IsArray($image) And $hurt = 0 Then
    Send("{DOWN up}")
    Sleep(500)
    If $debug = 1 Then
    $info6 = "Down stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send("{DOWN}");make sure you look ok
    Sleep(50)
    If $debug = 1 Then
    $info6 = "Cane button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send($canebutton);see water
    $something = 0
    Sleep(5000)
    If $debug = 1 Then
    $info6 = "A button sent"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send($abutton);somenthing?
    Sleep(500)
    If $debug = 1 Then
    $info6 = "Down stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send("{DOWN}")
    $something = 1
    Return 1
    EndIf
    
    If $hurt = 1 Then
    	If $debug = 1 Then
    	$info6 = "Up stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send("{UP down}")
    Return 1
    EndIf
    
    If $hurt = 0 Then
    	If $debug = 1 Then
    	$info6 = "Down stick"
    _GUICtrlListBox_BeginUpdate($Label6)
    _GUICtrlListBox_InsertString($Label6, $info6)
    _GUICtrlListBox_EndUpdate($Label6)
    $iIndex = _GUICtrlListBox_GetCurSel($Label6)
    $iIndex = $iIndex + 1
    _GUICtrlListBox_SetCurSel($Label6, $iIndex)
    EndIf
    Send("{DOWN down}")
    Return 1
    EndIf
    Return 1
    EndFunc
    <b>Downloadable Files</b> Downloadable Files

  16. The Following 44 Users Say Thank You to franklin01 For This Useful Post:

    atuladaokhach (12-01-2014),b0dzi094 (12-25-2013),Badis-Dz (02-02-2014),bearq (11-08-2014),beccarmt (12-07-2015),Berseke23 (09-17-2020),Boopy_Doopy (10-23-2020),botas11 (01-17-2014),BreeYaN (03-21-2015),christianjsp (12-20-2013),Cougar57 (03-08-2014),CrazyMoonkey (02-20-2014),diltom1998 (09-24-2015),fireflashhh (08-20-2014),HackingNub55 (05-17-2014),Haruninho (12-10-2014),heohanwuoc (09-13-2014),Hmgah (05-13-2019),ImYoann (07-27-2017),JKyleWallace (01-16-2014),junyan996 (01-13-2019),karanjit99 (12-21-2013),Kinola (12-21-2013),kurwa11 (07-18-2018),Kyuuby (12-20-2013),LanceStorm (09-25-2018),limkangxian1999 (01-01-2015),lipinhow005 (09-21-2014),mushssg (01-10-2019),nemvouusar (01-21-2016),PhantomBoyYT (07-02-2020),pokemmotest (09-11-2018),Slowpiri (11-14-2014),supercarz1991 (12-23-2013),suzuno (11-10-2020),teddys2 (09-09-2018),Tseng (09-05-2014),wallblack (12-31-2013),XyperBass (01-25-2014),zankeda (09-10-2018),Zeroharuka (11-10-2014),zsullivanz (11-27-2014),zydyr (03-06-2019),{ } (07-23-2016)

  17. #13
    Austin's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Great White North
    Posts
    30,484
    Reputation
    6104
    Thanks
    8,326
    My Mood
    Lurking
    approved but not tested .




    VIP Support // May 2011
    CF Minion // January 2012
    Newsforce // August 2012
    Minion+ // March 2013
    Moderator // August 2014
    Former Staff // January 2015
    General Minion // July 2015
    Publicist // December 2015





  18. #14
    Kyuuby's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0
    Thank you very much
    its awesome! ^^
    Please go on with the developing )

  19. #15
    supercarz1991's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    6,285
    Reputation
    435
    Thanks
    3,715
    My Mood
    Doh
    i'm giving it a shot now, been looking for a game like this

    commando: You're probably the best non-coder coder I know LOL


Page 1 of 3 123 LastLast

Similar Threads

  1. [First Release] Super Spam Bot
    By Erinador in forum Visual Basic Programming
    Replies: 10
    Last Post: 10-21-2009, 03:42 PM
  2. Release JD09 Spam Bot
    By Jimmy in forum Combat Arms Discussions
    Replies: 30
    Last Post: 09-03-2009, 03:09 AM
  3. [Release]GP & Level Bot
    By iHazBalls in forum Combat Arms Europe Hacks
    Replies: 18
    Last Post: 06-08-2009, 09:42 AM
  4. [Release]NEW LVL BOT!
    By Carms in forum Combat Arms Hacks & Cheats
    Replies: 22
    Last Post: 10-08-2008, 05:33 AM
  5. [Bot Release] Simple Trigger Bot
    By blah in forum Combat Arms Hacks & Cheats
    Replies: 57
    Last Post: 08-20-2008, 10:05 AM

Tags for this Thread