Help - Perform action according to criteria

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
raphaelmca
Posts: 25
Joined: 19 Feb 2016, 08:32

Help - Perform action according to criteria

18 Jun 2016, 17:25

Good evening friends, I am trying to create a .ahk script but I'm having trouble , just not quite understand programming .

There is a sists that every 2 seconds , it displays a random number with a background color.

Sometimes the background color is green , sometimes the background color is red.

What I am trying to do is when I run the .ahk it works as follows .

When the site displays the number with red background the .ahk perform an action ( press the D key ) .

When the site displays the number with the green background the .ahk perform another action (press the U key )

is it possible to do that?
Marvin1023
Posts: 45
Joined: 10 Nov 2015, 12:49

Re: Help - Perform action according to criteria

18 Jun 2016, 18:19

Try this PixelSearch
Asus Maximus VIII Extrême - DDR4 16Go - Intel Core i7 - GTX 1080
raphaelmca
Posts: 25
Joined: 19 Feb 2016, 08:32

Re: Help - Perform action according to criteria

18 Jun 2016, 18:24

I looked , obligation for help .

But you could ride this .ahk script for me to check and edit what you need ?
Marvin1023
Posts: 45
Joined: 10 Nov 2015, 12:49

Re: Help - Perform action according to criteria

18 Jun 2016, 19:18

Code: Select all

upperLeftX := 75
upperLeftY := 80
lowerRightX := 200
lowerRightY := 200

Loop, 2
  {
    Sleep, 1000
    PixelSearch, Px, Py, %upperLeftX%, %upperLeftY%, %lowerRightX%, %lowerRightY%, 0x00FF00, 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%.


    Gui Color, 0x00FF00
    Gui -Caption
    Gui Show, y75 x80 w200 h200

  }
Return
Asus Maximus VIII Extrême - DDR4 16Go - Intel Core i7 - GTX 1080
raphaelmca
Posts: 25
Joined: 19 Feb 2016, 08:32

Re: Help - Perform action according to criteria

18 Jun 2016, 19:49

Marvin1023 wrote:

Code: Select all

upperLeftX := 75
upperLeftY := 80
lowerRightX := 200
lowerRightY := 200

Loop, 2
  {
    Sleep, 1000
    PixelSearch, Px, Py, %upperLeftX%, %upperLeftY%, %lowerRightX%, %lowerRightY%, 0x00FF00, 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%.


    Gui Color, 0x00FF00
    Gui -Caption
    Gui Show, y75 x80 w200 h200

  }
Return


Thank you my friend...

I'm trying to edit the script for the job that I want , but I'm having trouble .

In fact I would like it to take color and displayed on this site (red or blue) and every change that color , he hit a key (if he presses red "R" and if he presses blue "A")

https://www.binary.com/pt/trading.html? ... e=duration

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada, RickC and 171 guests