Ignore:
Timestamp:
11/16/06 09:27:09 (6 years ago)
Author:
james
Message:

tell people when they're quick

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TriviaEngine/TriviaEngine-sqlite.tcl

    r34 r35  
    3434set trivia_guesser_count 0 
    3535set trivia_last_qid 0 
    36  
     36set trivia_q_timestamp 0 
    3737if [info exists trivia_must_rehash] { 
    3838  if {$trivia_must_rehash == 1} { 
     
    364364        global trivia_q_id trivia_q_cat trivia_q_question trivia_q_answer trivia_q_hint trivia_q_attempts trivia_channel trivia_status 
    365365        global trivia_timer trivia_delay trivia_db_handle trivia_unanswered trivia_run_qty trivia_run_last trivia_run_nick trivia_c 
    366         global trivia_score_time trivia_time_left_warning trivia_asking_question trivia_current_leader 
     366        global trivia_score_time trivia_time_left_warning trivia_asking_question trivia_current_leader trivia_q_timestamp 
    367367 
    368368        if {$trivia_status != 1} { 
     
    377377        set trivia_asking_question 0 
    378378 
     379        set speed [expr [clock seconds] - $trivia_q_timestamp] 
     380 
     381        set speedword "" 
     382        if {$speed <= 1} { 
     383                set speedword [trivia_random_element [list "POW! 0 to correct in under a second!" "Faster than a speeding fast thing!" "Even I didn't get it that quick, and I've just got to do a database lookup!"]] 
     384        } elseif {$speed < 7} { 
     385                set speedword [trivia_random_element [list "WHOOSH! 0 to correct in $speed seconds!" "%% shows their unassailable knowledge of whatever that question was about by getting it in $speed seconds" "Set course for correctsville, Commander %%. Ahead warp [expr 10 - $speed]!" "Caffeine abuse pays off for %% with a speedy time of $speed seconds" "Faster than a speeding triviabullet!"]] 
     386        } 
     387 
    379388        set uid [trivia_get_uid $nick] 
    380389        if {$uid == 0} { 
     
    390399        trivia_incr_score $uid 
    391400 
     401        regsub -all -nocase "%%" $speedword "$trivia_c(purple)$nick$trivia_c(off)" speedword 
     402 
    392403        putquick "PRIVMSG $trivia_channel :Congratulations $trivia_c(purple)$nick$trivia_c(off)! The answer was$trivia_c(purple) $answer$trivia_c(off)." 
     404        if {$speedword != ""} { 
     405                putquick "PRIVMSG $trivia_channel :$speedword" 
     406        } 
    393407 
    394408        trivia_bmotion_send "winner" "$nick $answer" 
     
    468482                } 
    469483                4 { 
    470                         puthelp "PRIVMSG $trivia_channel :$trivia_c(realblue)QUAD DAMAGE!" 
     484                        putquick "PRIVMSG $trivia_channel :$trivia_c(realblue)QUAD DAMAGE!" 
    471485                        return "is on a roll ..." 
    472486                } 
     
    917931#<<< 
    918932        global trivia_q_id trivia_q_cat trivia_q_question trivia_q_answer trivia_q_hint trivia_q_attempts trivia_channel trivia_status trivia_last_qid 
    919         global trivia_asking_question trivia_delay botnick 
     933        global trivia_asking_question trivia_delay botnick trivia_q_timestamp 
    920934 
    921935        if {$trivia_status != 1} { 
     
    951965 
    952966        trivia_bmotion_send "start" "$trivia_channel $trivia_delay $botnick" 
     967        set trivia_q_timestamp [clock seconds] 
    953968 
    954969        trivia_round 
     
    9881003        } 
    9891004 
    990         putserv "PRIVMSG $trivia_channel :$trivia_c(red)--== Trivia ==--$trivia_c(off) \[category: \002$trivia_q_cat\002\]" 
    991         #\[question id: \002$trivia_q_id\002\]" 
    9921005        set split_question [trivia_question_split $trivia_q_question] 
     1006 
     1007        putquick "PRIVMSG $trivia_channel :$trivia_c(red)--== Trivia ==--$trivia_c(off) \[category: \002$trivia_q_cat\002\]" 
    9931008        foreach q $split_question { 
    9941009                if {$q != ""} { 
    995                         putserv "PRIVMSG $trivia_channel :$trivia_c(blue) [trivia_question_inject $q]" 
     1010                        putquick "PRIVMSG $trivia_channel :$trivia_c(blue) [trivia_question_inject $q]" 
    9961011                } 
    9971012        } 
    9981013        #set new_question [trivia_question_inject $trivia_q_question] 
    999         #putserv "PRIVMSG $trivia_channel :$trivia_c(blue) $new_question" 
    1000         putserv "PRIVMSG $trivia_channel :Hint$hint: [trivia_explode $trivia_q_hint]" 
     1014        #putquick "PRIVMSG $trivia_channel :$trivia_c(blue) $new_question" 
     1015        putquick "PRIVMSG $trivia_channel :Hint$hint: [trivia_explode $trivia_q_hint]" 
    10011016 
    10021017        incr trivia_q_attempts 
Note: See TracChangeset for help on using the changeset viewer.