Jump to content
Sign in to follow this  

Need Help With Script

Recommended Posts


im too attached to old VB scripts :(, need help with a simple script, in my mind i'd figure it would look something like this, but i know the format is wrong, if someone can correct this for me, it would be great :P, thanks

func Start()

if 137, 1037 = colour ("0x347e99") then

timer = (random between 60sec - 240secs) *need help: dont know timer functions*

send "q"

else *need help: does not know the alternative word for else for autoit, only VB :lmao:*

AutoIt.MouseClick 231, 324 "right"

AutoIt.MouseClick 226, 625 "left"

AutoIt.MouseClick 231, 953 "left"


basically want to let my script detect a button, if that button is visible (reason for color detection), would like for a timer to set a random interval before hitting "Q"

if the button is not visible, then i would like the mouse to move to specific coordinates and to either right click or left click as specified

thanks in advance

Share this post

Link to post
Share on other sites

Opt("PixelCoordMode", 2); check Opt() in help file to see if you need a 0,1, or 2 here.
Opt("MouseCoordMode", 2);  check Opt() in help file to see if you need a 0,1, or 2 here.
Func Start
    Local $Color = 0x347E99
    Local $xStart = 137
    Local $yStart =;137 xcoord is put the y coord too from that location here. 
    Local $xFinish = 1037
    Local $yFinish =; 1037 xcorrd put y coord too from that location here.
    While 1
        $Search = PixelSearch($xStart, $yStart, $xFinish, $yFinish, $Color)
        If Not @error And IsArray($Search) Then
            MouseClick('Right', 231, 324, 1, 1)
            MouseClick('Left', 226, 625, 1, 1)
            MouseClick('Left', 231, 953, 1, 1)

If your using the AutoIt Dll, I'm not quite sure what you put infront of the options, but this should run in just autoit and do what you want.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.