my project Topic is solved

Ask gaming related questions
jeik2

my project

27 Jan 2016, 16:16

hello guys. Before I dive into this project, I vould appreciate Your opinions if its doable?
Thank You and have a nice day.


I plan to make a sript that has following functions:

1) Read(scan), 10 small, areas of a gamescreen looking for a specific color

2) Make a decision based on 2 of the aboved area positions

3) Make a decision baded on 8 of the above area positions

4)
Click and hold down a keyboard key a certain time
Click and hold down another keyboard key a certain time

5)
Release a key
Release another key

6)
goto 1)
jeik
Posts: 14
Joined: 27 Jan 2016, 15:54

Re: my project

27 Jan 2016, 16:47

PixelSearch, OutputVarX, OutputVarY, X1, Y1, X2, Y2, ColorID [, Variation, Fast|RGB]

PixelSearch, Px, Py, 200, 200, 300, 300, 0x9d6346, 3, Fast
if ErrorLevel
MsgBox, That color was not found in the specified region.
else
MsgBox, A color within 3 shades of variation was found at X%Px% Y%Py%.

--------------

if (A_Index > 100 or Done)
return

-------------

Send {b down}{b up}
Send {TAB down}{TAB up}
Send {Up down} ; Press down the up-arrow key.
Sleep 1000 ; Keep it down for one second.
Send {Up up} ; Release the up-arrow key.
wizardzedd
Posts: 319
Joined: 23 Jan 2016, 23:03

Re: my project

27 Jan 2016, 18:04

Is it possible? sure. You can do 10 pixel searches and then do something with the results. Pressing keys is generally an easy thing for auto hot key. I say generally because there are some exceptions. How difficult it will be? Depends on your situation. I would recommend setting up a few pixel debugging tools to help yourself out. Sometimes games make it quite difficult to obtain reliable results, and I have found that doing things off of pixelcolor always to be a little more unreliable. However in games this is often your only option short of hacking into their system.
jeik
Posts: 14
Joined: 27 Jan 2016, 15:54

Re: my project

28 Jan 2016, 05:43

wizardzedd wrote:Is it possible? sure. You can do 10 pixel searches and then do something with the results. Pressing keys is generally an easy thing for auto hot key. I say generally because there are some exceptions. How difficult it will be? Depends on your situation. I would recommend setting up a few pixel debugging tools to help yourself out. Sometimes games make it quite difficult to obtain reliable results, and I have found that doing things off of pixelcolor always to be a little more unreliable. However in games this is often your only option short of hacking into their system.
hi,thanks for reply.

The game doesnt show mousepointer :)

I did take screenshots and then loaded shots into photoshop where I picked colorvalue and position(s) for the pixels I want.

Its a stable rgb colorvalue that doesnt seeme to change. I will soon find out if its doable as soon as Ive read more of the frame of script.

What Im quite uncertain of is how fast the scriptfunctions for reading colorvalue from screen, for single or area, is ?

regards
TheEnemy
Posts: 94
Joined: 28 Jan 2016, 09:54

Re: my project

28 Jan 2016, 10:17

If you are wanting to click the screen in specific locations I recommend putting this at the top of your script

Coordmode, Pixel, Screen
Coordmode, Mouse, Screen
Coordmode, Tooltip, Screen

And if you are wanting to do like a long press with the mouse, this works for my application. Adjust the coordinates and sleep as needed.

mousemove, X, Y
Click left down
Sleep 600
Click left up
jeik
Posts: 14
Joined: 27 Jan 2016, 15:54

Re: my project  Topic is solved

28 Jan 2016, 17:00

hi all and thanks for answers. I try the below code, but doesnt get any hit for colorvalue f6f6f6 (hex)

Any suggestions? Thanks.

Code: Select all


!j::    ;start script when alt+j clicked

color=000000   ;set initial value, hex, of color variable

 while (color!= f6f6f6) 
 {
 PixelGetColor, color, 100, 1017

 GetKeyState, state, f
           if state = D
                       {
                         break
                       }
 }

if (color = f6f6f6)
	                    {
						MsgBox blink!!!!
						}

jeik
Posts: 14
Joined: 27 Jan 2016, 15:54

Re: my project

28 Jan 2016, 17:02

TheEnemy wrote:If you are wanting to click the screen in specific locations I recommend putting this at the top of your script

Coordmode, Pixel, Screen
Coordmode, Mouse, Screen
Coordmode, Tooltip, Screen

And if you are wanting to do like a long press with the mouse, this works for my application. Adjust the coordinates and sleep as needed.

mousemove, X, Y
Click left down
Sleep 600
Click left up
Thanks :)

Return to “Gaming”

Who is online

Users browsing this forum: ewan-dixon, kevolusean and 16 guests