on *:text:!fact:#usa:{
[color:green]; Check if %facts variable exists; return if it does[/color]
if %fact { return }
[color:green]; Check if table exists and has data in it[/color]
[color:green]; If not create/populate the table[/color]
if !$hget(facts,0).item {
[color:green]; Filter any possible blank lines out of file[/color]
[color:green]; (You can remove this if it is unneeded)[/color]
filter -cff facts.txt facts.txt *?*
[color:green]; If no facts are available, return[/color]
[color:blue]; If you remove the "/filter ..." line from above, remove this next one also.[/color]
if !$filtered { return }
[color:green]; Make the table if needs be[/color]
if !$hget(facts) { .hmake facts 50 }
[color:green]; Load the data into table[/color]
hload -n facts facts.txt
}
[color:green]; grab a fact; msg it to channel[/color]
var %a = $hfind(facts,*,1,w)
msg #usa $hget(facts,%a)
[color:green]; Delete this item from table[/color]
hdel facts %a
[color:green]; Create %facts for 30 seconds (flood prevention).[/color]
inc -u30 %fact
}