Adminscanner

Release your script here.
State:
- Author
- What it does
- Perhaps a little guide.
- Also, if the snippet is of any use to the community, it has a chance of getting posted on the main page, so don't hesitate to submit/ask!

Adminscanner

Postby zNigel- » Wed Jul 01, 2009 12:16 am

THIS SCRIPT REQUIRES PUTMSG ---> viewtopic.php?f=12&t=267

Hey there..

Since capurro really wanted an adminscan script I've made this one..

This script scans on join if the user exists in userlist.ini .
If so, the bot will send a message to the channel to notice ppl that the botadmin has entered.

Special thanks to AndRew for the help with List and Del vars :)

Commands:
!as on - Enables the adminscanner.
!as off - Disables the adminscanner.
!as status - Shows you the current status of adminscan.
!as add <nick> - Adds another admin to the bot.
!as del <nick|hostname> - Delete an user by nick or the added host.
!as help - Shows you the helplist.
!as list - Shows the added admin hosts.

__________________________________

To be able to use the script you'll have to make a file named Userlist.ini and type the following

[Admins]
*!*@yourhost.com=ADMIN


Here goes the script.

Code: Select all
on *:text:!as*:#: {
  if ($readini(userlist.ini,Admins,$address($nick,2)) == ADMIN) {
    if (!$2) { putnotice $nick Syntax: $1 on/off/status/add/del/help/list }
    elseif ($2 == on) {
      if (%adminscan == on) { putnotice $nick Adminscan is already enabled.
      }
      else { set %adminscan on | putnotice $nick Adminscan is now enabled.
      }
    }
    elseif ($2 == off) {
      if (%adminscan == off) { putnotice $nick Adminscan is already disabled.
      }
      else { set %adminscan off | putnotice $nick Adminscan is now disabled. }
    }
    elseif ($2 == status) {
      if (%adminscan == on) { putnotice $nick Adminscan is currently: Enabled }
      else { putnotice $nick Adminscan is currently: Disabled }
    }
    elseif ($2 == add) {
      if (!$3) { putnotice $nick Syntax: $1 $2 <nick> }
      if  ($readini(userlist.ini,Admins,$address($3,2)) == ADMIN) { putnotice $nick $3 is already an admin. }
      else { writeini userlist.ini Admins $address($3,2) ADMIN | putnotice $nick Done. Added $3 to Adminscan list. }
    }
    elseif ($2 == del) {
      if (!$3) { putnotice $nick Syntax: $1 $2 <nick|hostname> }
      var %adminhost = $address($3,2)
      if (*!*@* iswm $3) && ($left($3,4) == *!*@) { var %adminhost = $3 }
      if  (!$readini(userlist.ini,Admins,%adminhost)) { putnotice $nick %adminhost is not in admin list. }
      else {   
      remini userlist.ini Admins %adminhost | putnotice $nick Done. Removed %adminhost from Adminscan list. }
    }
    elseif ($2 == help) {
      putnotice $nick Enables the adminscanner. | putnotice $nick Syntax: $1 on
      putnotice $nick Disables the adminscanner. | putnotice $nick Syntax: $1 off
      putnotice $nick Shows you the current status of the adminscan. | putnotice $nick Syntax: $1 status
      putnotice $nick Adds another admin to the bot. | putnotice $nick Syntax: $1 add <nick>
      putnotice $nick Deletes an admin from the bot. | putnotice $nick Syntax: $1 del <nick|hostname>
      putnotice $nick Shows you this help-message. | putnotice $nick Syntax: $1 help
      putnotice $nick Shows you a list of all adminhosts added. | putnotice $nick Syntax: $1 list
    }
    elseif ($2 == list) {
      putnotice $nick Adminscan admins - Entries: $iif($ini(userlist.ini,Admins,0),$v1,0)
      var %i = 1
      while (%i <= $ini(userlist.ini,Admins,0)) {
        var %x = $ini(userlist.ini,Admins,%i)
        var %lvl = $readini(userlist.ini,Admins,%i)
        var %list = $addtok( $+ %x  $+ $chr(44),%list,32)
        inc %i
        putnotice $nick %x
      }
      else { halt
      }
    }
  }
}

on *:join:#: {
  if (%adminscan == on) {
    if ($readini(userlist.ini,Admins,$address($nick,2)) == ADMIN) {
      putmsg $chan 9,1»14]14,1[9«0 Global owner ' $+  $nick $+ ' has joined the channel 9»14]14,1[9« 
      mode $chan +ov $nick $nick
    } 
  }
}

zNigel-
 

Re: Adminscanner

Postby Cristian » Sun Jul 05, 2009 7:42 pm

nice script, now no admin can hide :P
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Re: Adminscanner

Postby zNigel- » Sun Jul 05, 2009 7:42 pm

Sumsar wrote:nice script, now no admin can hide :P



Hehe thnx ;p :twisted:
zNigel-
 

Re: Adminscanner

Postby StareX » Fri Aug 07, 2009 8:00 pm

Nice script m8! :)
StareX
 


Return to Mirc Scripting Release

Who is online

Users browsing this forum: No registered users and 1 guest

cron