Top

Auth command // Remote access to bot


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  Dec 18, 2008
Last Updated  Feb 11, 2009
Tags  access  auth  bot  remote 

Introduction

I saw how people didn't like my !! <command> 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 !! <command>. Didn't really take long, but I kinda like it. Remember to set your auth key with /set %auth.key <your 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.

Grab the Code

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

  (3)  RSS
Kirby
Comments: 475
 
mIRC Snippet:  Auth command // Remote access to bot
Posted on Feb 10, 2009 3:05 pm
#chris?

Also,
Code:
    ban $chan $2 1
    kick # $2 $read(kickreason.txt)


You can use the -k switch in /ban, so you can use:
Code:
/ban -k $2 1 $read(kickreason.txt)

Keep in mind not everyone has kickreason.txt
PunkTuReD
Comments: 461
 
mIRC Snippet:  Auth command // Remote access to bot
Posted on Feb 10, 2009 6:21 pm
in this case i dont think u need the elseif in your first event.it can just b else.
AlienDK
Comments: 34
 
mIRC Snippet:  Auth command // Remote access to bot
Posted on Feb 11, 2009 7:39 am
@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.

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom