Delaying/Repeating scripts

Posts
25
Likes
12
Obviously I'm a novice and could use some help. I'm trying to make a string that makes use of a delay between lines of code, but I'm unfamiliar with this programming language.

How can I delay the time it takes to run the next line of code?

Is there a way I can make it loop a specific group of lines or should I stick with putting "exec <putnamehere>" to repeat the whole string?
 

eezstreet

Movie Battles II Team Retired
Posts
242
Likes
299
Are you talking about for scripts? There's a "wait" command which you can use thusly:
"exec <something>; wait 5; ..."
 
Posts
25
Likes
12
I'm probably doing something wrong, but when I test the script I can't do anything until it has run through everything (which doesn't work so well on a loop.)

EDIT**
Added more detail.
 
Last edited:

Puppytine

Slayed dreamer
Posts
2,237
Likes
1,487
I'm probably doing something wrong, but when I test the script I can't do anything until it's over.
This is by design.
"Wait" command freezes any user input until it's over.

AFAIK, these is no publicly available command to execute some command in X milliseconds after previous command without blocking keyboard/mouse events.
I only heard that @Helix kinda found some way to partially implement desired behavior ("Rainbow script"), though I also heard it has some issue with input as well.
 

Helix

Movie Battles II Team Retired
Posts
577
Likes
609
Hello. "wait" command is restricted server-side in MBII. (there's a way to bypass it tho :p)
In any way, wait is lame because it restricts input
I wrote an external application which sends the commands to the game console directly, every 2000 ms. It's indeed an unlimited pool of possibilities but requires knowledge of the programming / scripting languages. Pm me if interested.

And it has no input issues
Just the in-game anti-spam userinfo filter and inability to chat right after userinfo is changed, thus in most cases I have to pause the script to chat
 
Last edited:

Puppytine

Slayed dreamer
Posts
2,237
Likes
1,487
"wait" command is restricted server-side in MBII.
Hmm...
Maybe I got it wrong, maybe I wasn't attentive enough, but when I was testing it, it worked for me. I didn't notice any server-side restriction.
Though it was blocking input, indeed. So it's useless anyway.
I wrote an external application
Hmm... So turns out it's an external application... Interesting... Hmm... Very interesting...

I remember during my first playthrough of GTA San Andreas, I was exhausted by exercising in a gym, since it was boring, required mindlessly slamming a keyboard and wasted too much time.
So when I had my second playthrough, I wrote an application that emulated input from keyboard.
I was going (in game) to a gym, picking some machine, pressing the hotkey that activated my program, and walking (IRL) to the kitchen to make a cup of coffee. That have made my life much easier, I got Carl Johnson buff fast.
which sends the commands to the game console directly
Hmm... Interesting... Did you just phrased it poorly, or you actually mean it?
Did you create a program that really sends commands directly to the game console, or does it just emulate input like mine one?
thus in most cases I have to pause the script to chat
This is exactly what I meant by saying "some issue with input" :)
 

Helix

Movie Battles II Team Retired
Posts
577
Likes
609
No, I phrased it correctly :)
The application accesses the game console directly and sends commands there.
P.S. scripts4life. In swtor, using self-written scripts I achieve by night (sleeping) the results which otherwise have to be achieved by weeks :p
 

Puppytine

Slayed dreamer
Posts
2,237
Likes
1,487
No, I phrased it correctly :)
The application accesses the game console directly and sends commands there.
Ah, now I see it.
Despite console window is hidden once game is loaded, it still exists and available for input.

005c6ec1bb6d.png
 

Helix

Movie Battles II Team Retired
Posts
577
Likes
609
Smaaaart guy! :)
Yes, exactly, this is default windows controls :)
It works only on windows jamp, but I have plans to make it cross platform with OpenJK. Soon tm.
P. S. Welp, I think I'm going to make it open-source soon cuz I plan to stop mb2ing for quite some time.
 
Last edited:
Top