Name: info URL: www.url.com
[quote]
What i need is someone to type say !sites and the script goes off and picks randomy a line from the txt file and pastes it to the channel.
No security needed and I am adding the sites already by trigger.
Any help would be great.
Thanks[/quote]
bind pub - !foo bar
proc bar {nick uhost hand chan rest} {
set file [open "txt_file_path" r]
set data [split [read $file] "\n"]
set line [lindex $data [rand [llength $data]]]
putserv "privmsg $chan : $line"
close $file
}
EDIT: Code fixed, thx Sir_Fz
Last edited by SaPrOuZy on Thu Jun 22, 2006 1:50 am, edited 1 time in total.