I was given this code ages ago to use ...
menu channel {
-
.Fact ( $+ %fact $+ )
..On:{ .enable #fact | set %fact On | echo $active 8,4-=[ fact On ]=- }
..Off:{ .disable #fact | set %fact Off | echo $active 8,4-=[ fact Off ]=- }
}
#Fact on
on *:TEXT:*!fact*:*: {
if (%fact == off) halt
set %posi $findtok($1-,$matchtok($1-,!fact,1,32),1,32)
var %svalue = $ [ $+ [ %posi ] ]
if (%svalue == !fact) { msg # Heres A Fact For You $nick - $read(Facts/fact.txt) }
elseif (!fact isin %svalue) && (%svalue != !fact) && ($right(%svalue,-5) isnum) {
msg # Heres A Fact For You $nick - $read(Facts/fact.txt,$right(%svalue,-5)) }
set -u10 %fact off
}
Now when I type !fact it will read the txt.doc at random from the txt.doc and if I type !fact1 it will read the 1st line in the txt.doc
QUESTION: all iv done is to do copy the code and just alter the fact to romani
menu channel {
-
.Romani ( $+ %romani $+ )
..On:{ .enable #romani | set %romani On | echo $active 8,4-=[ romani On ]=- }
..Off:{ .disable #romani | set %romani Off | echo $active 8,4-=[ romani Off ]=- }
}
#Romani on
on *:TEXT:*!romani*:*: {
if (%romani == off) halt
set %posi $findtok($1-,$matchtok($1-,!romani,1,32),1,32)
var %svalue = $ [ $+ [ %posi ] ]
if (%svalue == !romani) { msg # Heres A Romani word For You $nick - $read(Gypsy/romani.txt) }
elseif (!romani isin %svalue) && (%svalue != !romani) && ($right(%svalue,-5) isnum) {
msg # Heres A Romani Word For You $nick - $read(Gypsy/romani.txt,$right(%svalue,-5)) }
set -u10 %romani off
}
BUT: if I type !romani it will read the txt.doc at random ... but if I type !romani1 it will not read the 1st line of the txt.doc ![]()