help with simple left click on color items in game Topic is solved

Ask gaming related questions (AHK v1.1 and older)
Guest

help with simple left click on color items in game  Topic is solved

24 Feb 2018, 04:10

Hi I have basic knowledge of programming in Python but haven't delved into auto hot key yet. I need to add to a gaming script that I found online for an MMO Game. There are tons of items to pick up and it gets really redundant you Have to click on every single item, thousands and thousands over time. In fact it is so much clicking it actually is starting to screw up my hand and give me pain so this solution is desperately needed. I would appreciate it anybody who can translate my pseudocode into actual usable code and I'll keep it a simple as possible. In short I need some kind of for loop that iterates over a list of items, and if they have appeared on screen in game, to left click them.

I realized the first problem is that I had planned on scanning for these items by text string - i.e. the items title, then realized the game doesn't display item titles as strings or text but rather as a clickable highlighted rectangular object - ie Divine Ruby Sword etc. So my second idea is to screenshot the different item color schemes to find the exact RGB color value of the desired items, Record these RGB values, then in the for loop iterate over these colors, and if the color has appeared on screen (within the item display box) perform a left click on the specified colors, until the items are picked up and no more of that exact color is displayed on screen. I don't see how else to do this because the items display boxes don't appear at exact coordinates so there has to be another solution. This loop would obviously be toggled on and off by a hot key.

Pseudocode (in Python) would roughly look like this:


import win32api, win32con, time

colorlist = [rgbhex1, rgbhex2, rgbhex3, rgbhex4, rgbhex5, rgbhex6]

def click(x,y):
win32api.SetCursorPos((x,y))
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,y,0,0)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,x,y,0,0)
click(10,10)

for x in colorlist:
x.click((time.sleep(1))


I would add a sleep (delay duration) or 1 second in between clicks to allow for item pickup time. please help thanks.
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: help with simple left click on color items in game

25 Feb 2018, 02:32

Does every item have a different color that is found nowhere else on the screen? Are the items big enough and static?
I am your average ahk newbie. Just.. a tat more cute. ;)

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 44 guests