Page 1 of 1

Automatic Game Reset  Topic is solved

Posted: 20 Jun 2018, 01:37
by Golisuine
Hello there!

So I'm pretty new to this forum and I'm not sure if I'm writing in the write one or not, but I need help with making a script for this game I'm playing called Pokemon phoenix rising which it's a fan-made Pokemon essentials game with a demo that came out recently. So in the demo their is the part where the scientist tells you to choose a Pokemon and when that happens theirs like this little bubble on the side where it shows the clear image of what the Pokemon looks like on the side. So what I want to do specifically is make some sort of automatic reset when that specific image shows up and the reason why I want to do this is because I want to obtain a "shiny version of that Pokemon, but the problem is that I can't seem to get it to work right, it just skips right over to the naming screen.

So what I'm asking is if you guys can give me any pointers in the right direction to make this possible? I'm pretty new to the whole ahk coding business so forgive me if I do have alot of errors in this script

Here's the script I managed to come up based around another script I found online with a similar concept found online, and some helpful tips from other people:

Code: Select all


#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
^!z::SetTimer, ShinyCheck, 500
Loop
{
ShinyCheck:
{
    IfWinExist, Pokemon Phoenix Rising
    {
    	    WinActivate
    }
    resetcolour = CD8D40
    targetcolour = E9F2F1
    MouseGetPos, MouseX, MouseY
    PixelGetColor, colour, %MouseX%, %MouseY%
    ifEqual, colour, %resetcolour%
    {
    ifEqual, colour, %targetcolour%
    {
	    MsgBox Congrats it is found!
	    Break
    }
    SetTimer, ShinyCheck, off
}
return
And here's what the thing I told you about looks above:

https://cdn.discordapp.com/attachments/ ... nknown.png

Re: Automatic Game Reset

Posted: 20 Jun 2018, 09:15
by joedf
Cool game! I'll have to try this when time permits :+1:
Have you tried ImageSearch ?

Re: Automatic Game Reset

Posted: 22 Jun 2018, 03:48
by Golisuine
joedf wrote:Cool game! I'll have to try this when time permits :+1:
Have you tried ImageSearch ?
Hi there sorry for the late reply, I've been busy attending to other stuff, but thanks for the reply I really appreciate it! Anyways, when you said how I should try ImageSearch, what do you mean by that exactly?

Forgive me if I sound clueless, but as I said before I'm pretty new to the whole scripting business so their is some commands/words/phrases I'm not familiar with as of yet, so if you may, do you mind elaborating me on what's its about so I can have a better grasp on what your trying to tell me? And as I said again, I appreciate that you took the time to reply to my thread, and the same gratitude will be given if you can help me out with this.

Re: Automatic Game Reset

Posted: 22 Jun 2018, 08:12
by joedf
Yeah! You can look for images on the screen: https://autohotkey.com/docs/commands/ImageSearch.htm
Just make sure to use small images, as this can be rather intensive for the computer.

Example script from the docs :+1:

Code: Select all

ImageSearch, FoundX, FoundY, 40,40, 300, 300, C:\My Images\test.bmp

CoordMode Pixel  ; Interprets the coordinates below as relative to the screen rather than the active window.
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *Icon3 %A_ProgramFiles%\SomeApp\SomeApp.exe
if ErrorLevel = 2
    MsgBox Could not conduct the search.
else if ErrorLevel = 1
    MsgBox Icon could not be found on the screen.
else
    MsgBox The icon was found at %FoundX%x%FoundY%.

Re: Automatic Game Reset

Posted: 22 Jun 2018, 08:26
by Golisuine
joedf wrote:Yeah! You can look for images on the screen: https://autohotkey.com/docs/commands/ImageSearch.htm
Just make sure to use small images, as this can be rather intensive for the computer.

Example script from the docs :+1:

Code: Select all

ImageSearch, FoundX, FoundY, 40,40, 300, 300, C:\My Images\test.bmp

CoordMode Pixel  ; Interprets the coordinates below as relative to the screen rather than the active window.
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *Icon3 %A_ProgramFiles%\SomeApp\SomeApp.exe
if ErrorLevel = 2
    MsgBox Could not conduct the search.
else if ErrorLevel = 1
    MsgBox Icon could not be found on the screen.
else
    MsgBox The icon was found at %FoundX%x%FoundY%.
Oh okay then I think I have a better understand of what I should do now! thanks for the help!