Help with a script

Get help with using AutoHotkey and its commands and hotkeys
Guest

Help with a script

07 Aug 2017, 19:35

Im having some difficulty with my code.

I've been trying to get this script to run in the background but with 0 luck.

Code: Select all

if !GetKeyState("Numlock","T") ; whether capslock is on or off
 {
  tooltip ; if off, don't show tooltip at all.
 }
 else
 { ; if on
 CoordMode, ToolTip, Screen
 tooltip My AHK is active, 0, 0
 WinActivate, Program name
 sleep 500
 WinWaitActive, Program name
 sleep 1000
 MouseClick, left, 1675, 45
 sleep 1000
 MouseClick, left, 810 ,370
 sleep 1500
 MouseClick, left, 990 ,808
 sleep 1500
 MouseClick, right, 835 ,515
 sleep 500
 MouseClick, left, 825 ,620
 sleep 1000
 Send {Escape Down}
 sleep 50
 Send {Escape Up}
 sleep 1500
 MouseClick, left, 1600, 710
 sleep 1000
 Send {Space Down}
 sleep 50
 Send {Space Up}
 sleep 52000
 return
 }
return
If anyone could show me how to make it run in the background, i would be very greatful
User avatar
Cerberus
Posts: 169
Joined: 12 Jan 2016, 15:46

Re: Help with a script

07 Aug 2017, 20:20

Can you explain what the purpose of this script is, exactly? What problem is it supposed to solve? If we don't know what it should do, we can't make it do that. I get the feeling that this is only part of script at a glance.

By what actions should all those clicks and keypresses be triggered? Should they all be executed once when you double-click the script, then stop? Or should everything be repeated every 10 minutes? Or what?
neomulemi6
Posts: 216
Joined: 30 Jun 2016, 06:01

Re: Help with a script

07 Aug 2017, 22:41

You need ControlClick and ControlSend to send commands/clicks to a window in the background.
User avatar
Exaskryz
Posts: 2876
Joined: 17 Oct 2015, 20:28

Re: Help with a script

07 Aug 2017, 23:22

Look into #Persistent and SetTimer, and even auto-execute. It may also be useful to look at the Hotkeys documentation just for educational purposes.

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], mikeyww, SimmoF and 31 guests