Changeset 21 for TriviaEngine
- Timestamp:
- 10/08/06 09:48:44 (6 years ago)
- File:
-
- 1 edited
-
TriviaEngine/TriviaEngine-sqlite.tcl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
TriviaEngine/TriviaEngine-sqlite.tcl
r20 r21 13 13 # the time between rounds (sec) 14 14 set trivia_delay 30 15 16 # allow new categories to be created? 17 set trivia_allow_new_cats 0 15 18 16 19 # hold the current question info <<< … … 79 82 #<<< 80 83 global trivia_db_handle trivia_last_qid 81 global trivia_q_cat trivia_c 84 global trivia_q_cat trivia_c trivia_allow_new_cats 82 85 83 86 regsub "(trivia )" $cmd "" cmd … … 106 109 return 107 110 } else { 108 puthelp "PRIVMSG $nick :Creating new category$trivia_c(purple) $category" 109 set sql "INSERT INTO categories VALUES (null, '$category', 1)" 110 putloglev d * $sql 111 trivia_db_handle eval $sql 112 set cat_id [trivia_db_handle last_insert_rowid] 113 puthelp "PRIVMSG $nick :Moving question $trivia_last_qid to category$trivia_c(purple) $category$trivia_c(off) ($cat_id)" 114 set sql "UPDATE questions SET cat_id='$cat_id' WHERE question_id='$trivia_last_qid'" 115 putloglev d * $sql 116 trivia_db_handle eval $sql 117 set trivia_q_cat $orig_cat 111 if {$trivia_allow_new_cats == 1} { 112 puthelp "PRIVMSG $nick :Creating new category$trivia_c(purple) $category" 113 set sql "INSERT INTO categories VALUES (null, '$category', 1)" 114 putloglev d * $sql 115 trivia_db_handle eval $sql 116 set cat_id [trivia_db_handle last_insert_rowid] 117 puthelp "PRIVMSG $nick :Moving question $trivia_last_qid to category$trivia_c(purple) $category$trivia_c(off) ($cat_id)" 118 set sql "UPDATE questions SET cat_id='$cat_id' WHERE question_id='$trivia_last_qid'" 119 putloglev d * $sql 120 trivia_db_handle eval $sql 121 set trivia_q_cat $orig_cat 122 } else { 123 puthelp "PRIVMSG $nick :Creating new categories is $trivia_c(purple)DISABLED$trivia_c(off). ('trivia newcat enable' to enable.)" 124 } 118 125 return 119 126 } 120 127 } 128 #>>> 129 130 #<<< enable or disable new category creation 131 if [regexp -nocase "^newcat (enable|disable)" $cmd matches toggle] { 132 if {$toggle == "enable"} { 133 puthelp "PRIVMSG $nick :$trivia_c(purple)ENABLING$trivia_c(off) new category creation" 134 set trivia_allow_new_cats 1 135 return 136 } 137 138 if {$toggle == "disable"} { 139 puthelp "PRIVMSG $nick :$trivia_c(purple)DISABLING$trivia_c(off) new category creation" 140 set trivia_allow_new_cats 0 141 return 142 } 143 144 puthelp "PRIVMSG $nick :Use: trivia newcat enable|disable" 145 return 146 } 121 147 #>>> 122 148 … … 237 263 return 0 238 264 } else { 239 puthelp "PRI GMSG $trivia_channel :Perhaps you want $trivia_c(purple)!trivia start"265 puthelp "PRIVMSG $trivia_channel :Perhaps you want $trivia_c(purple)!trivia start" 240 266 return 0 241 267 } … … 598 624 if {$param == "merge"} { 599 625 trivia_merge $nick $arg 600 #puthelp "PRI GMSG $trivia_channel :Score merging is disabled"626 #puthelp "PRIVMSG $trivia_channel :Score merging is disabled" 601 627 return 0 602 628 }
Note: See TracChangeset
for help on using the changeset viewer.
