@event

Results 1 to 7 of 7
  1. #1
    Enthusiast bobnrob is offline
    MemberRank
    Oct 2014 Join Date
    38Posts

    @event

    @Fraysa

    Hello, please help me with your grand knowledge. Thank you.

    I am looking to establish a command where the GM entering "!event open" will result in the following messages appearing within a certain interval,

    GM hosting asdf event.
    You have 90 seconds to join
    You have 75 seconds to join
    You have 50 seconds to join
    You have 40 seconds to join
    You have x seconds to join
    Event portal has closed.

    Basically, each message will only appear after "x" amount of seconds have passed between the messages. I already understand how to broadcast the messages worldwide and so on, but the problem I am having is how to make it so that it will appear in the proper intervals without freezing/lagging the gm who used it and so forth. All my attempts have made it appear instantly all at once or lags the player because of an infinite loop. How do I go about this?

    Thank you for reading.


  2. #2
    I'm overrated. Fraysa is offline
    MemberRank
    Apr 2008 Join Date
    4,891Posts

    Re: @event

    Thread.sleep. Make sure to run it on a different thread rather than the server thread so it won't make it stuck.

  3. #3
    Enthusiast bobnrob is offline
    MemberRank
    Oct 2014 Join Date
    38Posts

    Re: @event

    Quote Originally Posted by Fraysa View Post
    Thread.sleep. Make sure to run it on a different thread rather than the server thread so it won't make it stuck.

    How would I avoid using it on the server Thread? I'm familiar with what Thread.sleep does but unsure how to avoid it getting stuck.

    I'd like to spend the time testing but i'll be at work for another 8 hours.

  4. #4
    Omega sunnyboy is offline
    MemberRank
    Mar 2010 Join Date
    6,108Posts

    Re: @event

    Use a timer instead of thread sleep

  5. #5
    Enthusiast bobnrob is offline
    MemberRank
    Oct 2014 Join Date
    38Posts

    Re: @event

    Quote Originally Posted by sunnyboy View Post
    Use a timer instead of thread sleep
    edited
    Last edited by bobnrob; 20-05-15 at 09:17 AM.

  6. #6
    Omega sunnyboy is offline
    MemberRank
    Mar 2010 Join Date
    6,108Posts

    Re: @event

    If it's an event, make it a world timer

  7. #7
    Enthusiast bobnrob is offline
    MemberRank
    Oct 2014 Join Date
    38Posts

    Re: @event

    Quote Originally Posted by sunnyboy View Post
    If it's an event, make it a world timer
    a world timer, how would this look (& what class) ?

    - - - Updated - - -

    Solved. Thanks @sunnyboy & @Fraysa
    Last edited by bobnrob; 20-05-15 at 09:16 AM.



Advertisement