Thread: Simple timer
View Single Post
  #1 (permalink)  
Old 01-20-2008, 11:32 AM
im-not-alive im-not-alive is offline
Member
 
Join Date: Jan 2008
Posts: 1
im-not-alive is on a distinguished road
Simple timer
I'm developing a "private server" for an online game and I'm basically reading commands from different files, example:
Code:
message = You search the crate . . . anim = 881 wait = 2 message = You find nothing.
Theoretically what it should do is send the player a message saying "You search the crate . . .", and then a simple animation comes up and wait 2 seconds before displaying the message "You find nothing." The problem is that the delay happens at the begging of the script so it waits 2 seconds, and then it does the animation and sends both of the messages at the same time.

This should be useful:
Code:
if(token.startsWith("wait")) { try { Thread.sleep(Integer.parseInt(token3[0]) * 1000); } catch(Exception e) { } }
Any help is highly appreciated; thanks in advance.
Reply With Quote
Sponsored Links