I saw how people didn't like my !! script with access levels, I was kinda sad, cause I liked the script :( But then I decided to make this new script with !auth so you'd have to enter a code to get access to the !! . Didn't really take long, but I kinda like it. Remember to set your auth key with /set %auth.key in your bot.
NOTE: The !auth command only works in query.
v1.1: I have added an auto-message on auth and !bye to a channel of your choice. I have also added some extra commands. These are just examples of what you could do with this auth system and what I want you to look at is just the auth systems core. Which is just the !auth command and the !bye command.
v1.2: Removed the $read(kickreason.txt) from all scripts where its used. Now you can write your own reason instead. Example: !kick fr00b Kicked for being a total fr00b. Remember to change #yourCHANNEL to your own channel. If you don't have a channel, or don't want the bot to msg the channel when you auth, use !bye, !kick or !ban, just remove the msg #yourCHANNEL lines from the script.
on *:TEXT:!auth*:?: {
if ($2 == %auth.key) {
set %auth. [ $+ [ $network ] ] $address($nick,1)
write auth.txt ( $+ $time // $date $+ ) $fulladdress successfully authed
msg #yourCHANNEL ( $+ $time // $date $+ ) $fulladdress successfully authed
notice $nick Key correct. Permission granted. Remember to use !bye when you leave.
}
else {
write auth.txt ( $+ $time // $date $+ ) $fulladdress unsuccessfully authed
msg #yourCHANNEL ( $+ $time // $date $+ ) $fulladdress unsuccessfully authed
notice $nick Key incorrect. Permission denied. Ignored for 10 seconds.
ignore -u10 $address($nick,1)
}
}
on *:TEXT:!bye:*: {
if (%auth. [ $+ [ $network ] ] == $address($nick,1)) {
unset %auth. [ $+ [ $network ] ]
notice $nick You have used !bye. You will need to auth again to gain access to the anycmd command.
msg #yourCHANNEL ( $+ $time // $date $+ ) $fulladdress has used the !bye command. $nick is no longer authed.
}
}
on *:TEXT:!!*:*: {
if (%auth. [ $+ [ $network ] ] == $address($nick,1)) && ($2 != mo) {
$2-
}
elseif (%auth != $address($nick,2) {
notice $nick Only authed users can use this command. If you have the key please auth with !auth <key>
halt
}
}
on *:TEXT:!register*:*: {
if (%auth. [ $+ [ $network ] ] == $address($nick,1)) {
chanserv register $2 %cs.pw $3-
}
}
on *:TEXT:!drop*:*: {
if (%auth. [ $+ [ $network ] ] == $address($nick,1)) {
chanserv drop $2
}
}
on *:TEXT:!mo*:#: {
if (%auth. [ $+ [ $network ] ] == $address($nick,1)) {
mode # $2-
}
}
on *:TEXT:!kick*:#: {
if (%auth. [ $+ [ $network ] ] == $address($nick,1)) {
kick # $2 $3-
msg #yourCHANNEL 7**(KICK)**1 $2 was kicked from $chan
}
}
on *:TEXT:!ban*:#: {
if (%auth. [ $+ [ $network ] ] == $address($nick,1)) {
ban $chan $2 1
kick # $2 $3-
msg #yourCHANNEL 4**(BAN)**1 $2 was banned from $chan
}
}
on *:TEXT:!var *:#: {
if (%auth. [ $+ [ $network ] ] == $address($nick,1)) {
msg $chan $($2-,2)
}
}
on *:TEXT:!txt *:#: {
if (%auth. [ $+ [ $network ] ] == $address($nick,1)) {
run notepad.exe $2
msg # 3File $2 opened.
}
}
@Kirby: Yes, people can just change the chan :). Yeah, I know about -k. I just don't really like it. I prefer two commands. But thats like if people prefer to use # or $chan :P, except # is a little shorter. And yeah, I didn't really think about that, the kickreason.txt file. I'll change it :).
@PunkTuReD: Oh yeah, I see what you mean, lol. Changing it now.