Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Foam
Novice


Joined: 08 Nov 2000
Posts: 44
Location: Australia

PostPosted: Thu Feb 20, 2003 10:08 am   

Milliseconds
 
Hi
I'd like to start a timer upon me using a specific channel, and record how many seconds and milliseconds it takes for a reply to be recieved, is there some way to achieve this?
eg. somebody replies "blue" in 3.456 seconds
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Thu Feb 20, 2003 10:41 am   
 
Hmmph, can't seem to get the %float function to work, so it'll report in milliseconds.

#TR {~[Trivia~] Foam:} {start = %secs}

#TR {~[Trivia~] (%w):*blue} {#SHOW %1 answered in %eval(%secs-@start) ms.}

Troubadour
(Win 98, Pentium III, 550 MHz)
Reply with quote
Foam
Novice


Joined: 08 Nov 2000
Posts: 44
Location: Australia

PostPosted: Thu Feb 20, 2003 2:01 pm   
 
How would i go about scoring, ie taking the name of the correct answerer (if its the first time they have answered correctly) and adding 1 for each time (adding to a existing variable i can do *heh* making a new variable on the fly..... i have no idea), so i can spit out the scores every 10 questions or so, like:
bob is on 3, jill is on 1

Oh and ow can i have it so a if statement comparing the tell recieved and the correct answer (which is in a variable) works for multiple word answers like:
the black forrest

Ignoring capitilisation of answers would be nice too *waggle*

I appreciate the help :) my coding tends to be of the long and messy roundabout variety :) and the scoring has me just plain stumped *blush*
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Feb 20, 2003 4:17 pm   
 
How would you deal with spelling mistakes? Or people that write the same thing in a different way?

I think that instead of having the script check if the person supplied the correct answer, it should be you who decides that and then you manually call an alias to update the score for the person that got it correct. Also, you could store the scores in a record variable where each key is the name of the person and the value associated with it is the score.

Kjata
Reply with quote
Foam
Novice


Joined: 08 Nov 2000
Posts: 44
Location: Australia

PostPosted: Fri Feb 21, 2003 8:18 am   
 
To grab ppl's names and store a value associated with that name, i'd use a database or database variable? I've been readin up on the helpfiles, dont understand how to code the scoring yet, but am i on the right track?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Feb 21, 2003 1:41 pm   
 
Yes, a database variable. Take a look at the commands under Database Variable Commands and most of the functions under Database Functions in Command Reference and Function Reference respectively, in the help file.

A basic example:
#VAR scores ""
#ADDKEY scores Kjata 5
#ADDKEY scores Foam 7
#SH @scores.Kjata
#ADD scores.Kjata 1
#SH @scores.Kjata

Kjata
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net