Auto Hell Jacks (HJs)

Ask gaming related questions (AHK v1.1 and older)
AdamRadiance
Posts: 1
Joined: 26 Oct 2021, 03:01

Auto Hell Jacks (HJs)

26 Oct 2021, 03:10

Hi, I need a certain script made. In Roblox, most military games use Jumping Jacks (JJs) and Hell Jacks (HJs). I already have a script to automatically do JJs, but I am requesting one to be made for HJs. If you are unsure of what HJs are, I will provide an example and an explanation now.

HJs (Hell Jacks) are a jumping exercise used a lot in Roblox military games. What you do is: Type 1 letter of 1 number, press enter to send it and jump, send the next letter and jump, until you have finished spelling the word. Then, you say the full word and jump (all of this is in caps lock). It is like this:
/O
/N
/E
/ONE
/T
/W
/O

Basically, I need a script that does a sequence of pressing '/', then spelling the word by saying each letter, until it has spelt the word, then the whole world, all while pressing space bar in between as well as pressing '/' at the beginning to open the chat box. I will send an example of the script in which I already use for automatic JJs to give you a better idea.

Code: Select all

sleepTime := 650
keyDelay := 50
pressDuration := 10 

toggle := 0 
SetKeyDelay % keyDelay, % pressDuration

#MaxThreadsPerHotKey 2
F1::
    toggle ^= 1
    while toggle
    {
        Send % "/" Format("{:U}", Number2Name(A_Index)) "{Enter}{Space}"
        Sleep % sleepTime
    }
return

;
; AutoHotkey: v1.1.11+
; Language:   English
; Platform:   Win7
; Author:     iPhilip
;
; Converts a number into the name of the number
;
; The function Number2Name(Number) converts an integer from 1 to 999,999,999,999 into the name of the number.
; For example, the number 264358 converts to "two hundred sixty-four thousand three hundred and fifty eight".
; See http://en.wikipedia.org/wiki/List_of_numbers#Cardinal_numbers for reference. Comma separators in the
; number are allowed, e.g. 264,358.
;
; The function sets ErrorLevel to one of the following values:
;
;    0 - If the conversion was successful
;    1 - If the number contains any non-digit characters other than commas ("123.4")
;    2 - If the number is larger than the maximum (10**12-1)
;
; ------------------------------------------------------------------------------------------
 
Number2Name(Number)
{
   static OnesArray := ["one","two","three","four","five","six","seven","eight","nine"]
   static TeensArray := ["ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"]
   static TensArray  := ["twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"]
   static ThousandsArray := ["thousand","million","billion"]
 
   StringReplace, Number, Number, `,, , All          ; Remove any comma separators from the input string
   ErrorLevel := 0                                   ; Initialize the error code to the default value
   if Number is not digit                            ; If the string contains anything other than digits
      ErrorLevel := 1                                ; Set the corresponding error code
   else if (Number > 10**12-1)                       ; Otherwise, if the number is larger than the maximum ...
      ErrorLevel := 2                                ; Set the corresponding error code
   if ErrorLevel                                     ; If the error code is non-zero
      Return                                         ; Return
   String =                                          ; Initialize the output string
   NumPeriods := Ceil(StrLen(Number)/3)              ; Calculate the number of periods in the number
   Loop %NumPeriods%                                 ; Loop through for each period
   {                                                 ; A period is a grouping of three digits, e.g. 46,322 has two periods
      Multiplier := 10**(3*(NumPeriods-A_Index))     ; Calculate the multiplier corresponding to the current period
      Period := Floor(Number/Multiplier)             ; Extract the current period
      Hundreds := Floor(Period/100)                  ; Calculate the hundreds digit for the period
      Tens := Floor((Period-Hundreds*100)/10)        ; Calculate the tens digit for the period
      Ones := Period-Hundreds*100-Tens*10            ; Calculate the ones digit for the period
      if Hundreds                                    ; If the period has a non-zero hundreds digit ...
         String .= OnesArray[Hundreds] A_Space "hundred" A_Space   ; Append the name for the ones digit and the word "hundred" to the string, e.g. "two hundred"
      if (Tens > 1)                                  ; If the tens digit is greater than one, e.g. twenty-two
      {
         if (NumPeriods = 1 AND Hundreds OR NumPeriods > 1 AND A_Index > 1)
         ; If there are fewer than 3 digits and the number is > 99 or there are multiple periods and it's not the first period ...
            String .= "and" A_Space                  ; Append an "and " to the string
         String .= TensArray[Tens-1]                 ; Append the name for the tens digit to the string
         if Ones                                     ; If the period has a non-zero ones digit, e.g. 37
            String .=  "-" OnesArray[Ones] A_Space   ; Append a dash and the name of the ones digit to the string
      }
      else if Tens                                   ; Otherwise, if the tens digit is one, e.g. 214
      {
         if (NumPeriods = 1 AND Hundreds OR NumPeriods > 1 AND A_Index > 1)
         ; If there are fewer than 3 digits and the number is > 99 or there are multiple periods and it's not the first period ...
            String .= "and" A_Space                  ; Append an "and " to the string
         String .= TeensArray[Period-Hundreds*100-9] A_Space   ; Append the name of the of the "teens" digit to the string
      }
      else if Ones                                   ; Otherwise, if the tens digit is zero and the ones digit is non-zero ...
      {
         if (NumPeriods = 1 AND Hundreds OR NumPeriods > 1 AND A_Index > 1)
         ; If there are fewer than 3 digits and the number is > 99 or there are multiple periods and it's not the first period ...
            String .= "and" A_Space                  ; Append an "and " to the string
         String .= OnesArray[Ones] A_Space           ; Append the name of the ones digit to the string
      }
      if (Period AND A_Index < NumPeriods)           ; If the period is non-zero and it's not the last period
         String .= ThousandsArray[NumPeriods-A_Index] A_Space   ; Append the name of the "thousands" digit to the string
      Number -= Period*Multiplier                    ; Reduce the number by the current period
   }
   String = %String%                                 ; Trim the space at the end of the string
   Return String                                     ; Return the value of the string
}
User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: Auto Hell Jacks (HJs)

26 Oct 2021, 05:24

Code: Select all

jump(3)

jump(number) {
 Loop, Parse, % str := Format("{:U}", Number2Name(number))
  Send /%A_LoopField%`n
 Send /%str%`n
}

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: BernardDwess and 78 guests