Skip to content

Instantly share code, notes, and snippets.

@ptcmariano
Created December 27, 2020 11:58
Show Gist options
  • Save ptcmariano/99d9007285e595498ce0bf49d75f0a24 to your computer and use it in GitHub Desktop.
Save ptcmariano/99d9007285e595498ce0bf49d75f0a24 to your computer and use it in GitHub Desktop.
find color with autoit script
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.14.5
Author: Paulo Tiago
Script Function:
find color and walk or atack
into nesbox.com fullscreen running GBA pokemon red or blue or yellow
#ce ----------------------------------------------------------------------------
#include <MsgBoxConstants.au3>
;Opt("SendKeyDelay", 200) ;200 milliseconds
HotKeySet("{ESC}", "Terminate")
Func Terminate()
Exit
EndFunc ;==>Terminate
While 1
verifyToAction()
Sleep(200)
WEnd
Func verifyToAction()
WinActivate("nesbox.com")
; Find a pixel grass
Local $aCoord = PixelSearch(0, 0, 1278, 960, 0x7FBB71)
If Not @error Then
;MsgBox($MB_SYSTEMMODAL, "", "X and Y are: " & $aCoord[0] & "," & $aCoord[1])
walk()
Else
;MsgBox($MB_SYSTEMMODAL, "", "NOT FOUND PixelSearch(0, 0, 1278, 960, 0x7FBB71) ")
atack()
EndIf
EndFunc
Func atack()
Send("z")
Sleep(1800)
Send("z")
Sleep(1800)
Send("z")
Sleep(1800)
Send("z")
Sleep(1800)
Send("z")
Sleep(1800)
Send("z")
Sleep(1800)
Send("z")
Sleep(1800)
Send("z")
Sleep(1800)
Send("z")
Sleep(1800)
EndFunc
Func walk()
Send("{UP}")
Send("{UP}")
Send("{UP}")
Send("{UP}")
Sleep(800)
Send("{UP}")
Send("{UP}")
Send("{UP}")
Send("{UP}")
Sleep(800)
Send("{UP}")
Send("{UP}")
Send("{UP}")
Send("{UP}")
Sleep(800)
Send("{DOWN}")
Send("{DOWN}")
Send("{DOWN}")
Send("{DOWN}")
Sleep(800)
Send("{DOWN}")
Send("{DOWN}")
Send("{DOWN}")
Send("{DOWN}")
Sleep(800)
Send("{DOWN}")
Send("{DOWN}")
Send("{DOWN}")
Send("{DOWN}")
Sleep(800)
Send("{DOWN}")
Send("{DOWN}")
Send("{DOWN}")
Send("{DOWN}")
Sleep(800)
EndFunc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment