
Originally Posted by
Lolleko
Sorry but this bot was fixed weeks ago and i discontinued the work on a new one for now :/
Hold on a sec, I just started on PokeMMO and I kinda like that game and you rigth now there are no working bot? This is a comunity about hack and program so I will try a few things and if people want to join and improve we can make something work... Be right back guys, we will catch them all!
Quick update:
First shot for kinda bot.
What does it do?
Walk around and fight if there is something.
Always use top left attack unless PP are depleted, will then use top right attack.
Pause key pauses, press F11 to resume.
That's all, probably more to come later (maybe).
How to use:
Get autoit, ImageSearchDLL.dll / ImageSearchDLL_x64.dll, and attached image.
Create a new script, paste this awfullt written code and save.
Make sure dlls and images (pp.png and pp2.png) are in the same folder as the script.
Launch the game, go to grass and run the script.
Note: due to random fight pick a large grass area as it might move a little.
Feel free to improve but if you do share with the comunity
I will not upload dlls or compiled script as I am lazy and will not do a virus scan thing but you have source of the script here and google for dlls or change the check on PP to use pixelsearch instead.
Pretty long message for such a little thing.
Code:
#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>
Opt("WinTitleMatchMode", 1)
Opt("PixelCoordMode", 2)
Dim $job
Dim $Label1
Dim $Label2
Dim $Label3
Dim $Label4
Dim $info1
Dim $info2
Dim $info3
Dim $info4 = "Press [Pause] to pause..."
Dim $image
Dim $image2
Dim $pos
Dim $walk = 0
Dim $dll = DllOpen("user32.dll")
Global $x, $y, $image
$job = start()
HotKeySet("{PAUSE}", "TogglePause")
GUICreate("My GUI", 225, 100, 20, 0, BitOr($WS_BORDER, $WS_POPUP), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
$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(10)
GUICtrlSetData($Label1, $info1)
GUICtrlSetData($Label2, $info2)
GUICtrlSetData($label3, $info3)
GUICtrlSetData($label4, $info4)
Switch $job
Case 1
$job = start()
Case 2
$job = state()
Case 3
$job = fight()
Case 4
$job = walk()
Case 5
$job = waiting()
EndSwitch
WEnd
Func fight()
$image = PixelSearch( 110, 400, 540, 540, 0xCFA806, 5)
If IsArray($image) Then
$info3 = "Attacking."
GUICtrlSetData($label3, $info3)
Sleep(50)
Send("{LEFT}")
Sleep(50)
Send("{LEFT}")
Sleep(50)
Send("{UP}")
Sleep(50)
Send("{UP}")
Sleep(50)
Send("z")
Sleep(50)
$i = 0
While $i < 10
$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("z")
Sleep(50)
Return 1
EndIf
WEnd
$info3 = "Still some PP..."
GUICtrlSetData($label3, $info3)
$i = 0
Send("z")
Sleep(50)
Return 1
EndIf
$image = PixelSearch( 875, 515, 895, 535, 0xFFFFFF, 5)
If IsArray($image) Then
$info3 = "Input needed."
GUICtrlSetData($label3, $info3)
Sleep(50)
Send("x")
Sleep(50)
Return 1
EndIf
Sleep(50)
Send("{RIGHT}")
Return 1
EndFunc
Func walk()
If $walk < 1 Then
$info3 = "Walking down."
GUICtrlSetData($label3, $info3)
Send("{DOWN down}")
Sleep(Random(500, 600, 1))
Send("{DOWN up}")
$walk = 1
Sleep(50)
Return 1
EndIf
If $walk < 2 Then
$info3 = "Walking left."
GUICtrlSetData($label3, $info3)
Send("{LEFT down}")
Sleep(Random(500, 600, 1))
Send("{LEFT up}")
$walk = 2
Sleep(50)
Return 1
EndIf
If $walk < 3 Then
$info3 = "Walking up."
GUICtrlSetData($label3, $info3)
Send("{UP down}")
Sleep(Random(500, 600, 1))
Send("{UP up}")
$walk = 3
Sleep(50)
Return 1
EndIf
If $walk < 4 Then
$info3 = "Walking right."
GUICtrlSetData($label3, $info3)
Send("{RIGHT down}")
Sleep(Random(500, 600, 1))
Send("{RIGHT up}")
$walk = 0
Sleep(50)
Return 1
EndIf
Return 1
EndFunc
Func state()
$image = PixelSearch( 200, 415, 700, 420, 0x1D415D, 3)
If IsArray($image) Then
$info2 = "Player is fighting."
GUICtrlSetData($label2, $info2)
Sleep(50)
$walk = 0
Return 3
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
$info1 = "Window found, focus OK."
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"
GUICtrlSetData($label1, $info1)
Sleep(50)
TrayTip("", "Paused", 500000000)
If _IsPressed("7A", $dll) Then
Return 1
EndIf
WEnd
EndFunc