Jump to content

Need Help With Script


Twizzo
 Share

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"

EndFunc

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

Link to comment
Share on other sites

  • Moderators

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
        Sleep(10)
        $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)
        EndIf
    Wend
EndFunc

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.

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...