Need Help In cocoa bean script for hypixel skyblock

Ask gaming related questions (AHK v1.1 and older)
xander11222
Posts: 3
Joined: 03 Jul 2022, 12:05

Need Help In cocoa bean script for hypixel skyblock

Post by xander11222 » 03 Jul 2022, 12:28

Hi everyone i am trying to make is so when "0" is pressed it will press "A" key "W" key and "left mouse click" button at the same time and after 32 seconds it will press the "D" key for 1 second and after that it will press "D", "S" and "left mouse click" and after 32 seconds it will loop back to "A", "W" and "left mouse click", and so on and so forth, and i also need when "9" is pressed everything will stop, really sorry if the help request is way too long but it will be really helpful if any of you can help me :)

User avatar
mikeyww
Posts: 26889
Joined: 09 Sep 2014, 18:38

Re: Need Help In cocoa bean script for hypixel skyblock

Post by mikeyww » 03 Jul 2022, 14:00

Welcome to this AutoHotkey forum!

Code: Select all

9::
on := False
SoundBeep, 1000
Return

0::
SoundBeep, 1500
on := True
While on {
 Send {a down}{w down}{LButton}{w up}{a up}
 Loop, 64
  Sleep, 500 * on
 Send % on ? "{d down}" : ""
 Loop, 2
  Sleep, 500 * on
 Send % "{d up}" (on ? "ds{LButton}" : "")
 Loop, 64
  Sleep, 500 * on
}
Return

xander11222
Posts: 3
Joined: 03 Jul 2022, 12:05

Re: Need Help In cocoa bean script for hypixel skyblock

Post by xander11222 » 03 Jul 2022, 14:49

@mikeyww
im very sorry that i didnt clarify this in the post, when i said pressed i meant as in contiously being pressed for 32 seconds

User avatar
mikeyww
Posts: 26889
Joined: 09 Sep 2014, 18:38

Re: Need Help In cocoa bean script for hypixel skyblock

Post by mikeyww » 03 Jul 2022, 15:12

You can adjust whatever you would like to send. See :arrow: Send. If you send a key, it will be sent both down and up. Otherwise, you can specify only up or down specifically, as shown in the script.

If you click on commands in the posted script, you can learn more about them.

The ternary ?: notation is shorthand for If... then... else.

xander11222
Posts: 3
Joined: 03 Jul 2022, 12:05

Re: Need Help In cocoa bean script for hypixel skyblock

Post by xander11222 » 03 Jul 2022, 15:33

@mikeyww
really sorry but i have 0 experience in coding even after reading all the reading up on all the commands im still quite confused to be honest with you, sorry if im taking your time with this

User avatar
mikeyww
Posts: 26889
Joined: 09 Sep 2014, 18:38

Re: Need Help In cocoa bean script for hypixel skyblock

Post by mikeyww » 03 Jul 2022, 17:03

Code: Select all

OnExit("reset")

9::
on := False
reset()
SoundBeep, 1000
Return

0::
SoundBeep, 1500
on := True
While on {
 hold(on, 32, "a", "w", "LButton")
 hold(on,  1, "d"                )
 hold(on, 32, "d", "s", "LButton")
}
Return

hold(on, sec, keyList*) {
 If !on
  Return
 For each, key in keyList
  Send {%key% down}
 Loop, % 2 * sec
  Sleep, 500 * on
 reset()
}

reset(exitReason := "", exitCode := "") {
 Send {a up}{w up}{d up}{s up}{LButton up}
}

Post Reply

Return to “Gaming Help (v1)”