How to triggerbot with multiple pixel images under certain condition syntax...

Get help with using AutoHotkey and its commands and hotkeys
jjz580
Posts: 1
Joined: 17 May 2018, 12:25

How to triggerbot with multiple pixel images under certain condition syntax...

17 May 2018, 13:29

Greetings,

I am a newbie to coding as well as AHK program, and I have been using AHK for quite awhile for gaming purposes. Recently, i wanted to make an trigger-bot for 1920x1080 resolution that will left mouse click button will only be activated, IF all the provided 3x3 sized colored pixel images are scanned successfully. The issue now is that the bot will be triggered at any successfully scanned single colored pixel image, rather than be triggered under the condition i mentioned above.

The attached is the image of single dot cross hair in-game consisting of 9 colored pixels, with each single colored pixel selected and cropped into individual png files that labelled as between p1 to p9, respectively.
Just in case if anybody is in need of the hex values of each, here you go:

Code: [Select all] [Download] GeSHi © Codebox Plus

p1 = 0x870303
p2 = 0x850101
p3 = 0x7F0201
p4 = 0x870302
p5 = 0xFF0000
p6 = 0x790000
p7 = 0x7D0100
p8 = 0x7F0404
p9 = 0x790000



Image

The followings are the codes i found on this forum and edited with my amateur coding knowledge...

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



TL;DR Looking for a way to create a left mouse button click trigger bot under the condition that all 9 colored pixels are scanned successfully at the same time.

Any help and suggestions are greatly appreciated, and please forgive my english as a foreign speaker:) Thanks all and have a nice day.

Harry
MaxAstro
Posts: 541
Joined: 05 Oct 2016, 13:00

Re: How to triggerbot with multiple pixel images under certain condition syntax...

18 May 2018, 09:58

My first guess is that your if statements are not blocked correctly. Put the expression in parenthesis and add a { to the end of each, like this: If (Errorlevel = 0) { Then, after the mouse click, add this: }}}}}}}}}}}}}}}}}}
swagfag
Posts: 532
Joined: 11 Jan 2017, 17:59

Re: How to triggerbot with multiple pixel images under certain condition syntax...

18 May 2018, 10:27

Are these reddish pixels scattered all over the screen or are they as they appear on the image you provided, ie 3x3 matrix?

If the latter is the case, why not make a single .png consisting of those 3x3 pixels, make a single call to ImageSearch and use the image as the haystack?

Unless there's something I'm heavily misunderstanding...

Return to “Ask For Help”

Who is online

Users browsing this forum: llinfeng and 24 guests