on *:load:{ write missed.txt Sorry guys, but you got it wrong! write missed.txt Aww cmon guys! write missed.txt If only you guys were as good as $hget(trivia,owner) $+ ! write missed.txt You suck! write missed.txt I can't believe you got it wrong... write missed.txt You guys are miserable at this... hadd -m trivia strivia ison :start var %x = $input(Who would you like to set as your owner?,qe,Bot Owner) if (%x != $null) hadd -m trivia owner %x else goto start :chan var %y = $input(What channel would you like trivia to be for?,qe,Trivia Channel) if ($left(%y,1) == $chr(35)) hadd -m trivia chan %y else goto chan } on *:kick:#:{ if ($knick == $me && $chan == $hget(trivia,chan)) { hadd -m trivia status off hdel trivia answer hdel trivia time .timertriv* off unset %streak* unset %wrong } } on *:start:{ if (!$hget(scoreS)) hmake scores if (!$hget(reports)) hmake reports if (!$hget(questions)) hmake questions hload -i reports reports.ini hload -i questions questions.ini hload -i scores scores.ini if (!$hget(trivia)) hmake trivia hload -i trivia trivia.ini if (!$hget(trivia,owner)) { :start var %x = $input(Who would you like to set as your owner?,qe,Bot Owner) if (%x != $null) hadd -m trivia owner %x else goto start } } on *:join:#:{ if ($chan == $hget(trivia,chan) && $nick == $me) { if ($dialog(trivia)) { did -e trivia 9 did -b trivia 10 } } } on *:part:#:{ if ($nick == $me && $chan == $hget(trivia,chan)) { if ($dialog(trivia)) { did -e trivia 9 did -b trivia 10,9 } hadd -m trivia status off hdel trivia answer hdel trivia time .timertriv* off unset %streak* unset %wrong } } on *:exit:{ hsave -i trivia trivia.ini hsave -i scores scores.ini hsave -i reports reports.ini hsave -i questions questions.ini } on *:connect: if ($dialog(trivia)) did -e trivia 9 on *:disconnect:{ hadd -m trivia status off hdel trivia answer hdel trivia time .timertriv* off unset %streak* unset %wrong if ($dialog(trivia)) did -b trivia 10,9 } menu * { Trivia: trivia } on *:text:*:#:{ if ($chan == $hget(trivia,chan)) { if ($istok(!trivia !start,$1,32)) { if ($hget(trivia,status) != on) { hadd -m trivia status on .msg $chan $+(03Trivia has been started by04 $nick,03!) .timertrivnew 1 2 new if ($dialog(trivia)) { did -b trivia 9 did -e trivia 10 } } else .msg $chan 03Trivia is already04 on03 $+ ! } if ($istok(!strivia !stop,$1,32)) { if ($hget(trivia,status) == on) { if ($nick $hgeT(trivia,strivia) $chan) { hadd -m trivia status off hdel trivia answer hdel trivia time .timertriv* off unset %streak* .msg $chan 03Trivia has been stopped by04 $nick $+ 03! if ($dialog(trivia)) { did -b trivia 10 did -e trivia 9 } } else .msg $chan you dont have access to that command } else .msg $chan 03Trivia is already04 off3 $+ ! } if ($strip($1-) == $hget(trivia,answer)) { unset %wrong var %time = $calc($calc($ticks - $hget(trivia,time)) / 1000) var %a = %streak [ $+ [ $nick ] ] unset %streak* set %streak [ $+ [ $nick ] ] $calc(%a + 1) hdel trivia answer .timertriv* off hinc -m scores $nick .msg $chan $+(06,$gettok(Way to go|That's the way|Wahoo|You got it,$r(1,4),124),$chr(32),04,$nick,06!) The answer was04 $strip($1-) $+ 06! You got it in04 %time 06seconds! Your streak is4 %streak [ $+ [ $nick ] ] 6questions! .msg $chan 06You are ranked4 $rank($nick) 06out of04 $hget(scores,0).item 06with04 $score($nick) 06points! $iif($hget(scores,0).item > 1,$iif(1st* !iswm $rank($nick),06You are behind04 $behind($nick) 06with04 $score($behind($nick)) 06points!,04 $+ $first 06is trailing behind you with04 $score($first) 06points!),You are the first one to score!) if ($dialog(trivia) && $did(trivia,14).seltext == $nick) did -ra trivia 15 $hget(scores,$nick) Points .timertrivrightnew 1 3 new } if ($istok(!top10 !topten !top !scores !topscores,$1,32)) top10 if ($1 == !score) { if ($2) { if (*has no rank yet !iswm $rank($2)) { .msg $chan 04 $+ $2 03is ranked4 $rank($2) 03out of04 $hget(scores,0).item 03with4 $score($2) 03points! } else .msg $chan 4 $+ $2 3isn't currently ranked. } else { if (*has no rank yet !iswm $rank($nick)) { .msg $chan 04You03 are ranked04 $rank($nick) 03out of04 $hget(scores,0).item 03with04 $score($nick) 03points! } else .msg $chan 4You3 aren't currently ranked. } } if ($1 == !report) { if ($2 <= $hget(questions,0).item && $3) { var %x = $hget(questions,$2) var %y = 1 var %z = $hget(reports,1).item while $hgeT(reports,%y).item { if ($v1 > %z) var %z = $v1 inc %y } hadd -m reports $calc(%z + 1) $gettok(%x,1,1) $chr(1) $3- .msg $chan 03Thanks04 $nick $+ 03,00 $+ $chr(44) $+ 04 $hgeT(trivia,owner) 03will read your report shortly. if ($dialog(trivia)) { did -r trivia 51 var %x = 1 while $hget(reports,%x).item { did -a trivia 51 $gettok($hget(reports,$v1),1,1) inc %x } did -z trivia 51 } } else .msg $chan 12Syntax03: !report <04ques #03> <04problem03> } if ($1 == !questions) .msg $chan 03There are currently04 $lines(trivia.txt) 03questions. if ($1 == !give) { if ($nick == $hget(trivia,owner)) { if ($3 isnum) { if (!$hget(scores,$2) && $dialog(trivia)) { did -a trivia 14 $2 | did -z trivia 14 } hadd -m scores $2 $3 .msg $chan 04 $+ $2 03now has04 $score($2) 03points. if ($dialog(trivia) && $did(trivia,14).seltext == $2) did -ra trivia 15 $3 Points } else .msg $chan 12Syntax: 03!give <4nick3> <4points3> } else .msg $chan 03I don't believe you're04 $hget(trivia,owner) $+ 03. } if ($istok(!trivhelp !help !triviahelp,$1,32)) { .notice $nick ~*~Trivia Commands~*~ .notice $nick !trivia ~ Starts Trivia .notice $nick !strivia ~ Stops Trivia $iif($hget(trivia,strivia) != ison,If You Are) $iif($hget(trivia,strivia) == isop,Op'd) $iif($hget(trivia,strivia) == isvoice,Voiced) .notice $nick !score ~ Returns Your Rank and Score .notice $nick !score ~ Returns 's Rank and Score .notice $nick !report ~ Report a Question .notice $nick !trivhelp ~ Returns Trivia Help (This) .notice $nick !questions ~ Returns Number of Trivia Questions if ($nick == $hget(trivia,owner)) .notice $nick !give ~ Give Someone Points } } } alias -l new { var %chan = $hget(trivia,chan) var %total = $hget(questions,0).item var %number = $hget(questions,$r(1,%total)).item var %file = $hget(questions,%number) hdel trivia answer hadd -m trivia answer $gettok(%file,4,1) .msg %chan $+(11~04*11~03Question04 %number,06/04,$hget(questions,0).item,11~04*11~) .msg %chan 12 $+ $gettok(%file,1,1) hadd -m trivia time $ticks .timertrivhint1 1 2 .msg %chan 03Hint: $gettok(%file,2,1) .timertrivhint2 1 15 .msg %chan 03Hint: $gettok(%file,3,1) .timertrivwrong 1 30 wrong } alias -l wrong { inc %wrong if (%wrong >= $hget(trivia,wrong)) { hadd -m trivia status off hdel trivia answer hdel trivia time .timertriv* off unset %streak* .msg $hget(trivia,chan) 04 %wrong 10questions have gone by unanswered! Trivia has been stopped by04 $me $+ 10! unset %wrong if ($dialog(trivia)) { did -b trivia 10 did -e trivia 9 } } else { .msg $hget(trivia,chan) 10 $+ $read(missed.txt) Get ready for the next question... unset %streak* .timertrivnewfromwrong 1 2 new } } alias -l top10 { var %d = 1, %w = @top10 window -hn %w clear %w while $hget(scores,%d).item { aline %w $v1 $hget(scores,$v1) inc %d } filter -cteuww 2 32 %w %w var %k = 1, %k1 while %k <= 10 { if ( $line(%w,%k) ) { tokenize 32 $v1 if (%k == 1) var %x = $addtok(%x,04 $+ $1 ~ $hget(scores,$1),44) if (%k == 2) var %x = $addtok(%x,12 $+ $1 ~ $hget(scores,$1),44) if (%k == 3) var %x = $addtok(%x,03 $+ $1 ~ $hget(scores,$1),44) elseif (%k isnum 4-10) var %x = $addtok(%x,06 $+ $1 ~ $hget(scores,$1),44) } inc %k } .msg $hget(trivia,chan) $mid($iif($line(%w,1),$mid($replace(%x,$chr(44),$chr(44) $chr(32))%x,3),3There are no high scores.),5) } alias -l rank { var %d = 1, %w = @top10, %n = $$1 window -hn %w clear %w while $hget(scores,%d).item { aline %w $v1 $hget(scores,$v1) inc %d } filter -cteuww 2 32 %w %w return $iif($fline(%w,%n *,1),$ord($v1),$1 has no rank yet) } alias -l score { var %d = 1, %w = @top10, %n = $$1 window -hn %w clear %w while $hget(scores,%d).item { aline %w $v1 $hget(scores,$v1) inc %d } filter -cteuww 2 32 %w %w return $iif($fline(%w,%n *,1),$gettok($line(%w,$v1),2,32),$1 has no score yet) } alias -l behind { if ($isid) { var %d = 1, %w = @top5, %n = $$1 window -hn %w clear %w while $hget(scores,%d).item { aline %w $v1 $hget(scores,$v1) inc %d } filter -cteuww 2 32 %w %w return $iif($gettok($line(%w,$calc($fline(%w,%n *,1) - 1)),1,32) != 3,$v1,first) } } alias -l first { if ($isid) { var %d = 1, %w = @top5 window -hn %w clear %w while $hget(scores,%d).item { aline %w $v1 $hget(scores,$v1) inc %d } filter -cteuww 2 32 %w %w return $iif($line(%w,1),$gettok($line(%w,2),1,32),error) } } dialog trivia { title "Trivia" size -1 -1 136 203 option dbu tab "Settings", 1, 2 -1 132 201 box "!Strivia Command", 5, 7 52 58 60, tab 1 radio "Op", 6, 16 62 22 10, tab 1 radio "Voice", 7, 16 77 25 10, tab 1 radio "All Users", 8, 16 92 34 10, tab 1 button "Start Trivia", 9, 26 30 37 12, disable tab 1 button "Stop Trivia", 10, 65 30 37 12, disable tab 1 box "Trivia Status", 12, 23 20 83 26, tab 1 text "Owner:", 43, 10 125 19 8, tab 1 edit "", 44, 32 124 74 10, tab 1 read autohs button "Edit", 45, 109 125 15 8, tab 1 text "Channel:", 46, 10 139 23 8, tab 1 edit "", 47, 32 138 74 10, tab 1 read autohs button "Edit", 48, 109 139 15 8, tab 1 box "", 49, 7 117 121 35, tab 1 box "Stop After N Wrong", 54, 70 52 58 60, tab 1 radio "5 Questions", 55, 76 60 50 10, tab 1 radio "10 Questions", 56, 76 71 50 10, tab 1 radio "15 Questions", 57, 76 81 50 10, tab 1 radio "20 Questions", 58, 76 91 50 10, tab 1 radio "Unlimited", 59, 76 101 50 10, tab 1 edit "", 60, 10 165 98 10, tab 1 box "Add Missed Question Response", 62, 7 157 121 21, tab 1 button "Add", 61, 109 165 15 8, disable tab 1 tab "Reports", 2 edit "", 50, 7 121 123 10, tab 2 read autohs list 51, 6 23 123 84, tab 2 sort size hsbar box "Reported Questions", 52, 4 15 127 94, tab 2 box "Functions", 66, 16 144 98 20, tab 2 button "Clear", 67, 50 152 30 10, disable tab 2 button "Remove", 68, 20 152 30 10, disable tab 2 button "Fix", 22, 80 152 30 10, disable tab 2 box "Problem", 53, 5 113 127 20, tab 2 tab "Questions", 3 list 23, 6 23 123 84, tab 3 sort size hsbar button "Convert", 24, 7 169 30 10, tab 3 button "Add", 25, 37 169 30 10, tab 3 button "Clear", 26, 97 169 30 10, disable tab 3 button "Remove", 27, 67 169 30 10, disable tab 3 box "Functions", 28, 5 161 124 20, tab 3 box "Questions", 29, 4 15 127 94, tab 3 edit "", 30, 30 136 82 10, tab 3 read autohs text "Hint 1:", 33, 6 126 18 8, tab 3 edit "", 32, 30 147 82 10, tab 3 read autohs edit "", 31, 30 125 82 10, tab 3 read autohs text "Hint 2:", 35, 6 138 18 8, tab 3 text "Answer:", 34, 6 148 22 8, tab 3 box "", 36, 4 109 127 50, tab 3 button "Edit", 37, 113 137 15 8, disable tab 3 button "Edit", 39, 113 148 15 8, disable tab 3 button "Edit", 38, 113 126 15 8, disable tab 3 text "Question:", 40, 6 115 25 8, tab 3 edit "", 41, 30 114 82 10, tab 3 read autohs button "Edit", 42, 113 115 15 8, disable tab 3 tab "Scores", 4 box "Scores", 13, 6 17 53 155, tab 4 list 14, 9 25 47 144, tab 4 sort size hsbar edit "", 15, 66 136 59 10, tab 4 read autohs box "Score", 16, 64 128 64 21, tab 4 button "Edit", 17, 75 78 37 12, disable tab 4 button "Add", 18, 75 38 37 12, tab 4 button "Remove", 19, 75 58 37 12, disable tab 4 button "Clear", 20, 75 98 37 12, disable tab 4 box "Functions", 21, 72 27 44 88, tab 4 button "OK", 11, 48 185 37 12, ok cancel } alias trivia { if ($dialog(trivia)) dialog -x trivia trivia dialog -m trivia trivia } on *:dialog:trivia:*:*:{ var %chan = $hgeT(trivia,chan) if ($devent == init) { if ($hget(trivia,wrong) == 5) did -c trivia 55 if ($hget(trivia,wrong) == 10) did -c trivia 56 if ($hget(trivia,wrong) == 15) did -c trivia 57 if ($hget(trivia,wrong) == 20) did -c trivia 58 if ($hget(trivia,wrong) !isnum) did -c trivia 59 if ($hget(reports,1).item) did -e trivia 67 did -a trivia 44 $hget(trivia,owner) if ($hget(reports)) { var %asdf = 1 while $hget(reports,%asdf).item { did -a trivia 51 $gettok($gettok($hget(reports,$v1),1,1),1,1) inc %asdf } did -z trivia 51 } did -a trivia 47 $hget(trivia,chan) if ($hget(questions,1).item) did -e trivia 26 var %s = 1 while $hgeT(questions,%s).item { did -a trivia 23 $gettok($hget(questions,$v1),1,1) inc %s } did -z trivia 23 if ($hget(trivia,status) == on) did -e trivia 10 else did -e trivia 9 var %x = 1 while $hget(scores,%x).item { did -a trivia 14 $v1 inc %x } did -z trivia 14 if ($hgeT(scores)) did -e trivia 20 if ($hget(trivia,strivia) == ison) did -c trivia 8 if ($hget(trivia,strivia) == isvoice) did -c trivia 7 if ($hgeT(trivia,strivia) == isop) did -c trivia 6 if (!$server) did -b trivia 9,10 } if ($devent == sclick) { if ($did == 9) { if ($hget(trivia,status) != on) { hadd -m trivia status on did -b trivia 9 did -e trivia 10 .msg %chan $+(03Trivia has been started by04 $me,03!) .timertrivnew 1 2 new } } if ($did == 10) { if ($hget(trivia,status) == on) { hadd -m trivia status off hdel trivia answer hdel trivia time did -e trivia 9 did -b trivia 10 .timertriv* off unset %streak* .msg %chan 03Trivia has been stopped by04 $me $+ 03! } } if ($did == 14 && $diD(trivia,14).seltext != $null) { did -ra trivia 15 $hget(scores,$did(trivia,14).seltext) Points did -e trivia 19,17 } if ($did isnum 6-8) { if ($did == 6) hadd -m trivia strivia isop if ($did == 7) hadd -m trivia strivia isvoice if ($did == 8) hadd -m trivia strivia ison if ($hget(trivia,wrong) == 5) did -c trivia 55 if ($hget(trivia,wrong) == 10) did -c trivia 56 if ($hget(trivia,wrong) == 15) did -c trivia 57 if ($hget(trivia,wrong) == 20) did -c trivia 58 if ($hget(trivia,wrong) !isnum) did -c trivia 59 } if ($did == 20) { var %x = $input(Are you sure you would like to erase all scores?,cy,Clear All Scores) if (%x == $true) { hfree scores did -r trivia 14,15 did -b trivia 20,17,19 .msg %chan 4All03 scores cleared. } } if ($did == 19) { var %x = $input(Are you sure you would like to erase $did(trivia,14).seltext $+ 's score?,cy,Clear $did(trivia,14).seltext $+ 's Score) if (%x == $true) { .msg %chan 04 $+ $did(trivia,14).seltext $+ 03's score has been 04cleared03. hdel scores $did(trivia,14).seltext did -r trivia 15,14 did -b trivia 17,19,20 var %y = 1 while $hgeT(scores,%y).item { did -a trivia 14 $v1 inc %y } did -z trivia 14 if ($hget(scores,1).item) did -e trivia 20 } } if ($did == 18) { var %x = $input(Who would you like to add to the score list?,qe,Adding Score) if (%x != $null) { if ($numtok(%x,32) == 1) { var %y = $input(What would you like %x $+ 's score to be?,qe,%x $+ 's Score) if (%y isnum && %y) { hadd -m scores %x %y .msg %chan 04 $+ %x 03now has 04 $+ %y 03points! did -r trivia 15,14 did -b trivia 17,19 did -e trivia 20 var %a = 1 while $hget(scores,%a).item { did -a trivia 14 $v1 inc %a } did -z trivia 14 } else var %test = $input(The score must be a number!,ho,Error!) } else var %sos = $input(The name must be one word!,ho,Error!) } else var %asdf = $input(You must enter a name!,ho,Error!) } if ($did == 17) { var %x = $input(What would you like $did(trivia,14).seltext $+ 's new score to be?,qe,$did(trivia,14).seltext $+ 's Score,$hget(scores,$did(trivia,14).seltext)) if (%x isnum) { hadd -m scores $did(trivia,14).seltext %x .msg %chan 4 $+ $did(trivia,14).seltext 03now has04 %x 03points! did -ra trivia 15 %x Points } else var %asdf = $input(The score must be a number!,ho,Error!) } if ($did == 24) { var %x = $input(What txt file would you like to add to the questions list?,qe,File Conversion) if (%x != $null) { if ($isfile(%x)) { if ($right(%x,4) == .txt) { var %as = $input(What is the delimeter that seperates the hints and questions?,qe,Delimeter) if (%as isnum) { did -r trivia 23,30,31,32,41 var %y = 1 var %z = $hget(questions,1).item while $hget(questions,%y).item { if ($v1 > %z) var %z = $v1 inc %y } var %a = 1 while $read(%x,%a) { hadd -m questions $calc(%z + 1) $replace($v1,$chr(%as),$chr(1)) inc %z inc %a } var %b = 1 while $hget(questions,%b).item { did -a trivia 23 $gettok($hget(questions,$v1),1,1) inc %b } did -z trivia 23 did -e trivia 26 did -b trivia 27,38,37,39,42 } else var %something = $input(The delemiter must be a number!,ho,Error!) } else var %asdf = $input(The file must end in .txt,ho,Error!) } else var %ad = $input(%x isn't even a file!,ho,Error!) } } if ($did == 25) { var %ques = $input(What question would you like to add?,qe,Question) if (%ques != $null) { var %hint1 = $input(What would you like the first hint to be?,qe,Hint 1) if (%hint1 != $null) { var %hint2 = $input(What would you like the second hint to be?,qe,Hint 2) if (%hint2 != $null) { var %ans = $input(What would you like the answer to be?,qe,Answer) if (%ans != $null) { did -r trivia 23,30,31,32,41 var %y = 1 var %z = $hget(questions,1).item while $hget(questions,%y).item { if ($v1 > %z) var %z = $v1 inc %y } hadd -m questions $calc(%z + 1) $+(%ques,$chr(1),%hint1,$chr(1),%hint2,$chr(1),%ans) did -e trivia 26 var %b = 1 while $hget(questions,%b).item { did -a trivia 23 $gettok($hget(questions,$v1),1,1) inc %b } did -z trivia 23 did -b trivia 27,37,38,39,42 } } } } } if ($did == 26) { var %x = $input(Are you sure you want to erase all questions?,cy,Remove All Questions) if (%x == $true) { did -r trivia 23,30,31,32,41 hfree questions did -b trivia 26,27,37,38,39,42 } } if ($did == 23 && $diD(trivia,23).seltext != $null) { did -e trivia 27,37,38,39,42 var %x = $hget(questions,$hfind(questions,$did(trivia,23).seltext $+ *,1,w).data) did -ra trivia 31 $gettok(%x,2,1) did -ra trivia 30 $gettok(%x,3,1) did -ra trivia 32 $gettok(%x,4,1) did -ra trivia 41 $gettok(%x,1,1) } if ($did == 27) { var %x = $input(Are you sure you want to delete this question?,cy,Delete Question) if (%x == $true) { hdel questions %a $hfind(questions,$did(trivia,23).seltext $+ *,1,w).data did -r trivia 23,30,31,32,41 var %y = 1 while $hget(questions,%y).item { did -a trivia 23 $gettok($hget(questions,$v1),1,1) inc %y } did -b trivia 27,37,38,39,42 did -z trivia 23 } } if ($did == 38) { var %x = $input(What would you like hint 1 to be?,qe,Hint 1,$did(trivia,31).text) if (%x != $null) { var %y = $hfind(questions,$did(trivia,23).seltext $+ *,1,w).data var %a = $hget(questions,%y) var %z = $replace(%a,$gettok(%a,2,1),%x) hadd -m questions %y %z did -ra trivia 31 %x } } if ($did == 37) { var %as = $input(What would you like Hint 2 to be?,qe,Hint 2,$did(trivia,30).text) if (%as != $null) { var %y = $hfind(questions,$did(trivia,23).seltext $+ *,1,w).data var %a = $hget(questions,%y) var %z = $replace(%a,$gettok(%a,3,1),%as) hadd -m questions %y %z did -ra trivia 30 %as } } if ($did == 39) { var %sa = $input(What would you like the answer to be?,qe,Answer,$did(trivia,32).text) if (%sa != $null) { var %y = $hfind(questions,$did(trivia,23).seltext $+ *,1,w).data var %a = $hget(questions,%y) var %z = $replace(%a,$gettok(%a,4,1),%sa) hadd -m questions %y %z did -ra trivia 32 %sa } } if ($did == 42) { var %sas = $input(What would you like to rename the question as?,qe,Question,$did(trivia,41).text) if (%sas != $null) { var %y = $hfind(questions,$did(trivia,23).seltext $+ *,1,w).data var %a = $hget(questions,%y) var %z = $replace(%a,$gettok(%a,1,1),%sas) hadd -m questions %y %z did -ra trivia 41 %sas did -r trivia 23 var %lmn = 1 while $hget(questions,%lmn).item { did -a trivia 23 $gettok($hget(questions,$v1),1,1) inc %lmn } did -c trivia 23 $didwm(trivia,23,%sas $+ *) did -z trivia 23 } } if ($did == 45) { var %x = $input(Who would you like to set as the owner?,qe,Owner,$hget(trivia,owner)) if (%x != $null) { hadd -m trivia owner %x did -ra trivia 44 %x } } if ($did == 48) { var %x = $input(What would you like to set as the trivia channel?,qe,Trivia Channel,$hget(trivia,chan)) if (%x != $null) { if ($left(%x,1) == $chr(35)) { hadd -m trivia chan %x did -ra trivia 47 %x } else var %y = $input(The channel must begin with $chr(35),ho,Error!) } } if ($did == 51 && $did(trivia,51).seltext != $null) { did -ra trivia 50 $gettok($hget(reports,$hfind(reports,$did(trivia,51).seltext $+ *,1,w).data),2,1) did -e trivia 68,22 } if ($did == 22) { did -c trivia 3 did -c trivia 23 $didwm(trivia,23,$did(trivia,51).seltext $+ *) var %x = $hget(questions,$hfind(questions,$did(trivia,23).seltext $+ *,1,w).data) did -ra trivia 31 $gettok(%x,2,1) did -ra trivia 30 $gettok(%x,3,1) did -ra trivia 32 $gettok(%x,4,1) did -ra trivia 41 $gettok(%x,1,1) did -e trivia 27,37,38,39,42 } if ($did == 67) { var %x = $input(Are you sure you would like to delete all reports?,cy,Erase All Reports) if (%x == $true) { did -r trivia 51,50 hfree reports } } if ($did == 68) { var %x = $input(Are you sure you would like to remove this report?,cy,Remove Report) if (%x == $true) { did -b trivia 22,67,68 hdel reports $hfind(reports,$did(trivia,51).seltext $+ *,1,w).data var %x = 1 did -r trivia 51,50 while $hget(reports,%x).item { did -a trivia 51 $gettok($hget(reports,$v1),1,1) inc %x } did -z trivia 51 if ($hget(reports,1).data) did -e trivia 67 } } if ($did isnum 55-58) { hadd -m trivia wrong $gettok($did(trivia,$did),1,32) if ($hget(trivia,strivia) == ison) did -c trivia 8 if ($hget(trivia,strivia) == isvoice) did -c trivia 7 if ($hgeT(trivia,strivia) == isop) did -c trivia 6 } if ($did == 59) { hadd -m trivia wrong none if ($hget(trivia,strivia) == ison) did -c trivia 8 if ($hget(trivia,strivia) == isvoice) did -c trivia 7 if ($hgeT(trivia,strivia) == isop) did -c trivia 6 } if ($did == 61) { write missed.txt $did(trivia,60).text did -r trivia 60 did -b trivia 61 var %x = $input(Missed Question Response Added!,io,Response Added) } } if ($devent == edit && $did == 60) { if ($did(trivia,60).text != $null) did -e trivia 61 else did -b trivia 61 } }