Delaying/Repeating scripts

Discussion in 'Modding Support' started by MasterNoah, Oct 9, 2017.

  1. MasterNoah

    MasterNoah

    Posts:
    12
    Likes Received:
    1
    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?
     
  2. eezstreet

    eezstreet Movie Battles II Team Retired

    Posts:
    219
    Likes Received:
    206
    Are you talking about for scripts? There's a "wait" command which you can use thusly:
    "exec <something>; wait 5; ..."
     
  3. MasterNoah

    MasterNoah

    Posts:
    12
    Likes Received:
    1
    (Sorry for late response) Yes. I feel really stupid for mixing up scripts with strings. -_-
    That would work, thanks.
     
    eezstreet likes this.
  4. MasterNoah

    MasterNoah

    Posts:
    12
    Likes Received:
    1
    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: Oct 9, 2017
  5. Puppytine

    Puppytine Slayed dreamer

    Posts:
    1,447
    Likes Received:
    960
    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.
     
  6. MasterNoah

    MasterNoah

    Posts:
    12
    Likes Received:
    1
    I see. Thanks for the help guys.
     
  7. Helix

    Helix Script crusader & army evader. Movie Battles II Team Retired

    Posts:
    488
    Likes Received:
    452
    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: Oct 9, 2017
    Puppytine and MasterNoah like this.
  8. MasterNoah

    MasterNoah

    Posts:
    12
    Likes Received:
    1
    Interesting. Many thanks.
     
  9. Puppytine

    Puppytine Slayed dreamer

    Posts:
    1,447
    Likes Received:
    960
    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.
    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.
    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?
    This is exactly what I meant by saying "some issue with input" :)
     
  10. Helix

    Helix Script crusader & army evader. Movie Battles II Team Retired

    Posts:
    488
    Likes Received:
    452
    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 likes this.
  11. MasterNoah

    MasterNoah

    Posts:
    12
    Likes Received:
    1
    I wasn't aware that was possible.
     
  12. Puppytine

    Puppytine Slayed dreamer

    Posts:
    1,447
    Likes Received:
    960
    Ah, now I see it.
    Despite console window is hidden once game is loaded, it still exists and available for input.

    [​IMG]
     
    Helix likes this.
  13. Helix

    Helix Script crusader & army evader. Movie Battles II Team Retired

    Posts:
    488
    Likes Received:
    452
    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: Oct 10, 2017
    Puppytine likes this.

Share This Page