!merc <info>
anything that is in the info part, i need saved and added to a database.
every minuite i need the database to be displayed to the channel.
after 5 mins i want the fist line to be removed and the second line to become the first line and so on...
this is what i have so far, but its not working...
Code: Select all
bind pub -|- !merc merc:merc
set channel "#stoobar"
set time 15
set merclist ""
set merctext "$merclist"
set used 1
if {[string compare [string index $time 0] "!"] == 0} { set timer [string range $time 1 end] } { set timer [expr $time * 1] }
if {[lsearch -glob [utimers] "* go *"] == -1} { utimer $timer go }
proc merc:merc {nick host handle chan text} {
global used merclist merctext
incr used
set list [split $text]
set info1 [lindex $list 0]
set info2 [lindex $list 1]
set info3 [lindex $list 2]
set info3 [lindex $list 3]
set info4 [lindex $list 4]
set info5 [lindex $list 5]
set info6 [lindex $list 6]
set info7 [lindex $list 7]
set info8 [lindex $list 8]
set info9 [lindex $list 9]
set info10 [lindex $list 10]
set mercinfo($used) "$info1 $info2 $info3 $info4 $info5 $info6 $info7 $info8 $info9 $info10"
set mercinfo($nick) $used
append $merclist mercinfo($used)
putquick "NOTICE $nick : You have been added $used"
putquick "NOTICE $nick : $mercinfo($used)"
return 1}
proc go {} {
global channel time merctext timer merclist
foreach chan $channel {
foreach line $merclist { putserv "PRIVMSG $chan :$line" }
}
if {[lsearch -glob [utimers] "* go *"] == -1} { utimer $timer go }
}