Auth command // Remote access to bot

By AlienDK on Dec 18, 2008

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.
  }
}

Comments

Sign in to comment.
Blubble   -  Mar 05, 2010

You can see the commands in the script.

 Respond  
Phoenix345   -  Jan 12, 2010

Please help me don't know what to do, I successfully auth'd to my bot and it confirmed it, but I don't know what do next? can someone please tell me some commands?

 Respond  
AlienDK   -  Feb 11, 2009

@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.

 Respond  
PuNkTuReD   -  Feb 10, 2009

in this case i dont think u need the elseif in your first event.it can just b else.

 Respond  
Kirby   -  Feb 10, 2009

chris?

Also,

    ban $chan $2 1
    kick # $2 $read(kickreason.txt)

You can use the -k switch in /ban, so you can use:

/ban -k $2 1 $read(kickreason.txt)

Keep in mind not everyone has kickreason.txt

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.