Can you help me achieve my goal? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
erikgds
Posts: 23
Joined: 27 Feb 2021, 19:26

Can you help me achieve my goal?

02 Aug 2021, 21:59

Hey guys :D , I made this script below, and I would like some help, so that it executes the function written in a random way, because it currently follows the sequence I wrote, I would like it to run the script with the same coordinates but one random form

Code: Select all

PgDn::

SetMouseDelay, 1,5
SetKeyDelay, 0
SetDefaultMouseSpeed, 0
MouseGetPos, StartX, StartY

Send +{Click 707, 351, right}  
Send +{Click 783, 359, right}
Send +{Click 860, 352, right}
Send +{Click 862, 426, right} 
Send +{Click 860, 502, right}
Send +{Click 786, 506, right}
Send +{Click 709, 501, right}
Send +{Click 707, 425, right}
Send +{Click 784, 425, right}
MouseMove, StartX, StartY
User avatar
Smile_
Posts: 858
Joined: 03 May 2020, 00:51

Re: Can you help me achieve my goal?  Topic is solved

02 Aug 2021, 23:49

Code: Select all

SetMouseDelay, 1,5
SetKeyDelay, 0
SetDefaultMouseSpeed, 0
CoordMode, Mouse, Screen

Positions := [ ["707","351"]
             , ["783","359"]
             , ["860","352"]
             , ["862","426"]
             , ["860","502"]
             , ["786","506"]
             , ["709","501"]
             , ["707","425"]
             , ["784","425"] ]

PgDn::
    GenSeq := "", Max := Positions.Length()
    MouseGetPos, StartX, StartY
    While (StrLen(GenSeq) < Max) {
        Random, Rdm, 1, Max
        If !InStr(GenSeq, Rdm) {
            Send, % "+{Click " Positions[Rdm][1] "," Positions[Rdm][2] ", Right}"
            GenSeq .= Rdm
        }
    }
    MouseMove, StartX, StartY
Return

Esc::ExitApp

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Billykid, dinodragon, mcd and 161 guests