This code performs several functions: 1) Keeps tracks of channel keys. When the key of a channel that you are on changes, the script records that and saves the information in a file. This also saves the key of any channels that you join. Whenever you want to rejoin that channel, but you get an error saying you need a key, the script automatically joins the channel with the previously saved key. 2)..
For some reason $nick(,).idle is inaccurate when the idle time of a user is in hours.
Example 1:
I whois'd myself and got an idle time of "7 seconds".
I then used $nick and it also echoed "7".
However when I did it to a person who was inactive for 9+ hours, it echoed "1096". If you do the math there are 32,400 seconds in 9 hours, which means something is wrong.
You could shorten the code to this:
on *:TEXT:!emmm*:#:{
var %emmm = $rand(1,$2)
if (%emmm != $null) && (%emmm <= 10) msg $chan emmm answer: $calc(%emmm + 2)
}
As I saw in your script, the answer is always "two plus %emmm". This is basically what my revision does. I also saw that %emmm only went up to ten. This revision also makes sure that %emmm only goes up to ten.
Wouldn't it be better if you made aliases instead of on TEXT? That way nobody can see what you typed and you wouldn't need a bot for this.
Example:
alias unban { mode $1 -b $2 | msg %Admin $2 Has Been Unbanned From $1 $+ . }
If you do convert these to aliases, remember this:
In /unban , would be $1 and not $2.