Automatic Game Reset Topic is solved

Ask gaming related questions
Golisuine

Automatic Game Reset  Topic is solved

20 Jun 2018, 01:37

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] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus



And here's what the thing I told you about looks above:

https://cdn.discordapp.com/attachments/ ... nknown.png
Last edited by joedf on 20 Jun 2018, 08:12, edited 2 times in total.
Reason: fix code tags
User avatar
joedf
Posts: 6440
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: Automatic Game Reset

20 Jun 2018, 09:15

Cool game! I'll have to try this when time permits :+1:
Have you tried ImageSearch ?
Golisuine
Posts: 2
Joined: 20 Jun 2018, 01:39

Re: Automatic Game Reset

22 Jun 2018, 03:48

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.
User avatar
joedf
Posts: 6440
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: Automatic Game Reset

22 Jun 2018, 08:12

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] [Download] (ImageSearch_Example.ahk)GeSHi © Codebox Plus

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%.
Golisuine
Posts: 2
Joined: 20 Jun 2018, 01:39

Re: Automatic Game Reset

22 Jun 2018, 08:26

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] [Download] (ImageSearch_Example.ahk)GeSHi © Codebox Plus

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!

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 3 guests