Minecraft AFKing simple script help Topic is solved

Ask gaming related questions
HARQUR
Posts: 12
Joined: 11 Jan 2021, 08:07

Minecraft AFKing simple script help

Post by HARQUR » 17 Jan 2021, 07:22

Ive been trying for hours :oops: :(

Here is a script for AFKing, moving you forward and backward so you aren't kicked for inactivity.
It has A GUI aswell.
I want alt + shift + m to toggle the loop, but not affect gui, but i need help, thank you.

Code: Select all

CustomColor = EEAA99
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, %CustomColor%
Gui, Font, s32 
Gui, Add, Text, vMyText cblue, Click Alt + Shift + Z to exit program
Gui, Add, Text, vMyText2 cblue, Click Alt + Shift + M to toggle mover
WinSet, TransColor, %CustomColor% 220
Gui, Show, x50 y50 NoActivate
return

loop
{
send w
sleep 500
send s
}

!+m::
Pause
return

!+z::
exit
return
User avatar
mikeyww
Posts: 5109
Joined: 09 Sep 2014, 18:38

Re: Minecraft AFKing simple script help

Post by mikeyww » 17 Jan 2021, 08:03

Code: Select all

#MaxThreadsPerHotkey 2
CustomColor = EEAA99
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, %CustomColor%
Gui, Font, s32 
Gui, Add, Text, vMyText cblue, Click Alt + Shift + Z to exit program
Gui, Add, Text, vMyText2 cblue, Click Alt + Shift + M to toggle mover
WinSet, TransColor, %CustomColor% 220
Gui, Show, x50 y50 NoActivate

!+m::
SoundBeep, (go := !go) ? 1500 : 1000, 30
While go {
 Send w
 Sleep, 500
 Send s
}
Return
HARQUR
Posts: 12
Joined: 11 Jan 2021, 08:07

Re: Minecraft AFKing simple script help

Post by HARQUR » 17 Jan 2021, 08:13

Thanks for the response, i added a way to exit the script, but my issue is, when i do Alt + Shift + m, the script only sometimes toggles.

Edit: I observed, probably accurately, that you have to do the entire hotkey between a burst of the two letters, to pause

Code: Select all

#MaxThreadsPerHotkey 2
CustomColor = EEAA99
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, %CustomColor%
Gui, Font, s32 
Gui, Add, Text, vMyText cblue, Click Alt + Shift + Z to exit program
Gui, Add, Text, vMyText2 cblue, Click Alt + Shift + M to toggle mover
WinSet, TransColor, %CustomColor% 220
Gui, Show, x50 y50 NoActivate

!+m::
SoundBeep, (go := !go) ? 1500 : 1000, 30
While go {
 Send w
 Sleep, 500
 Send s
 Sleep, 20
}
Return

!+z::
exit
Return
User avatar
mikeyww
Posts: 5109
Joined: 09 Sep 2014, 18:38

Re: Minecraft AFKing simple script help  Topic is solved

Post by mikeyww » 17 Jan 2021, 08:35

Yes, the loop generally completes before the next assessment. You can modify that if you insert a conditional "If go..." at any point inside the loop.

Or:

Code: Select all

#MaxThreadsPerHotkey 2
CustomColor = EEAA99
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, %CustomColor%
Gui, Font, s32 
Gui, Add, Text, vMyText cblue, Click Alt + Shift + Z to exit program
Gui, Add, Text, vMyText2 cblue, Click Alt + Shift + M to toggle mover
WinSet, TransColor, %CustomColor% 220
Gui, Show, x50 y50 NoActivate

!+m::
SoundBeep, (go := !go) ? 1500 : 1000, 30
While go {
 Send w
 Sleep, go ? 500 : 0
 Send % go ? "s" : ""
}
Return

!+z::ExitApp
Also: this current script requires that you release all of the keys before you press again. You can modify that if needed.
HARQUR
Posts: 12
Joined: 11 Jan 2021, 08:07

Re: Minecraft AFKing simple script help

Post by HARQUR » 17 Jan 2021, 09:23

Um, im a bit confused. So..is there anyway to make the alt + shift + m work not only sometimes
User avatar
mikeyww
Posts: 5109
Joined: 09 Sep 2014, 18:38

Re: Minecraft AFKing simple script help

Post by mikeyww » 17 Jan 2021, 09:45

Do you need to press it repeatedly without releasing the modifiers?
CR3ALITY
Posts: 21
Joined: 08 Nov 2020, 18:37

Re: Minecraft AFKing simple script help

Post by CR3ALITY » 17 Jan 2021, 23:02

Here's a script you can use, its AHK based.
https://github.com/monpjc/XAHK
HARQUR
Posts: 12
Joined: 11 Jan 2021, 08:07

Re: Minecraft AFKing simple script help

Post by HARQUR » 18 Jan 2021, 05:54

So I want s and w to be sent repeatedly, as it is already, thats fine, but i want to be able to toggle the loop on and off at any time, right now i have to wait till the sleep command is being executed, to to toggle the loop off.
HARQUR
Posts: 12
Joined: 11 Jan 2021, 08:07

Re: Minecraft AFKing simple script help

Post by HARQUR » 21 Jan 2021, 19:15

ok i will accept response given
Post Reply

Return to “Gaming”