Clan Channel Management Bot

By Murderer on Sep 12, 2004

This is a simple project of mine that is a simple bot with lots of clan specific features. I made it for my clan #dacstrike on QuakeNet. INSTALLATION: SAVE THE SOURCE AS A .MRC FILE AND PUT IT IN AN MIRC DIRECTORY. CREATE A FOLDER CALLED 'INI' IN THE DIRECTORY AND THEN CREATE A .INI FILE CALLED USERS IN THIS FOLDER. OPEN UP MIRC AND TYPE /load -rs filename.mrc INTO A WINDOW.


The script requires lots of customising to get right, but I will be glad to help. Just post in the forums @ http://www.dacstrike.com

on *:JOIN:#: { if ($chan == #dAcstrike ) { 
//notice $nick 7,14Welcome to #dAcstrike. I'm the channels bot. type in !help to get a list of commands. Alternatively, you can pm me the word "help"!

//mode $chan +v $nick } 
 }

on *:TEXT:!ip:#: { //notice $nick 7,14::: dAc Clan Server #dacstrike :1 zapp.4k-gaming.net:27016 7::: }

on *:TEXT:!members:#: { //notice $nick 7,14:::1 Likky[CL], Negotiator[CL], Justice, MooN, Clanzman, uRbaN, SearrarD, Salix, Murderer, Slay, Phox, InStInCt 7::: }

on *:TEXT:!ukcslrank:#: { //notice $nick 7,14 dAc Are Currently Ranked: %ukcslrank  in Division: %ukcsldiv  }

on *:TEXT:!setukcslrank *:#: { if ($nick isop $chan) { //unset %ukcslrank | //set %ukcslrank $2 | //notice $nick 7,14 Current UKCSL Rank Changed To: %ukcslrank }
 }

on *:TEXT:!setukcsldiv *:#: { if ($nick isop $chan) { //unset %ukcsldiv | //set %ukcsldiv $2 | //notice $nick 7,14 Current UKCSL Division Changed To: %ukcsldiv }
 }

on *:TEXT:!lastresult:#: { //notice $nick 7,14 dAc's Last Result:  %lastresult }

on *:TEXT:!result *:#: { if ($nick isop $chan) { //unset %lastresult | //set %lastresult $2- | //notice $nick 7,14 Last Result Changed To: $2- } else { //notice $nick 1,4 SORRY YOU DO NOT HAVE ACCESS TO THIS COMMAND! }
 }

on *:TEXT:!setnextmatch * * * *:#: { if ($nick isop $chan) { //unset %nextmatchdate | //unset %nextmatchenemy | //unset %nextmatchleague | //unset %nextmatchtime | //set %nextmatchdate $2 | //set %nextmatchtime $3 | //set %nextmatchenemy $4 | //set %nextmatchleague $5 | //set %nextmatchwa $nick | //notice $nick 7,14 Next Match Info Set To: [Date: %nextmatchdate ] - [Time: %nextmatchtime ] - [Opponent: %nextmatchenemy ] - [Match Type: %nextmatchleague ] - [Organiser: %nextmatchwa ] } 
 }

on *:TEXT:!nextmatch:#: { if ($nick isop $chan) { //notice $nick 7,14Our Next Match Is: [Date: %nextmatchdate ] - [Time: %nextmatchtime ] - [Opponent: %nextmatchenemy ] - [Match Type: %nextmatchleague ] - [Organiser: %nextmatchwa ] }
ELSE { //notice $nick 1,4 SORRY YOU DO NOT HAVE ACCESS TO THIS COMMAND! }
 }

on *:TEXT:!edrank:#: { //notice $nick 7,14 dAc^ Are Currently Ranked:  %edrank  in ED Division:  %eddiv }

on *:TEXT:!setedrank *:#: { if ($nick isop $chan) { //unset %edrank | //set %edrank $2- | //notice $nick 7,14 ED Rank Changed To: %edrank } 
ELSE { //notice $nick 1,4 SORRY YOU DO NOT HAVE ACCESS TO THIS COMMAND! } }

on *:TEXT:!seteddiv *:#: { if ($nick isop $chan) { //unset %eddiv | //set %eddiv $2- | //notice $nick 7,14 ED Division Changed To: %eddiv } 
ELSE { //notice $nick 1,4 SORRY YOU DO NOT HAVE ACCESS TO THIS COMMAND! } }

on *:TEXT:!site:#: { //notice $nick 7,14::: http://www.dAcstrike.com 7::: }

on *:TEXT:!topic *:#: { if ($nick isop $chan) { //topic $chan 7,14 $2- }
 else { //notice $nick 1,4 SORRY YOU DO NOT HAVE ACCESS TO THIS COMMAND! }
}

on *:TEXT:!op *:#: { if ($nick isop $chan) { //mode $chan +o $2 } 
ELSE { //notice $nick 1,4 SORRY YOU DO NOT HAVE ACCESS TO THIS COMMAND! 
}      
  }

on *:TEXT:!deop *:#: { if ($nick isop $chan) { //mode $chan -o $2 } 
ELSE { //notice $nick 1,4 SORRY YOU DO NOT HAVE ACCESS TO THIS COMMAND! 
}      
  }

