Last active
October 20, 2018 14:08
-
-
Save ssgtcookie/b8b6611cfe498e9ba06a06ee69ef9102 to your computer and use it in GitHub Desktop.
Can be used to reset roles assigned to you. Works with the discord.exe client.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^+\:: | |
DiscordServer = https://discord.gg/z8qBSAP | |
CountToGoDownWhenServerIsRejoined = 7 | |
; Get current mouse position and activate discord | |
MouseGetPos, xcur, ycur | |
WinActivate, ahk_exe Discord.exe | |
; Leave server | |
MouseMove, 150, 50, 0 | |
MouseClick, left | |
MouseMove, 0, 210, 2, R | |
MouseClick, left | |
send {Enter} | |
; Join server | |
send, ^+n | |
sleep, 400 | |
PixelSearch, Px, Py, 0, 0, 1200, 700, 0x3CA374, 0, Fast RGB | |
if ErrorLevel | |
MsgBox, That color was not found in the specified region. | |
else | |
MouseMove, %Px%, %Py%, 0 | |
MouseClick, left | |
MouseMove, %xcur%, %ycur%, 0 ; Return mouse to starting position | |
send %DiscordServer% | |
send, {Enter} | |
sleep, 1000 | |
; Go to general-but-legal | |
Loop, %CountToGoDownWhenServerIsRejoined% | |
{ | |
send {LAlt down}{Down}{LAlt up} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^+\:: | |
Loop{ | |
PixelSearch, Ax, Ay, 750, 990, 751, 991, 0x3E4147, 0, Fast RGB | |
if !ErrorLevel | |
RejoinServer() | |
sleep, 1000 | |
} | |
RejoinServer(){ | |
DiscordServer = https://discord.gg/z8qBSAP | |
CountToGoDownWhenServerIsRejoined = 8 | |
; Get current mouse position and activate discord | |
MouseGetPos, xcur, ycur | |
WinActivate, ahk_exe Discord.exe | |
; Leave server | |
MouseMove, 150, 50, 0 | |
MouseClick, left | |
MouseMove, 0, 210, 2, R | |
MouseClick, left | |
send {Enter} | |
; Join server | |
send, ^+n | |
sleep, 400 | |
PixelSearch, Px, Py, 0, 0, 1200, 700, 0x3CA374, 0, Fast RGB | |
if ErrorLevel | |
MsgBox, That color was not found in the specified region. | |
else | |
MouseMove, %Px%, %Py%, 0 | |
MouseClick, left | |
MouseMove, %xcur%, %ycur%, 0 ; Return mouse to starting position | |
send %DiscordServer% | |
send, {Enter} | |
sleep, 1000 | |
; Go to general-but-legal | |
Loop, %CountToGoDownWhenServerIsRejoined% | |
{ | |
send {LAlt down}{Down}{LAlt up} | |
} | |
} | |
Author
ssgtcookie
commented
Aug 30, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment