Astept idei ce sa mai modific la urmatorul script de teste pentru helperi ......
Acest script cand pune intrebareaza seteaza modulul +m la canal ... iar cand cel care trebuie sa raspunda scoate modulul +m !
Code:
#############
#BluMan TCL #
#Helper test#
#############
set ask(chan) "#testboot"
set ask(qmax) "10"
set ask(welcome) "Bine ai venit .... testul incepe intr-un minut!"
set ask(reguli) "Ai la dispozitie 60 sec pentru a raspunde la intrebare si 60 secunde pentru a te gandi!"
set ask(question1) "Intrebarea 1"
set ask(question2) "Intrebarea 2"
set ask(question3) "intrebarea 3"
set ask(question4) "intrebarea 4"
set ask(question5) "intrebarea 5"
set ask(question6) "intrebarea 6"
set ask(question7) "intrebarea 7"
set ask(question8) "intrebarea 8"
set ask(question9) "intrebarea 9"
set ask(question10) "intrebarea 10"
## adaugi intrebari dupa modelul de mai sus
## dar modifici si $ask(qmax)
bind pubm m|m "$ask(chan) !start" pub:start
bind pubm m|m "$ask(chan) !stop" pub:stop
bind time - "01 * * * *" timed:ask
bind time - "03 * * * *" timed:ask
bind time - "05 * * * *" timed:ask
bind time - "07 * * * *" timed:ask
bind time - "09 * * * *" timed:ask
bind time - "11 * * * *" timed:ask
bind time - "13 * * * *" timed:ask
bind time - "15 * * * *" timed:ask
bind time - "17 * * * *" timed:ask
bind time - "19 * * * *" timed:ask
bind time - "21 * * * *" timed:ask
bind time - "23 * * * *" timed:ask
bind time - "25 * * * *" timed:ask
bind time - "27 * * * *" timed:ask
bind time - "29 * * * *" timed:ask
bind time - "31 * * * *" timed:ask
bind time - "33 * * * *" timed:ask
bind time - "35 * * * *" timed:ask
bind time - "37 * * * *" timed:ask
bind time - "39 * * * *" timed:ask
bind time - "41 * * * *" timed:ask
bind time - "43 * * * *" timed:ask
bind time - "45 * * * *" timed:ask
bind time - "47 * * * *" timed:ask
bind time - "49 * * * *" timed:ask
bind time - "51 * * * *" timed:ask
bind time - "53 * * * *" timed:ask
bind time - "55 * * * *" timed:ask
bind time - "57 * * * *" timed:ask
bind time - "59 * * * *" timed:ask
bind time - "01 * * * *" timed:modem
bind time - "02 * * * *" timed:modemm
bind time - "03 * * * *" timed:modem
bind time - "04 * * * *" timed:modemm
bind time - "05 * * * *" timed:modem
bind time - "06 * * * *" timed:modemm
bind time - "07 * * * *" timed:modem
bind time - "08 * * * *" timed:modemm
bind time - "09 * * * *" timed:modem
bind time - "10 * * * *" timed:modemm
bind time - "11 * * * *" timed:modem
bind time - "12 * * * *" timed:modemm
bind time - "13 * * * *" timed:modem
bind time - "14 * * * *" timed:modemm
bind time - "15 * * * *" timed:modem
bind time - "16 * * * *" timed:modemm
bind time - "17 * * * *" timed:modem
bind time - "18 * * * *" timed:modemm
bind time - "19 * * * *" timed:modem
bind time - "20 * * * *" timed:modemm
bind time - "21 * * * *" timed:modem
bind time - "22 * * * *" timed:modemm
bind time - "23 * * * *" timed:modem
bind time - "24 * * * *" timed:modemm
bind time - "25 * * * *" timed:modem
bind time - "26 * * * *" timed:modemm
bind time - "27 * * * *" timed:modem
bind time - "28 * * * *" timed:modemm
bind time - "29 * * * *" timed:modem
bind time - "30 * * * *" timed:modemm
bind time - "31 * * * *" timed:modem
bind time - "32 * * * *" timed:modemm
bind time - "33 * * * *" timed:modem
bind time - "34 * * * *" timed:modemm
bind time - "35 * * * *" timed:modem
bind time - "36 * * * *" timed:modemm
bind time - "37 * * * *" timed:modem
bind time - "38 * * * *" timed:modemm
bind time - "39 * * * *" timed:modem
bind time - "40 * * * *" timed:modemm
bind time - "41 * * * *" timed:modem
bind time - "42 * * * *" timed:modemm
bind time - "43 * * * *" timed:modem
bind time - "44 * * * *" timed:modemm
bind time - "45 * * * *" timed:modem
bind time - "46 * * * *" timed:modemm
bind time - "47 * * * *" timed:modem
bind time - "48 * * * *" timed:modemm
bind time - "49 * * * *" timed:modem
bind time - "50 * * * *" timed:modemm
bind time - "51 * * * *" timed:modem
bind time - "52 * * * *" timed:modemm
bind time - "53 * * * *" timed:modem
bind time - "54 * * * *" timed:modemm
bind time - "55 * * * *" timed:modem
bind time - "56 * * * *" timed:modemm
bind time - "57 * * * *" timed:modem
bind time - "58 * * * *" timed:modemm
bind time - "59 * * * *" timed:modem
bind time - "60 * * * *" timed:modemm
proc pub:start {nick uhost hand chan arg} {
global ask
if {$ask(start)} {
puthelp "PRIVMSG $chan :questions already started"
} else {
set ask(start) 1
set ask(q) 1
puthelp "PRIVMSG $chan :$ask(welcome)"
puthelp "PRIVMSG $chan :$ask(reguli)"
}
}
proc pub:stop {nick uhost hand chan arg} {
global ask
if {!$ask(start)} {
puthelp "PRIVMSG $chan :questions not running"
} else {
set ask(start) 0
puthelp "PRIVMSG $chan :stopping questions"
}
}
proc timed:ask {min hour day month year} {
global ask
if {![info exists ask(start)]} { set ask(start) 0 }
if {$ask(start)} {
if {$ask(q) < [expr $ask(qmax)+1]} {
puthelp "PRIVMSG $ask(chan) :$ask(question$ask(q))"
incr ask(q)
} else {
set ask(start) 0
}
}
}
proc timed:modem {min hour day month year} {
global ask
if {$ask(start) == 1} {putquick "MODE $ask(chan) +m"} else {
puthelp ""}
}
proc timed:modemm {min hour day month year} {
global ask
if {$ask(start) == 1} {putquick "MODE $ask(chan) -m"} else {
puthelp ""}
}
return "helper tcl"