I was told by the author that I would need to edit out \003 or something but I dont know what \003 means and it apperas everywhere!!
Code: Select all
################################################## Date: 05Mar07 ##
## BogusTrivia 2.05.2 by SpiKe^^ :undernet: #pc-mirc-help ##
###################################################################
# VERSION NOTES: updates in ver 2.05 #
# #
# 1. Script Now Supports KAOS #
# 2. Advanced KAOS Options Included #
# 3. Additional Color Themes #
# #
# -> bugfixes in ver. 2.05.2 <- #
# - Fixed this: bad index "": must be integer or end?-integer? #
# when related to upper case answers. #
# - Now adds kaos points to user totals even if the game is #
# stopped before the kaos question is done. #
###################################################################
# VERSION HISTORY: #
# -> Updates in v2.04 <- #
# 1. Script Now Supports UWord & Scrambles #
# 2. Now Supports Multiple-Choice Answers (example: "two" or "2") #
# 3. New Custom Colors Setup (choose your own colors:) #
# 4. Anti-Theft Feature now with On-Off #
# 5. Added several other Advanced Settings #
###################################################################
# Edit the settings in this script, add the line: #
# source scripts/t-2.tcl to your bot's config file. #
# Then put the script & my questions file in the scripts folder #
# and rehash to load the script. #
# Do: /msg YerBot .add :to add the questions to the database. #
# Then do: /msg YerBot .mix 8 :to mix the database 8 times. #
# Use: .t2 :in the channel to start the game. #
# #
# To add your own questions to the database: #
# Name your new question files anything with "triv" in the #
# file name (example: triv1.txt triv2.txt triv2.txt), put them #
# in the eggdrop root or /scripts folder, and do: /msg BOT .add #
# #
# Questions are added to a database and the files are deleted! #
# KEEP backups of your Trivia Files!! #
# #
# NOTE: Colon's cannot be used as Question & Answer Separator #
# #
# #
# After adding new questions, make sure to do a mix! #
# The script reads questions from the database in order, #
# so without a mix they will be read in same order as the file! #
# #
# #
# Add Questions To The BogusTrivia Database (message command) #
# .add :Look for new question files to load to the database. #
# Searches the eggdrop root & /scripts folders for all #
# files with "triv" in their name (*triv*). #
# Add those questions & kaos using the default formats: #
# Question: question*answer or: question*answer*ansr2*etc #
# Kaos: kaos:question*answer*answer2*answer3*etc #
# or: KAOS: question*answer*ansr2*ansr3*etc #
# #
# .add <format> :Add questions from files with other formats #
# Examples: .add a*q :: .add q|a :: .add a%q etc. #
# #
# .add <format> <file> :Add files not matching mask: *triv* #
# Example: .add a*q ques* :add files starting with ques #
# Example: .add - music* :use the default format ( q*a ) #
# #
# New Add Command for NonStandard KAOS Files (message command) #
# Only used to add files that are All Kaos & Every Line #
# Does Not Start with "KAOS:" (not case sensitive). #
# .addk :Add KAOS ONLY Files. Can use all .add options above #
# Examples: .addk a|q :: .addk a%q *kaos* etc. #
# #
# NOTE: This Command assumes you are adding KAOS files. #
# If there are regular questions in the file they will #
# not be added and are shown as an error. #
# #
# Mix The Questions In The BogusTrivia Database (message command) #
# .mix :mix all in the database four times. #
# .mix <1-9> :mix the questions & kaos this many times. #
# Example: .mix 8 :mix the database 8 times. #
# #
# .mix k :mix the kaos in the database four times. #
# .mix q <1-9> :mix the questions only, this many times. #
# Examples: .mix k :: .mix q :: .mix k 8 :: .mix q3 #
# #
###################################################################
# Contact Options to report bugs, comments & suggestions #
# http://www.mytclscripts.com #
# irc: undernet: #pc-mIRC-help #
# email: spike@mytclscripts.com #
# If you'd like to Preview the script Visit Undernet #BogusTrivia #
###################################################################
######## Script Settings & Options ########
set t2(chan) "#uk-mkivs" ;# channel to run bogus trivia in #
set t2(mflag) "m|m" ;# flags for /msg commands (.add .mix) #
set t2(on) "!trivia" ;# public trigger for game on/off #
set t2(oflag) "o|o" ;# flags to turn game on/off #
set t2(lpoint) "5000" ;# low end of points range (100 or more) #
set t2(hpoint) "10000" ;# high end of points range (above lpoint) #
set t2(qtime) "15" ;# play time between hints (10 to 30 seconds) #
set t2(ptime) "20" ;# play time between questions (12 to 30 seconds) #
set t2(dobonus) "10" ;# how often to do bonus (by ques count) (0=off) #
set t2(maxbonus) "15000" ;# max points for bonus (above hpoint & above 1000) #
set t2(kaos) "25" ;# how often to do a kaos (by qes count) (0=off) #
set t2(ktime) "20" ;# time between hints on kaos (in seconds) #
set t2(klpoint) "15000" ;# low end of kaos points range #
set t2(khpoint) "75000" ;# high end of kaos points range #
## color themes ##
# 1 =bogus default # 2 =blue white black yellow #
# 3 =bright green red yellow # 4 =purple grey #
# 5 =brown grey # 6 =black orange #
# 7 =blue green yellow # 8 =grey brown black orange #
# 0 = No colors #
set t2(color) "1"
# stat lines for active day week month and ever show top 10 or 20 or 30 users #
set t2(today) "3" ;## 1 = 10 | 2 = 20 | 3 = 30 ##
# stat lines for yesterday, lastweek, & lastmonth show top 10, 20 or 30 users #
set t2(yesterda) "3" ;## 1 = 10 | 2 = 20 | 3 = 30 ##
# stat lines for logs older than yesterday etc. # ex. 2 Weeks Ago Top 10 #
set t2(history) "2" ;## 0 = off | 1 = 10 | 2 = 20 ##
# stat lines like: Top Player of: - Sunday: nick points - Monday: nick.... #
set t2(otherhist) "1" ;## 0 = off | 1 = on ##
set t2(shonum) "1" ;# show the question number ?? (1=yes | 0=no) #
set t2(shothe) "1" ;# show leading 'the' in first hint ?? (1=yes | 0=no) #
set t2(descend) "1" ;# points go down with each hint ?? (1=yes | 0=no) #
set t2(randad) "4" ;# how often to show random ad (by qes count) (0=off) #
## random ad lines. one ad per line. as many as you want (no limit) ##
#### Random Lines Below ##
set t2(rndlin) {
Think a Q&A is incorrect? It can't be the bot is always right. hehe
Welcome to Our Channel, kick back and play some Trivia!!
Trivia Commands: ~ Will Show a Hint, q Will Repeat the Current Question
BogusTrivia by Spike^^. Get your copy at mytclscripts.com !
This Space For Rent.
} ;## END Random Ad Lines ! ## END USER SETTINGS ## END USER SETTINGS ###
############################################################################
#### !! END SETTINGS !! #### !! END SETTINGS !! #### !! END SETTINGS !! ####
############################################################################
######## Advanced Settings ( no need to edit these ) ########
set t2(pflag) "-|-" ;# flags required to play the game ( -|- = all ) #
set t2(hint) "~" ;# public trigger to see user hint ( default: ~ ) #
set t2(hflag) "-|-" ;# flags required to use hint command #
set t2(usrqes) "1" ;# users can see question again? (0=no | 1=yes) #
set t2(upubq) "q" ;# public trigger to see user question ( default: q ) #
set t2(pqflag) "-|-" ;# flags required to use question command #
# Note: can be used only once per question & only after the 2nd hint #
# slow times # after this many questions with no one playing the game, #
# the times between hints & questions increase to these settings. #
set t2(sqcnt) "6" ;# use slow times after this many not played #
set t2(qslow) "20" ;# slow time between hints #
set t2(pslow) "25" ;# slow time between questions #
# Note: if set to less than play times, slow times will be same as play #
# resting times # after this many questions with no one playing the game, #
# the times between hints & questions increase to these settings. #
set t2(rqcnt) "15" ;# use resting times after this many not played #
set t2(rest) "30" ;# resting time between hints, and questions #
# Note: if set to less than slow times, rest times will be same as slow #
# weekly stats # new week starts on monday morning ?? (1 - 7) #
set t2(newweek) "1" ;# 1 = monday # 2 = tuesday ... 7 = sunday #
# anti-theft # random letter fill of spaces in questions ?? #
set t2(randfil) "1" ;# anti-theft on ?? (1=yes | 0=no) #
########## Advanced KAOS Settings ##########
# bogus can do kaos hints in 2 ways, long hints or a shorter ver. (try it:) #
# (0 - 3) # default: "1" =short first hint & full hints 2 and 3 #
# 0=all long hints | 1=short hint1 | 2=short hint2 | 3=short hint3 also #
set t2(kstyle) "1"
# stop doing kaos questions if no one has been playing ?? (if slow or resting) #
set t2(krest) "1" ;# 0=no krest | 1=no kaos after rest | 2=none after slow #
# kaos bonus # award a bonus to all kaos players if they get them all ?? #
set t2(kbonus) "5" ;# 0=off | 1+ =min number of answers to be a bonus #
set t2(kbonlo) "5000" ;# low end of kaos bonus points range (100 or more) #
set t2(kbonhi) "10000" ;# high end of kaos bonus points range (above kbonlo) #
######## Custom Colors Setup: (( standard mirc color codes )) ########
## turn on custom colors setup ?? (0=no | 1=yes) ##
## ( turning this on overrides color themes setting above! ) ##
set t2(custclr) "0"
## Color settings for items below can be set in 3 ways: ##
## 1) one number: like "06" : for text in purple
## 2) two numbers: like "04,12" : for red text, blue background (1st# = text, 2nd# = background)
## 3) no numbers: like "" : no color code for this item.. text will be user default colors.
#------------------------------------------------------------------------------------#
# 00=white 01=black 02=dkblue 03=green 04=red 05=brown 06=purple 07=orange 08=yellow #
# 09=lightgreen 10=darkgreen 11=bluegreen 12=blue 13=pink 14=darkgrey 15=lightgrey #
#------------------------------------------------------------------------------------#
## colors for the question text ##
## ( should have a background color ) ##
set tscl(qt) "05,15"
## colors for all timed hints
set tscl(hint) "05,15"
set tscl(hint2) "07,15"
## this line: Question Value : 8200 Points ##
## and: 30 secs & 2650 Points Remaining ##
set tscl(pnt1) "07"
set tscl(pnt2) "05"
## this line: BONUS Question Value : 15000 Points ##
set tscl(bonus) "07"
set tscl(bon2) "05"
## this line: Times up! The answer was -> The Who <- ##
## and: YES, SpiKe^^ got the answer -> styx <- in 13.855 seconds.... ##
## and: SpiKe^^ has won 4 in a row! Total Points TODAY: 185925.... ##
set tscl(tu1) "05"
set tscl(tu2) "07"
## colors for user requested hints ( public ~ reply ) ##
set tscl(hnt1) "05,15"
set tscl(hnt2) "05,15"
## colors for the random ads ##
set tscl(randad) "00,01"
######## Custom KAOS Colors ########
## kaos uses same colors as normal questions ?? ##
## (1=yes | 0=use custom kaos colors below)
set tscl(ksame) "1"
## colors for all kaos hints ##
set tscl(khnt) "05,15"
set tscl(khnt2) "05,15"
set tscl(kpnt1) "07"
set tscl(kpnt2) "05"
set tscl(ktu) "07"
set tscl(ktu2) "05"
set tscl(kng) "07"
set tscl(kstat) "05"
set tscl(ksta2) "07"
set tscl(kbon) "05"
set tscl(kbon2) "07"
######## Custom Stats Colors ########
## colors for all daily stats ##
set tscl(d10) "05,15"
set tscl(d11) "01,15"
set tscl(d12) "05,15"
## all stats use the daily stats colors from above ?? ##
## (1=yes | 0=use individual stats setup below)
set tscl(same) "1"
## colors for all weekly stats ##
set tscl(w10) "00,10"
set tscl(w11) "08,10"
set tscl(w12) "00,10"
## colors for all monthly stats ##
set tscl(m10) "00,10"
set tscl(m11) "08,10"
set tscl(m12) "00,10"
## colors for all lifetime stats ##
set tscl(e10) "00,10"
set tscl(e11) "08,10"
set tscl(e12) "00,10"
############################################################################
##### !! END Advanced Settings !! #### !! END Advanced Settings !! #####
############################################################################
###### !! DO NOT EDIT BELOW HERE !! DO NOT EDIT BELOW HERE !! ######
############################################################################
if {$t2(randad)>"0"} {
set t2(rndlin) [split $t2(rndlin) "\n"] ; set rlins ""
foreach rline $t2(rndlin) {
if {$rline ne "" && $rline ne " "} { lappend rlins $rline }
}
set t2(rndlin) $rlins
if {[llength $t2(rndlin)]=="0"} { set t2(randad) 0 }
} elseif {$t2(randad)=="0"} { set t2(rndlin) "" }
if {![info exists t2(-ison)]} { set t2(-ison) 0 }
if {![info exists t2(-active)]} { set t2(-active) "" }
if {![info exists t2(-qtimer)]} { set t2(-qtimer) "" }
if {![info exists t2(-otimer)]} { set t2(-otimer) "" }
if {![info exists t2(-abound)]} { set t2(-abound) 0 }
if {![info exists t2(-a2bound)]} { set t2(-a2bound) 0 }
if {![info exists t2(-qbound)]} { set t2(-qbound) 0 }
if {![info exists t2(-hbound)]} { set t2(-hbound) 0 }
if {![info exists t2(-reply)]} { set t2(-reply) "" }
if {![info exists t2(-newfiles)]} { set t2(-newfiles) "" }
if {![info exists t2(-openbad)]} { set t2(-openbad) "" }
if {![info exists t2(-htime)]} { set t2(-htime) $t2(qtime) }
if {![info exists t2(-ptime)]} { set t2(-ptime) $t2(ptime) }
if {![info exists t2(sethtime)]} { set t2(sethtime) $t2(qtime) }
if {![info exists t2(setptime)]} { set t2(setptime) $t2(ptime) }
if {![info exists t2(-iskaos)]} { set t2(-iskaos) 0 }
proc TStrInt {str} { return [string is integer -strict $str] }
proc TStrDig {str} { return [string is digit -strict $str] }
proc TDoClr {} { global t2 tclr tscl ; set t2(-endclr) "\003"
if {$t2(custclr)=="1"} {
if {$tscl(same)=="1"} {
set tmp [list w10 $tscl(d10) w11 $tscl(d11) w12 $tscl(d12)]
lappend tmp m10 $tscl(d10) m11 $tscl(d11) m12 $tscl(d12)
lappend tmp e10 $tscl(d10) e11 $tscl(d11) e12 $tscl(d12)
array set tscl $tmp
}
if {$tscl(ksame)=="1"} { set tmp [list khnt $tscl(hint) khnt2 $tscl(hint2)]
lappend tmp kpnt1 $tscl(pnt1) kpnt2 $tscl(pnt2)
lappend tmp ktu $tscl(tu1) ktu2 $tscl(tu2) kng $tscl(tu1)
lappend tmp kstat $tscl(pnt2) ksta2 $tscl(pnt1) kbon $tscl(bonus) kbon2 $tscl(bon2)
array set tscl $tmp
}
unset tscl(same) tscl(ksame)
foreach {cn cs} [array get tscl] {
if {$cs==""} { set tclr(-$cn) "\003"
} else { set err 0
if {[string match *,* $cs]} { set cs [split $cs ,] }
if {[llength $cs]>"2"} { set err 1
} else { set new ""
foreach num $cs {
if {[TStrDig $num]=="0"} { set err 2 ; break
} elseif {[string length $num]>"2"} { set err 3 ; break
} elseif {$num>"15"} { set err 4 ; break
} else {
if {[string length $num]=="1"} { set num "0$num" }
if {$new==""} { set new "\003$num"
} else { append new "," $num }
}
}
}
if {$err=="0"} { set tclr(-$cn) $new
} else { set tclr(-$cn) "\003" }
}
}
if {$tclr(-qt)=="\003"} {
set t2(randfil) 0 ; set tclr(-qt) "" ; set tclr(-qs) ""
} elseif {[string match *,* $tclr(-qt)]=="0"} {
set t2(randfil) 0 ; set tclr(-qs) ""
} else {
set tmp [string range $tclr(-qt) end-1 end] ; set tclr(-qs) "\003$tmp,$tmp"
}
} elseif {$t2(color)=="2"} {
array set tclr {-pnt1 \00312 -pnt2 ""
-bonus \00300,04 -bon2 ""
-qt \00300,02 -qs \00302,02 -hint \00300,02 -hint2 ""
-hnt1 \00312 -hnt2
-tu1 \00304 -tu2 \00312 -randad \00300,01
-khnt \00300,02 -khnt2 "" -kpnt1 \00312 -kpnt2 ""
-ktu \00312 -ktu2 \00304 -kng \00312
-kstat \00312 -ksta2 \00304 -kbon \00300,04 -kbon2 ""
-d10 \00308,02 -d11 \00308,02 -d12 \00308,02
-w10 \00308,02 -w11 \00308,02 -w12 \00308,02
-m10 \00308,02 -m11 \00308,02 -m12 \00308,02
-e10 \00308,02 -e11 \00308,02 -e12 \00308,02}
} elseif {$t2(color)=="3"} {
array set tclr {-pnt1 \00312 -pnt2 ""
-bonus \00300,04 -bon2 ""
-qt \00301,09 -qs \00309,09 -hint \00301,09 -hint2 ""
-hnt1 \00312 -hnt2
-tu1 \00304 -tu2 \00312 -randad \00301,08
-khnt \00301,09 -khnt2 "" -kpnt1 \00312 -kpnt2 ""
-ktu \00312 -ktu2 \00304 -kng \00312
-kstat \00312 -ksta2 \00304 -kbon \00300,04 -kbon2 ""
-d10 \00301,08 -d11 \00301,08 -d12 \00300,04
-w10 \00300,04 -w11 \00300,04 -w12 \00301,08
-m10 \00301,08 -m11 \00301,08 -m12 \00300,04
-e10 \00300,04 -e11 \00300,04 -e12 \00301,08}
} elseif {$t2(color)=="4"} {
array set tclr {-pnt1 \00314 -pnt2 \00306
-bonus \00300,14 -bon2 ""
-qt \00315,06 -qs \00306,06 -hint \00315,06 -hint2 ""
-hnt1 \00315,06 -hnt2 ""
-tu1 \00306 -tu2 \00314 -randad \00300,14
-khnt \00315,06 -khnt2 "" -kpnt1 \00314 -kpnt2 \00306
-ktu \00306 -ktu2 \00314 -kng \00306
-kstat \00314 -ksta2 \00306 -kbon \00300,14 -kbon2 ""
-d10 \00306,15 -d11 \00314,15 -d12 \00306,15
-w10 \00306,15 -w11 \00306,15 -w12 \00314,15
-m10 \00306,15 -m11 \00314,15 -m12 \00306,15
-e10 \00306,15 -e11 \00306,15 -e12 \00314,15}
} elseif {$t2(color)=="5"} {
array set tclr {-pnt1 \00305 -pnt2 \00314
-bonus \00305,15 -bon2 \00314,15
-qt \00315,05 -qs \00305,05 -hint \00315,05 -hint2 ""
-hnt1 \00315,05 -hnt2 "\00300,05"
-tu1 \00305 -tu2 \00314 -randad \00300,14
-khnt \00315,05 -khnt2 "" -kpnt1 \00305 -kpnt2 \00314
-ktu \00305 -ktu2 \00314 -kng \00305
-kstat \00305 -ksta2 \00314 -kbon \00305,15 -kbon2 \00314,15
-d10 \00305,15 -d11 \00314,15 -d12 \00305,15
-w10 \00305,15 -w11 \00305,15 -w12 \00314,15
-m10 \00305,15 -m11 \00314,15 -m12 \00305,15
-e10 \00305,15 -e11 \00305,15 -e12 \00314,15}
} elseif {$t2(color)=="6"} {
array set tclr {-pnt1 \003 -pnt2 \00307
-bonus \00301,07 -bon2 ""
-qt \00307,01 -qs \00301,01 -hint \00307,01 -hint2 ""
-hnt1 \00307,01 -hnt2 ""
-tu1 \00307 -tu2 \003 -randad \00300,01
-khnt \00307,01 -khnt2 "" -kpnt1 \003 -kpnt2 \00307
-ktu \00307 -ktu2 \003 -kng \00307
-kstat \003 -ksta2 \00307 -kbon \00301,07 -kbon2 ""
-d10 \00300,01 -d11 \00307,01 -d12 \00307,01
-w10 \00300,01 -w11 \00307,01 -w12 \00307,01
-m10 \00300,01 -m11 \00307,01 -m12 \00307,01
-e10 \00300,01 -e11 \00307,01 -e12 \00307,01}
} elseif {$t2(color)=="7"} {
array set tclr {-pnt1 \00310 -pnt2 \00302
-bonus \00310 -bon2 \00304
-qt \00309,02 -qs \00302,02 -hint \00308,02 -hint2 \00309,02
-hnt1 \00308,02 -hnt2 ""
-tu1 \00303 -tu2 \00302 -randad \00301,08
-khnt \00308,02 -khnt2 \00309,02 -kpnt1 \00310 -kpnt2 \00302
-ktu \00303 -ktu2 \00302 -kng \00303
-kstat \00302 -ksta2 \00310 -kbon \00310 -kbon2 \00304
-d10 \00308,02 -d11 \00309,02 -d12 \00308,02
-w10 \00308,02 -w11 \00309,02 -w12 \00308,02
-m10 \00308,02 -m11 \00309,02 -m12 \00308,02
-e10 \00308,02 -e11 \00309,02 -e12 \00308,02}
} elseif {$t2(color)=="8"} {
array set tclr {-pnt1 \00307 -pnt2 \00305
-bonus \00307 -bon2 \00305
-qt \00301,15 -qs \00315,15 -hint \00305,15 -hint2 \00301,15
-hnt1 \00305,15 -hnt2 ""
-tu1 \00305 -tu2 \00307 -randad \00300,01
-khnt \00305,15 -khnt2 \00301,15 -kpnt1 \00307 -kpnt2 \00305
-ktu \00305 -ktu2 \00307 -kng \00305
-kstat \00305 -ksta2 \00307 -kbon \00307 -kbon2 \00305
-d10 \00315,01 -d11 \00307,01 -d12 \00315,01
-w10 \00315,01 -w11 \00307,01 -w12 \00315,01
-m10 \00315,01 -m11 \00307,01 -m12 \00315,01
-e10 \00315,01 -e11 \00307,01 -e12 \00315,01}
} elseif {$t2(color)=="0"} { set t2(-endclr) ""
array set tclr {-pnt1 "" -pnt2 "" -bonus "" -bon2 ""
-qt "" -qs "" -hint "" -hint2 "" -hnt1 "" -hnt2 ""
-tu1 "" -tu2 "" -randad "" -khnt "" -khnt2 "" -kpnt1 "" -kpnt2 ""
-ktu "" -ktu2 "" -kng "" -kstat "" -ksta2 "" -kbon "" -kbon2 ""
-d10 "" -d11 "" -d12 "" -w10 "" -w11 "" -w12 ""
-m10 "" -m11 "" -m12 "" -e10 "" -e11 "" -e12 ""}
} else {
array set tclr {-pnt1 \003 -pnt2 \00310
-bonus \003 -bon2 \00310
-qt \00300,10 -qs \00310,10 -hint \00300,10 -hint2 ""
-hnt1 \00300,10 -hnt2 ""
-tu1 \003 -tu2 \00310 -randad \00300,01
-khnt \00300,10 -khnt2 "" -kpnt1 \003 -kpnt2 \00310
-ktu \00310 -ktu2 \003 -kng \00310
-kstat \003 -ksta2 \00310 -kbon \003 -kbon2 \00310
-d10 \00300,10 -d11 \00308,10 -d12 \00300,10
-w10 \00300,10 -w11 \00308,10 -w12 \00300,10
-m10 \00300,10 -m11 \00308,10 -m12 \00300,10
-e10 \00300,10 -e11 \00308,10 -e12 \00300,10}
}
array unset tscl
}
TDoClr
#### Do Not Change These ####
set tclr(-msg) \00310 ; set tclr(-emsg) \003
set t2(setupnik) ""
set t2(newfil) *triv* ; set t2(layout) q*a
set t2(dflag) m|m
set t2(hntcnt) 3
set t2(tflag) o|o
set t2(fast) .fast ; set t2(slow) .slow
set t2(dausrs) 30 ; set t2(weusrs) 30
set t2(mousrs) 30 ; set t2(evusrs) 30
set t2(actvsiz) 20 ; set t2(recsiz) 15
set t2(keepda) 7 ; set t2(keepwe) 26
set t2(keepmo) 12 ; set t2(keephi) 1200
set t2(olduser) 20 ; set t2(usrmax) 300
set double-server 1 ;## force eggdrop conf setting ##
bind pubm $t2(oflag) "$t2(chan) $t2(on)" TOnOff
bind msgm $t2(mflag) .add* TAdd
bind msg $t2(mflag) .mix TMix
if {![info exists t2(sfpath)]} { set t2(sfpath) [pwd]/scripts/t2/
set t2(qfpath) [pwd]/scripts/t2/ques/ }
if {$t2(qslow)<$t2(qtime)} { set t2(qslow) $t2(qtime) }
if {$t2(pslow)<$t2(ptime)} { set t2(pslow) $t2(ptime) }
if {$t2(rest)<$t2(qslow)} { set t2(rest) $t2(qslow) }
if {$t2(rest)<$t2(pslow)} { set t2(rest) $t2(pslow) }
if {$t2(kaos)>"0"} {
if {$t2(ktime)<$t2(qtime)} { set t2(ktime) $t2(qtime) }
}
if {$t2(color)=="0" && $t2(randfil)!="0"} { set t2(randfil) 0 }
proc TChar {how chr} {
if {$chr==" "} {
if {$how=="1" || $how=="2"} { return 0 }
}
if {$how=="1"} {
if {[string match {[A-Za-z0-9]} $chr]} { return 1 } else { return 0 }
} elseif {$how=="2"} {
if {[string match {[aeiouAEIOU]} $chr]} { return 1 } else { return 0 }
}
return $chr
}
proc TRandL {} { global t2
set lstr "qNwMrLtJpCsZdRfQgShFjklPzxTcWvb"
return [string index $lstr [rand 30]]
}
proc TDoNum { {num Error} } {
switch -exact -- $num {
0 { return Zero }
1 { return One }
2 { return Two }
3 { return Three }
4 { return Four }
5 { return Five }
6 { return Six }
7 { return Seven }
8 { return Eight }
9 { return Nine }
10 { return Ten }
11 { return Eleven }
12 { return Twelve }
13 { return Thirteen }
14 { return Fourteen }
15 { return Fifteen }
default { return $num }
}
}
proc TFigurWe { {wat 0} {start 0} } { global t2
if {$wat=="1" && $start!="0"} { set begin [strftime %u $start] }
if {$t2(newweek)=="1"} { set wkend 7
} else { set wkend [expr {$t2(newweek)-1}] }
set wkls [strftime %j $start] ; set nexda $start
if {$begin!=$wkend} { set dacnt $begin
while {$dacnt!=$wkend} {
if {$dacnt=="7"} { set dacnt 1 } else { incr dacnt }
incr nexda 86400 ; append wkls " [strftime %j $nexda]"
}
}
if {$wat=="1"} { return $wkls }
}
proc TShoTrv2 {} { global t2 tclr ; set t2(-qtimer) ""
if {$t2(-ison)=="1"} { set t2(-hntnum) -3 ; TShoTriv }
}
proc TGotIt {nk uh hn ch tx} { global t2 tclr
if {$t2(kaos)>"0" && $t2(-iskaos)==$t2(kaos)} { set iskaos 1
} else { set iskaos 0 }
if {[set temp [lsearch -exact $t2(-allansls) [string tolower $tx]]]=="-1"} {
return 0 }
if {$iskaos=="1"} { set endnow 0
if {[llength $t2(-allansls)]=="1"} { set endnow 1
} else { set t2(-allansls) [lreplace $t2(-allansls) $temp $temp] }
} else { set endnow 1 }
if {$endnow=="1"} {
set timrls [utimers]
if {[lsearch $timrls "* $t2(-qtimer)"]!="-1"} { killutimer $t2(-qtimer) }
set t2(-qtimer) "" ; if {$t2(-hbound)=="1"} { TBind h u }
if {$t2(-qbound)=="1"} { TBind q u }
set qestime [expr { round( "[unixtime].0"-$t2(-qstart) ) }]
}
if {$iskaos=="1"} {
set temp [lsearch -exact [string tolower $t2(-kansls)] [string tolower $tx]]
set tmp2 [lindex $t2(-kansls) [expr {$temp+3}]]
if {$endnow=="1"} { TBind a u
} else {
if {[lsearch -exact $t2(-allansls) [string tolower $tx]]=="-1"} {
unbind pubm $t2(pflag) "$t2(chan) $t2($tmp2)" TGotIt
}
if {$tmp2 eq "-answer"} { set t2(-answer) ""
} else { array unset t2 $tmp2 }
}
set t2(-kansls) [lreplace $t2(-kansls) $temp [expr {$temp+3}]]
putquick "PRIVMSG $ch :$tclr(-ktu) $nk gets $t2(-points) points for: $tclr(-ktu2) $tx "
incr t2(-kgotpnts) $t2(-points)
if {$t2(-kusrls) eq ""} { set t2(-kusrls) [list :N:$nk $hn $uh $t2(-points) 1]
} else { set kfnd 0
if {[set knkidx [lsearch -exact [string tolower $t2(-kusrls)] [string tolower :N:$nk]]]!="-1"} {
set kfnd 1
} elseif {$hn ne "*" && [set khnid [lsearch -exact $t2(-kusrls) $hn]]!="-1"} {
set kfnd 2 ; set knkidx [expr {$khnid-1}]
} elseif {[set kuhid [lsearch -exact $t2(-kusrls) $uh]]!="-1"} {
set kfnd 3 ; set knkidx [expr {$kuhid-2}]
}
if {$kfnd>"0"} { set kend [expr {$knkidx+4}]
foreach {knik khan kush kpnt kcnt} [lrange $t2(-kusrls) $knkidx $kend] { break }
incr kcnt ; set kpnt [expr {round("$kpnt.0"+$t2(-points))}]
if {$hn eq "*"} { set hn $khan }
set t2(-kusrls) [lreplace $t2(-kusrls) $knkidx $kend :N:$nk $hn $uh $kpnt $kcnt]
} else { lappend t2(-kusrls) :N:$nk $hn $uh $t2(-points) 1 }
}
if {$endnow=="1"} { set newaddls $t2(-kusrls) }
} else {
if {$t2(-abound)=="1"} { TBind a u }
if {$t2(descend)=="0"} { set points [expr {$t2(-points)*2}]
} elseif {$t2(-hntnum)=="1"} { set points [expr {$t2(-points)*2}]
} elseif {$t2(-hntnum)=="2"} { set points $t2(-points)
} else { set points [expr {$t2(-points)/2}] }
putquick "PRIVMSG $ch :$tclr(-tu2) YES,$tclr(-tu1) $nk $tclr(-tu2)got the answer ->$tclr(-tu1) $tx $tclr(-tu2)<- in$tclr(-tu1) $qestime.[rand 1000] $tclr(-tu2)seconds, and gets$tclr(-tu1) $points $tclr(-tu2)points "
set newaddls [list :N:$nk $hn $uh $points 1]
if {[string match -nocase "$nk *" $t2(-qansrd)]=="1"} {
set anscnt [expr { [lindex [split $t2(-qansrd)] 1]+1 }]
set t2(-qansrd) "$nk $anscnt"
} else { set anscnt 1 ; set t2(-qansrd) "$nk 1" }
set pstr "$tclr(-tu1) $nk $tclr(-tu2)has won$tclr(-tu1) $anscnt $tclr(-tu2)in a row!"
}
if {$endnow=="1"} {
if {$iskaos=="1"} { set opt 1
set kalltx "$tclr(-ktu) Congradulations, $tclr(-ktu2)You've Guessed Them All !!"
if {[llength $newaddls]>"5" && $t2(-kbon)>"0"} {
append kalltx " $tclr(-kbon) Everyone gets a$tclr(-kbon2) $t2(-kbon) Point $tclr(-kbon)Bonus !! "
set newaddl2 ""
} else { append kalltx "! " ; set t2(-kbon) 0 }
}
foreach {anik ahan aush apnt acnt} $newaddls {
if {$iskaos=="1"} {
if {$t2(-kbon)=="0"} { break }
set t2(-kgotpnts) [expr { round("$t2(-kgotpnts).0"+$t2(-kbon)) }]
set apnt [expr { round("$apnt.0"+$t2(-kbon)) }]
lappend newaddl2 $anik $ahan $aush $apnt $acnt
} else { set found 0
if {[set nikidx [lsearch -exact $t2(-active) $anik]]!="-1"} {
set found 1
} elseif {$ahan ne "*" && [set hanidx [lsearch -exact $t2(-active) $ahan]]!="-1"} {
set found 2 ; set nikidx [expr {$hanidx-1}]
} elseif {[set ushidx [lsearch -exact $t2(-active) $aush]]!="-1"} {
set found 3 ; set nikidx [expr {$ushidx-2}]
}
if {$found=="0"} { putquick "PRIVMSG $ch :$pstr" ; set opt 1
} else { set opt 0
set fndls [lrange $t2(-active) $nikidx [set lasidx [expr {$nikidx+5}]]]
foreach {fnk fhn fuh da we mo} $fndls { break }
set t2(-active) [lreplace $t2(-active) $nikidx $lasidx]
set da [expr {round("$da.0"+$apnt)}] ; set we [expr {round("$we.0"+$apnt)}]
set mo [expr {round("$mo.0"+$apnt)}]
if {$hn ne "*"} { set nhn $hn } else { set nhn $fhn }
set t2(-active) [linsert $t2(-active) 0 :N:$nk $nhn $uh $da $we $mo]
putquick "PRIVMSG $ch :$pstr Total Points TODAY:$tclr(-tu1) $da $tclr(-tu2) this WEEK:$tclr(-tu1) $we $tclr(-tu2) & this MONTH:$tclr(-tu1) $mo "
}
}
}
if {$iskaos=="1"} {
if {$t2(-kbon)>"0"} { set t2(-kusrls) $newaddl2 }
set kstats "$tclr(-kstat) Total Awarded:$tclr(-ksta2) $t2(-kgotpnts) Points "
if {[llength $t2(-kusrls)]>"5"} {
append kstats "$tclr(-kstat)to [expr {[llength $t2(-kusrls)]/5}] Players "
}
putquick "PRIVMSG $t2(chan) :$kalltx"
putquick "PRIVMSG $t2(chan) :$kstats"
}
array set t2 {-hint "" -hnt2 "" -hnt3 "" -uhint "" -uhnt2 "" -uhnt3 ""}
array set t2 {-points "" -questn "" -answer "" -uqes "" -utrigd 1 -udead 0}
array set t2 {-allansls ""}
if {$iskaos=="1"} { unset t2(-kansls) t2(-kanstot) t2(-kgotpnts) t2(-kbon) }
set t2(-htime) $t2(sethtime) ; set t2(-ptime) $t2(setptime)
if {$t2(dobonus)>"0"} {
if {$t2(-lastbns)<$t2(dobonus)} { incr t2(-lastbns)
} else { set t2(-lastbns) 0 ; incr t2(-shobons) }
}
if {$t2(kaos)>"0"} {
if {$t2(-iskaos)>=$t2(kaos)} { set t2(-iskaos) 1
} else { incr t2(-iskaos) }
}
set t2(-qtimer) [utimer $t2(-ptime) TShoTrv2]
set t2(-otimer) [utimer 4 [list TSavActiv $nk $uh $hn $apnt $opt $iskaos]]
}
}
proc TPQues {nk uh hn ch tx} { global t2 tclr
TBind q u ; putserv "PRIVMSG $ch :$t2(-uqes)" ; set t2(-uqes) ""
array set t2 {-utrigd 1 -udead 0}
set t2(-htime) $t2(sethtime) ; set t2(-ptime) $t2(setptime)
}
proc TDoHint {nk uh hn ch tx} { global t2 tclr ; TBind h u
if {$t2(-hntnum)=="1"} {
putserv "PRIVMSG $ch :$tclr(-hnt1) Hint:$tclr(-hnt2) $t2(-uhint) " ; set t2(-uhint) ""
} elseif {$t2(-hntnum)=="2"} {
putserv "PRIVMSG $ch :$tclr(-hnt1) Hint:$tclr(-hnt2) $t2(-uhnt2) " ; set t2(-uhnt2) ""
} else {
putserv "PRIVMSG $ch :$tclr(-hnt1) Hint:$tclr(-hnt2) $t2(-uhnt3) " ; set t2(-uhnt3) "" }
array set t2 {-utrigd 1 -udead 0}
set t2(-htime) $t2(sethtime) ; set t2(-ptime) $t2(setptime)
}
proc TOnOff {nk uh hn ch tx {from 0} } { global t2
if {![file exists $t2(sfpath)t2.settings]} {
set temp [TSetup $nk $uh $hn 1 1]
if {$temp=="0"} { return 0 }
}
if {$t2(-hbound)=="1"} { TBind h u }
if {$t2(-qbound)=="1"} { TBind q u }
if {$t2(-abound)=="1"} { TBind a u }
if {$t2(-ison)=="0"} {
TCntQes
if {$t2(-qfcnt)=="0"} {
putserv "PRIVMSG $ch :$t2(script): No questions loaded."
return 0
}
if {[TSavHist]=="0"} { TReadHist 0
} else { set t2(-histcnt) 0 ; set t2(-yestrda) 0 }
if {[file exists $t2(sfpath)t2.users]} { set isnewus 0
} else { TSavUsers ; set isnewus 1 }
set wasbad [TSavActiv]
putquick "PRIVMSG $ch :$t2(script) by $t2(auth) Loading..."
array set t2 {-shorand 0 -randcnt 0 -shoda10 0 -showe10 0 -shomo10 0 -shoev10 0}
array set t2 {-shohist 0 -qansrd 0 -qmissd 0 -utrigd 0 -udead 0 -shoad 0}
array set t2 {-shobons 0 -lastbns 0 -qtimer "" -otimer "" -qstart "" -dosave 0}
array set t2 {-preqes "" -active ""}
if {$isnewus=="0" || $wasbad=="1"} { TSavUsers }
set thifile [open $t2(sfpath)t2.hist a]
puts $thifile "::O:on $nk $hn $uh [unixtime]"
close $thifile
TBind s ; bind time - "* * * * *" TBndTime
if {[string length $t2(-qcount)]<"4"} { set tmcnt $t2(-qcount)
} else {
set tmcnt [string trimleft [string range $t2(-qcount) end-2 end] 0]
if {$tmcnt==""} { set tmcnt 0 }
}
set qflcnt 0
set t2(-opnfil) [open $t2(-qflnow)]
if {$tmcnt!="0"} {
while {![eof $t2(-opnfil)] && $qflcnt<$tmcnt} {
set qfline [gets $t2(-opnfil)] ; incr qflcnt }
if {$qfline == ""} { return 0 }
}
if {$t2(kaos)>"0"} {
if {$t2(-iskaos)=="0"} {
if {$t2(kaos)>"5"} { set t2(-iskaos) [expr {($t2(kaos)-4)-[rand 3]}]
if {$t2(-iskaos)<"1"} { set t2(-iskaos) $t2(kaos) }
} else { set t2(-iskaos) $t2(kaos) }
}
set tmc2 -1 ; set stopat [expr {$t2(-kcount)-1}]
foreach tmkfl $t2(-kfills) {
if {$tmkfl==$t2(-kflnow)} { break }
set temp [split [lindex [split $tmkfl /] end] .]
if {[llength $temp]=="3"} { incr tmc2 1000
} else { incr tmc2 [lindex $temp 3] }
}
set t2(-opnkfil) [open $t2(-kflnow)]
set kfline :start:
while {![eof $t2(-opnkfil)]} {
if {$tmc2==$stopat} { break }
set kfline [gets $t2(-opnkfil)] ; incr tmc2
}
if {$kfline == ""} { return 0 }
}
set t2(-ison) 1 ; set t2(-hntnum) -1 ; TShoTriv
} else {
set t2(-ison) 0 ; set timrls [utimers]
if {[lsearch $timrls "* $t2(-qtimer)"]!="-1"} { killutimer $t2(-qtimer) }
if {[lsearch $timrls "* $t2(-otimer)"]!="-1"} { killutimer $t2(-otimer) }
set t2(-qtimer) "" ; set $t2(-otimer) ""
if {$t2(-hbound)=="1"} { TBind h u }
if {$t2(-qbound)=="1"} { TBind q u } ; if {$t2(-abound)=="1"} { TBind a u }
TBind s u ; unbind time - "* * * * *" TBndTime
close $t2(-opnfil) ; close $t2(-opnkfil)
if {$t2(kaos)>"0" && $t2(-iskaos)==$t2(kaos) && $t2(-kusrls) ne ""} {
TSavActiv nk u@h hn apnt 1 2
}
TSavUsers 1 ; file delete $t2(sfpath)t2.recent
set thifile [open $t2(sfpath)t2.hist a]
puts $thifile "::O:off $nk $hn $uh [unixtime]" ; close $thifile
array set t2 {-hint "" -hnt2 "" -hnt3 "" -uhint "" -uhnt2 "" -uhnt3 ""}
array set t2 {-points "" -questn "" -answer "" -uqes "" -active "" -preqes ""}
if {[info exists t2(-allansls)]} { unset t2(-allansls) }
if {[info exists t2(-kusrls)]} { unset t2(-kusrls) }
if {[info exists t2(-kansls)]} { unset t2(-kansls) }
if {[info exists t2(-kanstot)]} { unset t2(-kanstot) }
if {[info exists t2(-kgotpnts)]} { unset t2(-kgotpnts) }
if {[info exists t2(-kbon)]} { unset t2(-kbon) }
putquick "PRIVMSG $ch :$t2(script) by $t2(auth) Stopped."
}
}
proc TShoTriv {} { global t2 tclr
if {$t2(-ison)=="0"} { return 0 } ; set iskaos 0
if {$t2(kaos)>"0" && $t2(-iskaos)==$t2(kaos)} { set iskaos 1 }
if {$t2(-hntnum)>=$t2(hntcnt) || $t2(-hntnum)=="-1" || $t2(-hntnum)=="-2"} {
if {$t2(-hntnum)=="-1"} { set t2(-qtimer) [utimer 8 TShoTriv]
} elseif {$t2(-hntnum)=="-2"} { return 0
} else {
set t2(-qtimer) [utimer $t2(-ptime) TShoTriv]
if {$iskaos=="1"} {
set kleft [expr {[llength $t2(-kansls)]/4}]
set kgot [expr {$t2(-kanstot)-$kleft}]
set kusrs [expr {[llength $t2(-kusrls)]/5}]
set ktutmp "$tclr(-ktu)Times up! $tclr(-ktu2) No one got $tclr(-kng) "
foreach {kans hn2 hn3 kvar} $t2(-kansls) { append ktutmp "\[$kans\] " }
putquick "PRIVMSG $t2(chan) :$ktutmp"
if {$kgot>"0"} {
set ktutm2 "$tclr(-kstat) Correctly Answered:$tclr(-ksta2) $kgot of $t2(-kanstot) "
append ktutm2 "$tclr(-kstat) Total Awarded:$tclr(-ksta2) $t2(-kgotpnts) Points "
if {$kusrs>"1"} { append ktutm2 "$tclr(-kstat)to $kusrs Players " }
putquick "PRIVMSG $t2(chan) :$ktutm2"
}
} else {
putquick "PRIVMSG $t2(chan) :$tclr(-tu1)Times up! $tclr(-tu2) The answer was -> $tclr(-tu1) $t2(-answer) $tclr(-tu2) <-"
}
}
if {$t2(-hntnum)>"-1" && $iskaos=="1" && $kgot>"0"} {
set t2(-otimer) [utimer 4 [list TSavActiv nk u@h hn apnt 1 1]]
} else { set t2(-otimer) [utimer 4 TMkLines]
if {$t2(-hntnum)>"-1" && $iskaos=="1"} { unset t2(-kusrls) }
}
if {$t2(-abound)=="1"} { TBind a u }
if {$t2(-qbound)=="1"} { TBind q u } ; if {$t2(-hbound)=="1"} { TBind h u }
array set t2 {-hint "" -hnt2 "" -hnt3 "" -uhint "" -uhnt2 "" -uhnt3 ""}
array set t2 {-points "" -questn "" -answer "" -uqes "" -hntnum 0}
set t2(-allansls) ""
if {$iskaos=="1"} {
if {[info exists t2(-kanstot)]} { unset t2(-kanstot) }
if {[info exists t2(-kansls)]} { unset t2(-kansls) }
if {[info exists t2(-kgotpnts)]} { unset t2(-kgotpnts) }
if {[info exists t2(-kbon)]} { unset t2(-kbon) }
}
if {$t2(dobonus)>"0"} {
if {$t2(-lastbns)<$t2(dobonus)} { incr t2(-lastbns)
} else { set t2(-lastbns) 0 ; incr t2(-shobons) }
}
if {$t2(kaos)>"0"} {
if {$t2(-iskaos)>=$t2(kaos)} { set t2(-iskaos) 1
} else {
if {$t2(krest)=="1"} {
if {$t2(-udead)<$t2(rqcnt)} { incr t2(-iskaos) }
} elseif {$t2(krest)>"1"} {
if {$t2(-udead)<$t2(sqcnt)} { incr t2(-iskaos) }
} else { incr t2(-iskaos) }
}
}
} elseif {$t2(-hntnum)=="0" || $t2(-hntnum)=="-3"} {
if {$t2(-preqes) != ""} {
putquick "PRIVMSG $t2(chan) :$tclr(-randad) $t2(-preqes) " ; set t2(-preqes) ""
}
putquick "PRIVMSG $t2(chan) :$t2(-questn)"
putquick "PRIVMSG $t2(chan) :$t2(-hint)"
if {$t2(-uhint)!=""} { TBind h } ; TBind a
set t2(-qstart) [unixtime]
if {$iskaos=="1"} {
incr t2(-kcount) ; set tkcntfil [open $t2(sfpath)t2.kcount w]
puts $tkcntfil "$t2(-kcount)" ; close $tkcntfil
set t2(-qtimer) [utimer $t2(ktime) TShoTriv]
} else {
incr t2(-qcount) ; set tqcntfil [open $t2(sfpath)t2.qcount w]
puts $tqcntfil "$t2(-qcount)" ; close $tqcntfil
set t2(-qtimer) [utimer $t2(-htime) TShoTriv]
}
set t2(-hntnum) 1
} elseif {$t2(-hntnum)=="1"} {
set t2(-hntnum) 2
if {$iskaos=="1"} {
set t2(-qtimer) [utimer $t2(ktime) TShoTriv] ; set doshort 0
if {$t2(krest)=="1" && $t2(-udead)>=$t2(rqcnt)} { set doshort 1
} elseif {$t2(krest)>"1" && $t2(-udead)>=$t2(sqcnt)} { set doshort 1 }
set t2(-hnt2) "$tclr(-khnt) 2nd Hint:$tclr(-khnt2)"
if {$t2(kstyle)>"1" || $doshort=="1"} {
set kleft [expr {[llength $t2(-kansls)]/4}]
if {$kleft==$t2(-kanstot)} { append t2(-hnt2) " All Answers Remaining at "
} elseif {$kleft=="1"} { append t2(-hnt2) " One Answer Remaining at "
} else { append t2(-hnt2) " $kleft of $t2(-kanstot) Answers Remaining at " }
if {$kleft=="1"} { append t2(-hnt2) "$t2(-points) Points $t2(-endclr) $tclr(-kpnt1) "
} else { append t2(-hnt2) "$t2(-points) Points Each $t2(-endclr) $tclr(-kpnt1) " }
putquick "PRIVMSG $t2(chan) :$t2(-hnt2)[expr {$t2(ktime)*2}] seconds "
} else {
if {$t2(descend)=="1"} { set t2(-points) [expr {$t2(-points)/2}] }
foreach {kans hn2 hn3 kvar} $t2(-kansls) { append t2(-hnt2) " $hn2" }
append t2(-hnt2) " $t2(-endclr) $tclr(-kpnt1) [expr {$t2(ktime)*2}] seconds "
putquick "PRIVMSG $t2(chan) :$t2(-hnt2)"
}
} else {
set t2(-qtimer) [utimer $t2(-htime) TShoTriv]
set t2(-hnt2) "$tclr(-hint) 2nd Hint:$tclr(-hint2) $t2(-hnt2) $t2(-endclr) "
if {$t2(descend)=="1"} {
append t2(-hnt2) "$tclr(-pnt1) [expr {$t2(-htime)*2}] secs &$tclr(-pnt2) $t2(-points)"
putquick "PRIVMSG $t2(chan) :$t2(-hnt2) Points $tclr(-pnt1)Remaining "
} else {
append t2(-hnt2) "$tclr(-pnt1) [expr {$t2(-htime)*2}] secs remaining. Value:"
putquick "PRIVMSG $t2(chan) :$t2(-hnt2)$tclr(-pnt2) [expr {$t2(-points)*2}] Points "
}
}
if {$t2(-uqes)!="" && $t2(usrqes)=="1"} { TBind q }
if {$t2(-uhnt2)!=""} {
if {$t2(-hbound)=="0"} { TBind h }
} else {
if {$t2(-hbound)=="1"} { TBind h u }
}
} elseif {$t2(-hntnum)=="2"} {
set t2(-hntnum) 3
if {$iskaos=="1"} {
set t2(-qtimer) [utimer $t2(ktime) TShoTriv] ; set doshort 0
if {$t2(krest)=="1" && $t2(-udead)>=$t2(rqcnt)} { set doshort 1
} elseif {$t2(krest)>"1" && $t2(-udead)>=$t2(sqcnt)} { set doshort 1 }
set t2(-hnt3) "$tclr(-khnt) 3rd Hint:$tclr(-khnt2)"
if {$t2(kstyle)>"2" || $doshort=="1"} {
set kleft [expr {[llength $t2(-kansls)]/4}]
if {$kleft==$t2(-kanstot)} { append t2(-hnt3) " All Answers Remaining at "
} elseif {$kleft=="1"} { append t2(-hnt3) " One Answer Remaining at "
} else { append t2(-hnt3) " $kleft of $t2(-kanstot) Answers Remaining at " }
if {$kleft=="1"} { append t2(-hnt3) "$t2(-points) Points $t2(-endclr) $tclr(-kpnt1) "
} else { append t2(-hnt3) "$t2(-points) Points Each $t2(-endclr) $tclr(-kpnt1) " }
putquick "PRIVMSG $t2(chan) :$t2(-hnt3)$t2(ktime) seconds "
} else {
if {$t2(descend)=="1"} { set t2(-points) [expr {$t2(-points)/2}] }
foreach {kans hn2 hn3 kvar} $t2(-kansls) { append t2(-hnt3) " $hn3" }
append t2(-hnt3) " $t2(-endclr) $tclr(-kpnt1) $t2(ktime) seconds "
putquick "PRIVMSG $t2(chan) :$t2(-hnt3)"
}
} else {
set t2(-qtimer) [utimer $t2(-htime) TShoTriv]
set t2(-hnt3) "$tclr(-hint) 3rd Hint:$tclr(-hint2) $t2(-hnt3) $t2(-endclr) "
if {$t2(descend)=="1"} {
append t2(-hnt3) "$tclr(-pnt1) $t2(-htime) secs &$tclr(-pnt2) [expr {$t2(-points)/2}]"
putquick "PRIVMSG $t2(chan) :$t2(-hnt3) Points $tclr(-pnt1)Remaining "
} else {
append t2(-hnt3) "$tclr(-pnt1) $t2(-htime) secs remaining. Value:"
putquick "PRIVMSG $t2(chan) :$t2(-hnt3)$tclr(-pnt2) [expr {$t2(-points)*2}] Points "
}
}
if {$t2(-uhnt3)!=""} {
if {$t2(-hbound)=="0"} { TBind h }
} else {
if {$t2(-hbound)=="1"} { TBind h u }
}
}
}
proc TSavActiv { {nk 0} {uh 0} {hn 0} {points 0} {opt 0} {iskaos 0} } {
global t2 tclr ; set isnew 0
if {![file exists $t2(sfpath)t2.recent]} {
set trefile [open $t2(sfpath)t2.recent w]
puts $trefile "::N:[unixtime]"
set t2(-reccnt) 0
if {$nk eq "0"} { close $trefile ; return 0 } ; set isnew 1
} else {
if {$nk eq "0"} {
TSavUsers 1 ; set trefile [open $t2(sfpath)t2.recent w]
puts $trefile "::N:[unixtime]" ; close $trefile
set t2(-reccnt) 0 ; return 1
}
}
if {$isnew=="0"} { set trefile [open $t2(sfpath)t2.recent a] }
if {$iskaos=="0"} { puts $trefile ":N:$nk $hn $uh $points" ; incr t2(-reccnt)
} else {
foreach {nk hn uh pnt cnt} $t2(-kusrls) {
puts $trefile "$nk $hn $uh $pnt $cnt" ; incr t2(-reccnt)
}
unset t2(-kusrls)
}
close $trefile
if {$iskaos < "2"} { set t2(-otimer) ""
if {$opt == "1"} { TSavUsers 1 ; TSavUsers 0
} elseif {$t2(-reccnt) >= $t2(recsiz)} { TSavUsers 1 }
TMkLines
}
}
proc TSavUsers { {wat 0} } { global t2 tclr ; set isnew 0 ; set tlin0 ""
if {![file exists $t2(sfpath)t2.users]} {
set tlin0 "::N:[unixtime] 0 [unixtime] 0 [unixtime] 0 [unixtime] 0 0"
set tusfile [open $t2(sfpath)t2.users w]
puts $tusfile "$tlin0" ; close $tusfile
if {$wat=="0"} { return 1 } ; set isnew 1
} else {
if {$wat=="0"} {
set tusfile [open $t2(sfpath)t2.users] ; set tlin0 [gets $tusfile]
set t2(-active) "" ; set lincnt 0
foreach {nt d10 dt w10 wt m10 mt e10 uc} $tlin0 { break }
if {[strftime %j $dt] != [strftime %j]} {
close $tusfile ; TSavHist 1
set tusfile [open $t2(sfpath)t2.users] ; set tlin0 [gets $tusfile]
}
while {![eof $tusfile]} {
set temp [gets $tusfile]
if {$temp ne ""} { incr lincnt
if {$lincnt>&