Tricky Problem-Need help!

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
brandonpresser
Newbie
Posts: 1
Joined: Fri Sep 20, 2019 10:40 pm

Tricky Problem-Need help!

Post by brandonpresser » Fri Sep 20, 2019 10:51 pm

Hi Everyone,
I am trying to build a script to farm currency on a game! I absolutely love this program. I have already scripted the keyboard macro and a few little additional things. I need help with this tricky situation.
This game only has one bot detection (shown in link)...Basically, a popup will occur at random intervals requiring the user to click "YES". Heres the problem, the the popup isnt always in the same position on the screen. Also the "YES" isnt in the same position in the pop up. So you may be thinking, that image detection would work...but the popup changes color each time! see pic..its purple, but next time it might be green or yellow, it does a different hue each time...thousands of color possibility.

Please! can someone help me brainstorm some solutions! I would love to chat on here/discord/skype/etc.

https://imgur.com/a/aLFkmJy

User avatar
PepsiHog
Automation Wizard
Posts: 517
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Re: Tricky Problem-Need help!

Post by PepsiHog » Thu Nov 14, 2019 8:34 pm

Hi, brandonpresser,

I would see if you could use GetPixelColor. If successful, you could have a macro check points on the screen for colors. The window being searched for is fairly large(compared to the game). The likely hood that the same color would be on the screen in say three different locations, is unlikely. Say you grab the color some where in the upper top left, upper top right, and middle bottom center, If all colors are the same, it indicates the existence of the window.

The window is pretty large. You can easily create a search pattern to find the window on the screen. The game window is small. A macro could check all areas of a "search pattern" within seconds. That window will only fit x many times on the game screen. Maybe you first locate it, and then have a srt determine it's position with more getpixelcolor checks. Maybe a cross-hair type of check. Go from left to right while color is still true. That gives you the x position. Then check the top to bottom color. That gives the y position.

Based on that, you could make a pretty good guess where to click. Or if need be, click multiple areas on the window. That "Yes" is pretty large. Wouldn't be difficult to randomly click on it by covering the area based on size of the "YES". The same method as we're doing to find the window.

Want to collaborate? [email protected].

Good Luck,
PepsiHog
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1386
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Tricky Problem-Need help!

Post by Dorian (MJT support) » Sat Nov 16, 2019 12:23 pm

PepsiHog wrote:
Thu Nov 14, 2019 8:34 pm
I would see if you could use GetPixelColor.
My initial thought was the same as yours, but I'm fairly sure that wouldn't work, as they've made it semi transparent. This means the colour index changes. Sample it in one place, and it's 13012896, in another it's 12815002, and so on. Running the Cursor Colour Monitor over the purple image reveals a constantly changing colour.
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Grovkillen
Automation Wizard
Posts: 1131
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Tricky Problem-Need help!

Post by Grovkillen » Sat Nov 16, 2019 10:26 pm

I would use Image Magick, script using cli to analyze the image. When you have a jump in the colors used you have a bot warning.
Let>ME=%Script%

Running: 15.0.27
version history

flamerz
Newbie
Posts: 3
Joined: Fri Oct 04, 2019 9:01 pm

Re: Tricky Problem-Need help!

Post by flamerz » Sun Nov 17, 2019 3:01 pm

What game is that? Do you run it from an emulator on Windows?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts