I am having trouble with what I think should be a simple script...I have a text file which contains one quote per line. I want to randomly read a quote once per hour in the channel I am an op for. Here is what I have;
on *:JOIN:#:{
/timergreet 0 3600 /msg $chan - Quote of the Day: $read(biqquotes.txt)
}
Where the problem is, it randomly selects one quote initially, but then will repeat the same quote it originally selected. How can I get it to randomly select a quote the 2nd and 3rd, etc time after the first selection?
3600 is 3600 seconds, which translates to 60 minutes, translating to 1 hour. Do you just want a different message each join? Or different message each day?
.timerquote 86400 .set %dailyQuote $rand(0,$!lines(bigquotes.txt)) - this will read how many lines are in, and choose a random one from the 0th (first) line, and the last line in bigquotes.
Then you can do
msg # $read(bigquotes.txt, %dailyQuote)
I would have these sperate, as setting the greet, is requested upon someone joining.
Alias DailyQuote {
set %dailyQuote $rand(0,$!lines(bigquotes.txt))
.timerquote 86400 set %dailyQuote $rand(0,$!lines(bigquotes.txt))
}
-this will set it upon use then every day (if you keep the bot running 24/7 will reset the daily quote.
ON !*:JOIN:*:{
if (!%qotdFlood) {
msg # Quote of the Day - $read(bigquotes.txt, %dailyQuote) | .inc %qotdFlood -z 60
}
}
The .inc is for a flood protections so if 20 people join at once, it doesn't spam it. It can only be said, omn a join once a minute.
and so you know, inside the actual code. You don't need all the / and . Although infront of the timer to my knowledge makes the event 'silent' or that it won't post it. # is the same as $chan.
If you use this. and you put the Alias in your 'alias' file, MAke sure you don't have Alias, So I would put it in the remote with the Alias. Then on
Do you want it to read a random quote everytime someone joins?
Quote of the day should change daily right?