Years ago I had a "desire": make a script that pastes lines from various text files, like a media player does when we leave it in shuffle mode.
So there is a directory with some text files.
From the irc channel, we type for example !play.
The script gets a list of the files in the text files directory.
Then it picks a random file.
Then pastes a line every 5 seconds and then when it reaches to the end, it opens a new file and continues playing that file, each line again 5 seconds.
Changing topic is trivial with a putserv topic channel and the name of the file, for example.
There has to be a !stop command to stop the text playback.
Maybe also a !shuffle to stop the current playback and get another file for reading.
An eggdrop bot was made solely for this task and a single channel.
Code: Select all
set textlines {
"line1"
"line2"
"line3"
"line4"
"line5"
"line6"
"line7"
"line8"
"line9"
"line10"
}
proc playcmd {nick uhost handle chan text} {
}
proc stopcmd {nick uhost handle chan text} {
}
bind pub - "!play" playcmd
bind pub - "!stop" sttopcmd
proc textengine {} {
utimer 5 [list s2c #mychannel] [llength $textlines]
putlog "ended here"
}
if {![info exists positionplay]} {set positionplay}
proc s2c {chan} {
putquick "PRIVMSG $chan :[lindex [split $::textlines "\n"] $::positionplay]"
putlog "$::positionplay"
incr ::positionplay
if {$::posicaoplay>[llength $::linhasdetexto]} {set ::posicaoplay 0}
}
Can someone help or at least point me to an existing script that does what it is asked above and then I can modify it? THank you.