Script that would count Topic is solved

Ask gaming related questions (AHK v1.1 and older)
Captainzyrtex
Posts: 4
Joined: 28 Sep 2021, 11:44

Script that would count

Post by Captainzyrtex » 28 Sep 2021, 11:56

Hello, I am wondering, how can I create script for Roblox, where AHK would count for me in chat, in all caps, like-
ONE
TWO
THREE

I need script that would open chat using "/" then type ONE and click enter, then the AHK would do the same thing, opening chat with "/" then post this time TWO and then sending message with enter, this would go up to 800, and there would be 1.5 second of space between each number. I beg for help.

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

Re: Script that would count  Topic is solved

Post by mikeyww » 28 Sep 2021, 20:44

Code: Select all

Loop, 800 {
 Sleep, 1500 * (A_Index > 1)
 Send /
 Sleep, 100
 SendInput % "{Text}" words(A_Index) "`n"
}

words(num) {
 Static ones  := ["ONE"      , "TWO"     , "THREE"   , "FOUR"    , "FIVE"    , "SIX"    , "SEVEN"  , "EIGHT"
                , "NINE"]
      , tens  := ["TWENTY"   , "THIRTY"  , "FORTY"   , "FIFTY"   , "SIXTY"   , "SEVENTY", "EIGHTY" , "NINETY"]
      , teens := ["TEN"      , "ELEVEN"  , "TWELVE"  , "THIRTEEN", "FOURTEEN", "FIFTEEN", "SIXTEEN"
                , "SEVENTEEN", "EIGHTEEN", "NINETEEN"]
 text .= (hundreds := num // 100) ? ones[hundreds] " HUNDRED" : "", num -= hundreds * 100
 If num between 10 and 19
  text .= " " teens[num - 9]
 Else t := num // 10, text .= " " tens[t - 1], num -= t * 10, text .= num ? (t ? "-" : "") ones[num] : ""
 Return Trim(text)
}

Captainzyrtex
Posts: 4
Joined: 28 Sep 2021, 11:44

Re: Script that would count

Post by Captainzyrtex » 29 Sep 2021, 01:14

One more question, how can I add a little delay between writing number, and space? Because for now, the space is hitting too early, not leaving time for AHK to write a number. Also, it would be perfect if there would be "jump action" after sucessfully writing an number and sending it.

So-

open chat by "/" - write number - wait 0.5 seconds to give it time to write and then send it using enter - then jump using space - then next number.

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

Re: Script that would count

Post by mikeyww » 29 Sep 2021, 04:42

Code: Select all

Loop, 800 {
 Sleep, 1500 * (A_Index > 1)
 Send /
 Sleep, 100
 Send % "{Text}" words(A_Index)
 Sleep, 500
 Send `n `
}
The "words" function at the bottom can stay the same.

Captainzyrtex
Posts: 4
Joined: 28 Sep 2021, 11:44

Re: Script that would count

Post by Captainzyrtex » 29 Sep 2021, 14:01

It is beautiful, and whoremost, working. Although, I need to ask you for one more thing:

How can I add something like pause button? Because it is unstoppable, and sometimes I'll need to pause it. Another thing is, that can you add space tap between numbers? So after writing and sending a number script would press spacebar and making character in-game jump?

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

Re: Script that would count

Post by mikeyww » 29 Sep 2021, 15:38

Below your loop:

Code: Select all

F3::Pause
Space is already sent after each Enter. Test in Notepad.

Captainzyrtex
Posts: 4
Joined: 28 Sep 2021, 11:44

Re: Script that would count

Post by Captainzyrtex » 30 Sep 2021, 01:41

What does Send ' n ' do?
How can I disable space sending? Because it is not working and I decided I am able to tap space manually.

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

Re: Script that would count

Post by mikeyww » 30 Sep 2021, 05:17

Does the script work in Notepad?

Send `n ` sends a line feed (new line), followed by a space.

To omit the space:

Send `n

Post Reply

Return to “Gaming Help (v1)”