on *:TEXT:!voice *:#: { if ($nick isop $chan) { //mode $chan +v $2 } 
ELSE { //notice $nick 1,4 SORRY YOU DO NOT HAVE ACCESS TO THIS COMMAND! 
}      
  }
on *:TEXT:!devoice *:#: { if ($nick isop $chan) { //mode $chan -v $2 } 
ELSE { //notice $nick 1,4 SORRY YOU DO NOT HAVE ACCESS TO THIS COMMAND! 
}      
  }

on *:TEXT:!kick *:#: { if ($2 isop $chan) { //notice $nick Sorry You Can not Kick An OP | halt }
elseif ($nick isop $chan) { //kick $chan $2 7,14 $me > ALL }
elseif ($nick !isop $chan) { //notice $nick 1,4 SORRY YOU DO NOT HAVE ACCESS TO THIS COMMAND! }
}

on *:TEXT:!ban *:#: { if ($2 isop $chan) { //notice $nick Sorry You Cannot Ban An OP | halt }
elseif ($nick isop $chan) { //mode $chan +b $2 
//kick $chan $2 7,14 $me > ALL }
elseif ($nick !isop $chan) { //notice $nick 1,4 SORRY YOU DO NOT HAVE ACCESS TO THIS COMMAND! }
}

on *:TEXT:!unban *:#: { if ($nick isop $chan) { //mode $chan -b $2 
//msg $2 7,14 You Have Been Unbanned From $chan By $nick }
elseif ($nick !isop $chan) { //notice $nick 1,4 SORRY YOU DO NOT HAVE ACCESS TO THIS COMMAND! }
}

on *:TEXT:!info:#: { //notice $nick 1,14 I am $me A Channel Management Bot Created For Clans. I am running on Windows $os using mIRC Version: $version . My Current IP address is $ip . Since 4th September 2004, I have been online for: $online . I am owned by dAc^Murderer }

on *:TEXT:!mod:#: { if ($nick isop $chan) { //mode $chan +m }
ELSE { //notice $nick Sorry you do not have access to this command }
}

on *:TEXT:!unmod:#: { if ($nick isop $chan) { //mode $chan -m }
ELSE { //notice $nick Sorry you do not have access to this command }
}

on *:TEXT:!war *:#: { if ($nick isop $chan) { //amsg #dAcstrike are looking for: $2- . msg $nick for details. }
ELSE { //notice $nick Sorry, you do not have access to this command 
}
  }

on *:TEXT:!challenge * *:#: { 
//msg #dAc.ie 10,1  $nick from $2 is looking for a pcw @ $3 . Get in touch!!
//msg #dac.ie 13,12  $nick from $2 is looking for a pcw @ $3 . Get in touch!!
}

on *:TEXT:help:?: {
//msg $nick 7Hello $nick and welcome to the $me help system.
//msg $nick 14----------------------------------------------
//msg $nick 7Help Commands Available Are:
//msg $nick 7!usercommands - commands that anyone can use
//msg $nick 7!opcommands - commands that only opped users can use
//msg $nick 14----------------------------------------------
//msg $nick 7Simply PM me one of the above lines and I will answer you!
//msg $nick 7I WILL ONLY REPLY IF YOU PM ME THE COMMANDS!!

}

on *:TEXT:!help:#: {
//msg $nick 7,14 -[1 !usercommands <7>1 !opcommands 7]-
}

on *:TEXT:!usercommands:*: {
//msg $nick 7,14 7-[1 !ip  <7>1 !members <7>1 !site <7>1 !seen <nick> <7>1 !google TERM <7>1 !lastresult <7>1 !edrank <7>1 !ukcslrank <7>1 !challenge YOURCHANNEL TIME <7>1 !info 7]-
//msg $nick 7,14 7-[1 All Commands To Be Typed In Channel Window 7]-

}

