I tried using GuiControl to change the text, instead of making and deleting multiple, but it wouldn't replicate the entire text for some reason. Instead of reading "V Formation" It would just say "V"
My main goal is to improve the rate at which clicks occur. I assume MouseMove is a bit intensive, so it takes longer than instantly clicking it, but the easiest way I was able to create the formations needed for my troops was to use relative positioning.
Any thoughts/tips would be appreciated. Thanks!
Code: Select all
RelativeClick(rX := 0, rY := 0) {
MouseMove, %rX%, %rY%,0, R
Click
Click
}
Form = Circle
Active = false
Moving = false
+left::
if (Active = false)
{
Form = V
Active = true
Gui, -Caption +AlwaysOnTop +Owner +LastFound +E0x20
WinSet, TransColor, 1
Gui, Color, 1
Gui, Font, s25 w700 q4, Times New Roman
Gui, Add, Text, vFormationVar, %Form% Formation
Gui, Show, NoActivate
WinMove,0,0
sleep, 1500
Gui, Destroy
GuiControl,, FormationVar, %Form% Formation
Active = false
}
return
+up::
if (Active = false)
{
Form = Wedge
Active = true
Gui, -Caption +AlwaysOnTop +Owner +LastFound +E0x20
WinSet, TransColor, 1
Gui, Color, 1
Gui, Font, s25 w700 q4, Times New Roman
Gui, Add, Text, vFormationVar, %Form% Formation
Gui, Show, NoActivate
WinMove,0,0
sleep, 1500
Gui, Destroy
GuiControl,, FormationVar, %Form% Formation
Active = false
}
return
+right::
if (Active = false)
{
Form = Square
Active = true
Gui, -Caption +AlwaysOnTop +Owner +LastFound +E0x20
WinSet, TransColor, 1
Gui, Color, 1
Gui, Font, s25 w700 q4, Times New Roman
Gui, Add, Text, vFormationVar, %Form% Formation
Gui, Show, NoActivate
WinMove,0,0
sleep, 1500
Gui, Destroy
GuiControl,, FormationVar, %Form% Formation
Active = false
}
return
+down::
if (Active = false)
{
Form = Circle
Active = true
Gui, -Caption +AlwaysOnTop +Owner +LastFound +E0x20
WinSet, TransColor, 1
Gui, Color, 1
Gui, Font, s25 w700 q4, Times New Roman
Gui, Add, Text, vFormationVar, %Form% Formation
Gui, Show, NoActivate
WinMove,0,0
sleep, 1500
Gui, Destroy
GuiControl,, FormationVar, %Form% Formation
Active = false
}
return
up::
if (Moving = false)
Moving = true
if (Form = "Wedge")
{
MouseGetPos, X, Y
SendInput, {1}
RelativeClick(-60, -120)
SendInput, {2}
RelativeClick(120, 0)
SendInput, {3}
RelativeClick(-180, 120)
SendInput, {4}
RelativeClick(120, 0)
SendInput, {5}
RelativeClick(120, 0)
SendInput, {6}
RelativeClick(-360, 120)
SendInput, {7}
RelativeClick(120, 0)
SendInput, {8}
RelativeClick(120, 0)
SendInput, {9}
RelativeClick(120, 0)
SendInput, {0}
RelativeClick(120, 0)
SendInput, {0}
MouseMove, X, Y,
}
else if (Form = "Square")
{
MouseGetPos, X, Y
SendInput, {1}
RelativeClick(-120, -120)
SendInput, {2}
RelativeClick(240, 0)
SendInput, {3}
RelativeClick(-360, 120)
SendInput, {4}
RelativeClick(240, 0)
SendInput, {5}
RelativeClick(240, 0)
SendInput, {6}
RelativeClick(-480, 120)
SendInput, {7}
RelativeClick(120, 0)
SendInput, {8}
RelativeClick(120, 0)
SendInput, {9}
RelativeClick(120, 0)
SendInput, {0}
RelativeClick(120, 0)
SendInput, {0}
MouseMove, X, Y,
}
else if (Form = "V")
{
MouseGetPos, X, Y
SendInput, {1}
RelativeClick(-60, -60)
SendInput, {2}
RelativeClick(60, 0)
SendInput, {3}
RelativeClick(-120, 60)
SendInput, {7}
RelativeClick(180, 0)
SendInput, {5}
RelativeClick(-240, 60)
SendInput, {6}
RelativeClick(300, 0)
SendInput, {4}
RelativeClick(-360, 60)
SendInput, {8}
RelativeClick(420, 0)
SendInput, {9}
RelativeClick(-480, 60)
SendInput, {0}
RelativeClick(540, 0)
SendInput, {0}
MouseMove, X, Y,
}
else if (Form = "Circle")
{
MouseGetPos, X, Y
SendInput, {4}
RelativeClick(0, -30)
SendInput, {8}
RelativeClick(0, 60)
SendInput, {1}
RelativeClick(0, 90)
SendInput, {2}
RelativeClick(0, -240)
SendInput, {3}
RelativeClick(120, 120)
SendInput, {5}
RelativeClick(-240, 0)
SendInput, {6}
RelativeClick(35.147, 84.853)
SendInput, {7}
RelativeClick(169.706, 0)
SendInput, {9}
RelativeClick(0, -169.706)
SendInput, {0}
RelativeClick(-169.706, 0)
SendInput, {0}
MouseMove, X, Y,
}
Moving = false
return
down::
if (Moving = false)
Moving = true
if (Form = "Wedge")
{
MouseGetPos, X, Y
SendInput, {1}
RelativeClick(-60, 120)
SendInput, {2}
RelativeClick(120, 0)
SendInput, {3}
RelativeClick(-180, -120)
SendInput, {4}
RelativeClick(120, 0)
SendInput, {5}
RelativeClick(120, 0)
SendInput, {6}
RelativeClick(-360, -120)
SendInput, {7}
RelativeClick(120, 0)
SendInput, {8}
RelativeClick(120, 0)
SendInput, {9}
RelativeClick(120, 0)
SendInput, {0}
RelativeClick(120, 0)
SendInput, {0}
MouseMove, X, Y,
}
else if (Form = "Square")
{
MouseGetPos, X, Y
SendInput, {1}
RelativeClick(-120, 120)
SendInput, {2}
RelativeClick(240, 0)
SendInput, {3}
RelativeClick(-360, -120)
SendInput, {4}
RelativeClick(240, 0)
SendInput, {5}
RelativeClick(240, 0)
SendInput, {6}
RelativeClick(-480, -120)
SendInput, {7}
RelativeClick(120, 0)
SendInput, {8}
RelativeClick(120, 0)
SendInput, {9}
RelativeClick(120, 0)
SendInput, {0}
RelativeClick(120, 0)
SendInput, {0}
MouseMove, X, Y,
}
else if (Form = "V")
{
MouseGetPos, X, Y
SendInput, {1}
RelativeClick(-60, 60)
SendInput, {2}
RelativeClick(60, 0)
SendInput, {3}
RelativeClick(-120, -60)
SendInput, {7}
RelativeClick(180, 0)
SendInput, {5}
RelativeClick(-240, -60)
SendInput, {6}
RelativeClick(300, 0)
SendInput, {4}
RelativeClick(-360, -60)
SendInput, {8}
RelativeClick(420, 0)
SendInput, {9}
RelativeClick(-480, -60)
SendInput, {0}
RelativeClick(540, 0)
SendInput, {0}
MouseMove, X, Y,
}
else if (Form = "Circle")
{
MouseGetPos, X, Y
SendInput, {4}
RelativeClick(0, -30)
SendInput, {8}
RelativeClick(0, 60)
SendInput, {1}
RelativeClick(0, 90)
SendInput, {2}
RelativeClick(0, -240)
SendInput, {3}
RelativeClick(120, 120)
SendInput, {5}
RelativeClick(-240, 0)
SendInput, {6}
RelativeClick(35.147, 84.853)
SendInput, {7}
RelativeClick(169.706, 0)
SendInput, {9}
RelativeClick(0, -169.706)
SendInput, {0}
RelativeClick(-169.706, 0)
SendInput, {0}
MouseMove, X, Y,
}
Moving = false
return
left::
if (Moving = false)
Moving = true
if (Form = "Wedge")
{
MouseGetPos, X, Y
SendInput, {1}
RelativeClick(-120, -60)
SendInput, {2}
RelativeClick(0, 120)
SendInput, {3}
RelativeClick(120, -180)
SendInput, {4}
RelativeClick(0, 120)
SendInput, {5}
RelativeClick(0, 120)
SendInput, {6}
RelativeClick(120, -360)
SendInput, {7}
RelativeClick(0, 120)
SendInput, {8}
RelativeClick(0, 120)
SendInput, {9}
RelativeClick(0, 120)
SendInput, {0}
RelativeClick(0, 120)
SendInput, {0}
MouseMove, X, Y,
}
else if (Form = "Square")
{
MouseGetPos, X, Y
SendInput, {1}
RelativeClick(-120, -120)
SendInput, {2}
RelativeClick(0, 240)
SendInput, {3}
RelativeClick(120, -360)
SendInput, {4}
RelativeClick(0, 240)
SendInput, {5}
RelativeClick(0, 240)
SendInput, {6}
RelativeClick(120, -480)
SendInput, {7}
RelativeClick(0, 120)
SendInput, {8}
RelativeClick(0, 120)
SendInput, {9}
RelativeClick(0, 120)
SendInput, {0}
RelativeClick(0, 120)
SendInput, {0}
MouseMove, X, Y,
}
else if (Form = "V")
{
MouseGetPos, X, Y
SendInput, {1}
RelativeClick(-60, -60)
SendInput, {2}
RelativeClick(0, 60)
SendInput, {3}
RelativeClick(60, -120)
SendInput, {7}
RelativeClick(0, 180)
SendInput, {5}
RelativeClick(60, -240)
SendInput, {6}
RelativeClick(0, 300)
SendInput, {4}
RelativeClick(60, -360)
SendInput, {8}
RelativeClick(0, 420)
SendInput, {9}
RelativeClick(60, -480)
SendInput, {0}
RelativeClick(0, 540)
SendInput, {0}
MouseMove, X, Y,
}
else if (Form = "Circle")
{
MouseGetPos, X, Y
SendInput, {4}
RelativeClick(-30, 0)
SendInput, {8}
RelativeClick(60, 0)
SendInput, {1}
RelativeClick(90, 0)
SendInput, {2}
RelativeClick(-240, 0)
SendInput, {3}
RelativeClick(120, 120)
SendInput, {5}
RelativeClick(0, -240)
SendInput, {6}
RelativeClick(84.853, 35.147)
SendInput, {7}
RelativeClick(0, 169.706)
SendInput, {9}
RelativeClick(-169.706, 0)
SendInput, {0}
RelativeClick(0, -169.706)
SendInput, {0}
MouseMove, X, Y,
}
Moving = false
return
right::
if (Moving = false)
Moving = true
if (Form = "Wedge")
{
MouseGetPos, X, Y
SendInput, {1}
RelativeClick(120, -60)
SendInput, {2}
RelativeClick(0, 120)
SendInput, {3}
RelativeClick(-120, -180)
SendInput, {4}
RelativeClick(0, 120)
SendInput, {5}
RelativeClick(0, 120)
SendInput, {6}
RelativeClick(-120, -360)
SendInput, {7}
RelativeClick(0, 120)
SendInput, {8}
RelativeClick(0, 120)
SendInput, {9}
RelativeClick(0, 120)
SendInput, {0}
RelativeClick(0, 120)
SendInput, {0}
MouseMove, X, Y,
}
else if (Form = "Square")
{
MouseGetPos, X, Y
SendInput, {1}
RelativeClick(120, -120)
SendInput, {2}
RelativeClick(0, 240)
SendInput, {3}
RelativeClick(-120, -360)
SendInput, {4}
RelativeClick(0, 240)
SendInput, {5}
RelativeClick(0, 240)
SendInput, {6}
RelativeClick(-120, -480)
SendInput, {7}
RelativeClick(0, 120)
SendInput, {8}
RelativeClick(0, 120)
SendInput, {9}
RelativeClick(0, 120)
SendInput, {0}
RelativeClick(0, 120)
SendInput, {0}
MouseMove, X, Y,
}
else if (Form = "V")
{
MouseGetPos, X, Y
SendInput, {1}
RelativeClick(60, -60)
SendInput, {2}
RelativeClick(0, 60)
SendInput, {3}
RelativeClick(-60, -120)
SendInput, {7}
RelativeClick(0, 180)
SendInput, {5}
RelativeClick(-60, -240)
SendInput, {6}
RelativeClick(0, 300)
SendInput, {4}
RelativeClick(-60, -360)
SendInput, {8}
RelativeClick(0, 420)
SendInput, {9}
RelativeClick(-60, -480)
SendInput, {0}
RelativeClick(0, 540)
SendInput, {0}
MouseMove, X, Y,
}
else if (Form = "Circle")
{
MouseGetPos, X, Y
SendInput, {4}
RelativeClick(-30, 0)
SendInput, {8}
RelativeClick(60, 0)
SendInput, {1}
RelativeClick(90, 0)
SendInput, {2}
RelativeClick(-240, 0)
SendInput, {3}
RelativeClick(120, 120)
SendInput, {5}
RelativeClick(0, -240)
SendInput, {6}
RelativeClick(84.853, 35.147)
SendInput, {7}
RelativeClick(0, 169.706)
SendInput, {9}
RelativeClick(-169.706, 0)
SendInput, {0}
RelativeClick(0, -169.706)
SendInput, {0}
MouseMove, X, Y,
}
Moving = false
return