Jump to content

how do i make a if colour command


Guest nubbins
 Share

Recommended Posts

Guest nubbins

hey guys, im kind of new to basic, i got refered to autoit by a friend. I already have a script from another macro program called AC tools and i need help translating it into basic :D

heres the code:

loop 999999999
  delay 50

  constants
    1 = 40
    2 = 50
    1sum =
    2sum =
  end
  
  compute 1sum = TRUNC(1.25 * $1 + 230)
  compute 2sum = TRUNC(1.25 * $2 + 456)
  
  if {activewindow} = Untitled, notepad
    isblack $1sum, 562
      loop 25
        keys {return}
      end
      isblack $2sum, 561
        loop 5
          keys {return}
        end
      end
    end
  else
    stop
  end
end

it basicly checks to see if the active window is "untitled, notepad" and if it is, it checks the colour of a pixel and if the colour of the pixel is black return is pressed 25 times then goes on to check if another pixel is black and if it is return is pressed 5 times. then does it all again in the next loop.

if the active window isnt "untitled, notepad" the string just stops.

if the first pixel isnt black it doesnt do anything and just goes on to check the second pixel.

if the second pixel isnt black the string starts over again in the next loop.

im not really good at explaining things so sorry if it isnt clear :)

thx in advance :D

Edited by nubbins
Link to comment
Share on other sites

hey guys, im kind of new to basic, i got refered to autoit by a friend. I already have a script from another macro program called AC tools and i need help translating it into basic  :D 

heres the code:

<...>

it basicly checks to see if the active window is "untitled, notepad" and if it is, it checks  the colour of a pixel and if the colour of the pixel is black return is pressed 25 times then goes on to check if another pixel is black and if it is return is pressed 5 times. then does it all again in the next loop.

if the active window isnt "untitled, notepad" the string just stops.

if the first pixel isnt black it doesnt do anything and just goes on to check the second pixel.

if the second pixel isnt black the string starts over again in the next loop.

im not really good at explaining things so sorry if it isnt clear  :)

thx in advance  :D

<{POST_SNAPBACK}>

Look in the help file for:
  • PixelSearch()
  • WinWait()
  • While/WEnd
  • WinActivate
  • Send()
Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...