on *:TEXT:!opcommands:*: {
//msg $nick 7,14 7-[1 !voice <nick>  <7>1 !devoice <nick> <7>1 !op  <nick> <7>1 !deop <nick> <7>1 !topic <topic> <7>1 !ban <nick> <7>1 !unban <nick> <7>1 !kick <nick> <7>1 !mod <7>1 !unmod <7>1 !war ?v? // map // skill <7>1 !result dAc (xx) -vs- TEAM (xx) <7>1 !seteddiv <7>1 !setedrank <7>1 !setukcslrank <7>1 !setukcsldiv <7>1 !nextmatch <7>1 !setnextmatch x/x/04 20:00 ClanName MATCHTYPE 7]-
//msg $nick 7,14 7-[1 All Commands To Be Typed In Channel Window 7]-

}

on 1:text:*seen*:#: {
  if ($1 == !seen) {
    if ($2 == $null) { .notice $nick Usage !seen <nick> | halt }
    if ($2 == $me) { .notice $nick Yes I'm here... $+ . | halt }
    if ($2 == $nick) { .notice $nick What a surprise $nick, YOU ARE HERE! | halt }
    if ($2 ison $chan) { .notice $nick $2 is in this chan already. | halt }
    if ($readini ini\users.ini $2 date == $null) { .notice $nick $2 has not been seen by me. | halt }
    else { 
      if ($readini ini\users.ini $2 me == $null) { 
        if ($readini ini\users.ini $2 part == yes) { .msg $nick $2 was last seen parting [ $readini ini\users.ini $2 chan ]  $+ $duration($calc($ctime($fulldate)-$ctime($readini ini\users.ini $2 date))) ago. }
        else { .msg $nick [ $2 ] was last seen quiting  $+ $duration($calc($ctime($fulldate)-$ctime($readini ini\users.ini $2 date))) ago with the message: " $+ [ $readini ini\users.ini $2 message ] $+ ". }
      }
      else { 
        if ($readini ini\users.ini $2 part == yes) { .msg $nick $2 was last seen parting [ $readini ini\users.ini $2 chan ]  $+ $duration($calc($ctime($fulldate)-$ctime($readini ini\users.ini $2 date))) ago. | .msg $nick 5 $+ $2 $+ 's last action was: [ $readini ini\users.ini $2 me ] } 
        else { .msg $nick $2 was last seen quiting  $+ $duration($calc($ctime($fulldate)-$ctime($readini ini\users.ini $2 date))) ago with the message: " $+ [ $readini ini\users.ini $2 message ] $+ ". | .msg $nick $2 $+ 's last action was: [ $readini ini\users.ini $2 me ] }
      }
    }
    else { halt }
  }
}
#sen end
#sjsen on
on 1:QUIT:/writeini -n ini\users.ini $nick date $fulldate | writeini -n ini\users.ini $nick part no | writeini -n ini\users.ini $nick message $1-
on 1:PART:#:/writeini -n ini\users.ini $nick date $fulldate | writeini -n ini\users.ini $nick chan $chan | writeini -n ini\users.ini $nick part yes
on 1:ACTION:*:#:writeini -n ini\users.ini $nick me * $+ $nick $1-
#sjsen end

; google script

alias google {
  ;if you use a proxy server, you can put its ip/port in here, and that should work fine.
  ;note: I've used google's ip to save the time of a dns lookup. You're welcome to change it to google.com
  sockopen google google.com 80
  %google.temp = $1-
}
on 1:sockopen:google:{
  if ($sockerr > 0) return
  sockwrite -n google $eval(GET http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=,0) $+ %google.temp $+ $eval(&btnI=I%27m+Feeling+Lucky HTTP/1.0,0)
  sockwrite -n google
}

on 1:sockread:google:{
  ;ths event has been added to in order to allow remote !google commands
  if ($sockerr > 0) return
  :nextread
  sockread %google.temp
  if ($sockbr == 0) return
  if ( Location: isin %google.temp ) {
    if ( %google.nick != $null ) {
      notice %google.nick 2G4o8o2g3l4e $right(%google.temp,-10)
      unset %google.nick
    }
    else {
      echo 2G4o8o2g3l4e $right(%google.temp,-10)
    }
    sockclose google | return
  }
  elseif ( did not match any documents isin %google.temp ) {
    if ( %google.nick != $null ) {
      notice %google.nick 2G4o8o2g3l4e No match
      unset %google.nick
    }
    else {
      echo 2G4o8o2g3l4e No match
    }
  }
  goto nextread
}

;A simple remote implementation of the google script

on 1:text:!google*:#:{
  %google.nick = $nick
  google $2-
}

me,12).state == 1) { g.ini all on } | else { g.ini all off }
    if ($did($dname,16).state == 1) { g.ini active on } | else { g.ini active off }
  }
}

Comments

Sign in to comment.
Storm2108   -  Jul 05, 2007

Nice Bot You have here Keep up the work 4/10

 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.