Jump to content

Improving my first script


pnut
 Share

Recommended Posts

Hey there I've just made a script that clicks randomly around the screen and pressing Alt+Q at the same time. Having this done, I felt a sense of achievement for myself. I would like some ideas for improvements like a GUI. ;) This script is pretty basic -

#notrayicon
HotKeySet("{F11}", "_exit")
$delay = 500
Break(0)
While 1
Sleep($delay)
MouseMove(Random(0, @DesktopWidth), Random(0, @DesktopHeight), 0)
Send("ALTQ")
Sleep($delay)
WEnd
Func _exit()
Break(1)
Exit
EndFunc

If possible i want the script to continuously click ALT+Q while clicking the screen at 0.5 second interval.

Much thanks from me :whistle:

Link to comment
Share on other sites

use the autoit window info that comes with autoit or run this

press the home key and it will copy the coords to the clipboard in the format x,y

HotKeySet("{Home}","capture")
HotKeySet("{Esc}","quit")
While 1
    Sleep(25)
    $pos = MouseGetPos()
    ToolTip("x = " & $pos[0] & "," & "y = " & $pos[1],$pos[0] + 10,$pos[1] + 10)
WEnd

Func capture()
    ClipPut($pos[0] & "," & $pos[1])
EndFunc

Func quit()
    Exit
EndFunc
Link to comment
Share on other sites

Hey thanks man.

Btw i made a new script-

#notrayicon
HotKeySet("{F11}", "_exit")
Break(0)
While 1
MouseClick("left")
Sleep(200)
Send ("!q")
WEnd
Func _exit()
Break(1)
Exit
EndFunc

Basically its something to prevent me from getting kicked in a game for being inactive.

I'd like to know how can i make the script run without even playing the game. For example, i run the script and i do not have to switch to my game screen for it to work. Probably it require WaitWinActive function but i don't know how to use it.

I'm asking this as i have to be away in a game doing projects with my friends.

Thanks again :whistle:

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