Hello to you !
I would like to have a little help from you, I would like a script for the game Minecraft which allows that when I activate it ("P"), the player moves forward and sprints constantly ("A" and "Z") and the mouse moves to the right while looking at the sky, add to that, every 12 seconds, the "X" key executes.
I don't know if I was clear, but thank you!
Script for Minecraft :)
Re: Script for Minecraft :)
Welcome to this AutoHotkey forum! Ideas are below; adjust as needed.
If you are new to AHK, I recommend using its current version, which is v2, instead of this older deprecated version that is no longer developed.
Code: Select all
#Requires AutoHotkey v1.1.33.11
#MaxThreadsPerHotkey 2
SoundBeep 2500
SetKeyDelay 25, 25
SLOW := 0
p::
If on := !on {
SetTimer X, 12000
Loop {
SendEvent az
MouseMove 15, 0, SLOW, R
}
} Else Reload
Return
X:
SendEvent x
Return
Re: Script for Minecraft :)
@mikeyww
Hi ! Thank you for the welcome
Thanks for the script Just, the "A" and "Z" keys are not held down, I would like this to remain until the script is deactivated.
I also want to add a permanent left click if possible.
You could add notes on almost each line so that I understand how it works and its usefulness, the goal is also to learn, that interests me
Hi ! Thank you for the welcome
Thanks for the script Just, the "A" and "Z" keys are not held down, I would like this to remain until the script is deactivated.
I also want to add a permanent left click if possible.
You could add notes on almost each line so that I understand how it works and its usefulness, the goal is also to learn, that interests me
Re: Script for Minecraft :)
While the LButton is held, I think that the X is unlikely to be triggered or to be visible (I'm not sure which). Adjust to get what you want.
Code: Select all
#Requires AutoHotkey v1.1.33.11
#MaxThreadsPerHotkey 2
SLOW := 0 ; Speed of moving mouse cursor (0=fastest, 100=slowest)
p::
If !on := !on { ; Toggle off
SetTimer X, Off
SetTimer Move, Off
Send {LButton up}{z up}{a up} ; Reset
SoundBeep 1000
Return
}
; Toggle on
Send {a down}{z down}{LButton down}
SetTimer X, 12000 ; Call subroutine whenever timer expires
SetTimer Move, 50
Move:
MouseMove 15, 0, SLOW, R ; Move the mouse cursor 15 pixels to the right
Return
X:
SetKeyDelay 25, 25 ; Delay and press duration (ms)
SendEvent x ; Send a key
Return
Re: Script for Minecraft :)
@mikeyww
Oh ! Okay thanks you
If I want to add a system that ensures that every 5 seconds the t-chat opens with the "T" key then it says "/hub" then the enter key? While deactivating the functionality of the "p" key for the time to make the command, then does it reactivate?
Oh ! Okay thanks you
If I want to add a system that ensures that every 5 seconds the t-chat opens with the "T" key then it says "/hub" then the enter key? While deactivating the functionality of the "p" key for the time to make the command, then does it reactivate?
Re: Script for Minecraft :)
You can test these things to see what happens. Add a timer, add a Send command, etc.
Re: Script for Minecraft :)
Okay, but how can I disable and re-enable the script?
The X key also doesn't work
The X key also doesn't work
Re: Script for Minecraft :)
I have already mentioned that keys might not be sent as you expect them to be sent while a mouse button is down or held. You can test this in Notepad to see what happens. That would be a fast way to troubleshoot your script initially. How you disable the script will depend on exactly what you want the disabling to do, and when you want it to happen.
Who is online
Users browsing this forum: No registered users and 34 guests