Essentially, the active window will keep falling until it hits the Y cord 700, and it will just stop. That's the idea at least.
(Eventually, I will make it not hardcoded to 700, but that's after I get help with this issue.)
However, there's a problem, which I got no idea how to fix:
Once the active window reaches the Y cord 700, it just keeps going, rather than stopping in place.
Here's my code:
Code: Select all
ScriptName = GRAVITY SCRIPT
InputRestriction = false
SetBatchLines, -1
SetWinDelay, 0
GRAVITY = 1
while true
{
if InputRestriction = true
{
WinGetActiveStats, Title, Width, Height, X, Y
WinWait, %Title%
if(%Y% + 1 <= 700)
{
WinMove, WinGetPos X, WinGetPos Y + 1
}
}
}
; debug stuff, irrelevant
~Esc::
KeyWait, Esc
if InputRestriction = true
{
InputRestriction = false
MsgString := "Script is paused."
MsgBox, 0, %ScriptName%, %MsgString%
}
else if InputRestriction = false
{
InputRestriction = true
MsgString := "Script is resumed."
MsgBox, 0, %ScriptName%, %MsgString%
}
return
~Left::
KeyWait, Left
WinGetActiveStats, Title, Width, Height, X, Y
MsgBox, %X% %Y%
return