Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Script for multiwindows clicking


  • Please log in to reply
2 replies to this topic
Longerion
  • Members
  • 1 posts
  • Last active: Nov 12 2015 11:23 PM
  • Joined: 30 Oct 2015
Hello i tried improve my script by making it take position of mouse while pressing F9 and repeating this click in seven other windows. It doesn't even starts :(


#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
F1:: WinActivate, Misisi
F2:: WinActivate, Axjo
F3:: WinActivate, Grafted
F4:: WinActivate, Luccyj
F5:: WinActivate, Gangbank
F6:: WinActivate, Morrdi
F7:: WinActivate, Aziz
F8:: WinActivate, Bazzingi

F9:: MouseGetPos, xpos, ypos
ControlClick, %x%,%y%, Ziobereq,, Left, 1
ControlClick, %x%,%y%, Stary-Koder,, Left, 1
ControlClick, %x%,%y%, Grafted,, Left, 1
ControlClick, %x%,%y%, Luccyj,, Left, 1
ControlClick, %x%,%y%, Gangbank,, Left, 1
ControlClick, %x%,%y%, Morrdi,, Left, 1
ControlClick, %x%,%y%, Aziz,, Left, 1
ControlClick, %x%,%y%, Bazzingi,, Left, 1






Shadowpheonix
  • Members
  • 268 posts
  • Last active:
  • Joined: 10 Feb 2014

X and Y are not defined anywhere, so all of your ControlClick, %x%,%y% commands are clicking at 0,0.  I assume you meant to use ControlClick, %xpos%,%ypos% instead.

 Also, placing code on the line after the hotkey can cause issues if there are multiple lines for that section.  In addition, I recommend added a Return at the end of that section for F9.

 

In other words, try this instead...

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.

; #Warn  ; Enable warnings to assist with detecting common errors.

SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.

SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

F1:: WinActivate, Misisi

F2:: WinActivate, Axjo

F3:: WinActivate, Grafted

F4:: WinActivate, Luccyj

F5:: WinActivate, Gangbank

F6:: WinActivate, Morrdi

F7:: WinActivate, Aziz

F8:: WinActivate, Bazzingi

F9::
MouseGetPos, xpos, ypos
ControlClick, %xpos%,%ypos%, Ziobereq,, Left, 1
ControlClick, %xpos%,%ypos%, Stary-Koder,, Left, 1
ControlClick, %xpos%,%ypos%, Grafted,, Left, 1
ControlClick, %xpos%,%ypos%, Luccyj,, Left, 1
ControlClick, %xpos%,%ypos%, Gangbank,, Left, 1
ControlClick, %xpos%,%ypos%, Morrdi,, Left, 1
ControlClick, %xpos%,%ypos%, Aziz,, Left, 1
ControlClick, %xpos%,%ypos%, Bazzingi,, Left, 1
Return



Exaskryz
  • Members
  • 3249 posts
  • Last active: Nov 20 2015 05:30 AM
  • Joined: 23 Aug 2012

Additionally, every single one of your hotkeys are a single line hotkey. F1-8 are doing a window activation only. F9 is getting a mouse position and storing it in xpos and ypos, only. None of your control clicks are executing.

 

Make your F9 hotkey multi-lined by putting the first command on a line underneath F9::. Do Shadowpheonix's suggested change, and hopefully it'll all work.