Op bot

By MackBot on Sep 27, 2009

Ok this is really my first script and I haven't seen one this elaborate on hawkee.

it is an op bot basically.

For IRC services

Updated -- they told me to update my old one :D

alias commands {
  ;op commands
if ($nick isop $chan || $nick == %nick) {
  if ($1 == !topic) { cs topic $chan $2- }
  if ($1 == !op) { mode $chan +o $2 }
  if ($1 == !hop) { cs halfop $chan $2 }
  if ($1 == !voice) { mode $chan +v $2 }
  if ($1 == !deop) { mode $chan -o $2 }
  if ($1 == !dehop) { cs dehalfop $chan $2 }
  if ($1 == !devoice) { mode $chan -v $2 }
  if ($1 == !ban) { mode $chan +b $address($2,2) $2 }
  if ($1 == !unban) { mode $chan -b $address($2,2) $2 }
}
if ($nick == %nick) {
  ;owner comamnds
  if ($1 == !protect) { cs protect $chan $2 }
  if ($1 == !deprotect { cs deprotect $chan $2 }
  if ($1 == !own) { mode $chan +q $2 }
  if ($1 == !unown) { mode $chan -q $2 }
  if {$1 == !aop) { cs aop $chan add $2 }
  if {$1 == !sop) { cs sop $chan add $2 }
  if ($1 == !desop) { cs sop $chan del $2 }
  if ($1 == !deaop) { cs aop $chan del $2 }
  if ($1 == !ahop) { cs hop $chan add $2 }
  if ($1 == !deahop) { cs hop $chan del $2 }
}
}
on *:load:{ set %nick $?="Enter Nickname" }
on *:TEXT:*:#: {
  tokenize 32 $strip($1-)
  if ($nick !isop $chan) || $nick != %nick && ($istok($commands,$1-,32) ) {
    notice $nick Access denied. Only Ops can use it.
  }
  elseif ($nick != %nick) && ($istok($commands,$1-,32)) {
    notice $nick Access denied. Only my owner can use it.
  }
else { commands $1- }
}

Comments

Sign in to comment.
Astaroth   -  Sep 30, 2009

w00f

 Respond  
napa182   -  Sep 29, 2009

i concur with Jethro_ as well as some flood control or else /timer 0 1 !op balh

 Respond  
Gage   -  Sep 28, 2009

It works good thanks :D

 Respond  
Jethro   -  Sep 28, 2009

I realize I should've put my two cents in. You really don't need to add if $nick isop $chan in every line and one text event per trigger. One is really enough:

on *:TEXT:*:#: {
  tokenize 32 $strip($1-)
  if ($nick !isop $chan) && ($istok($commands,$1-,32)) {
    notice $nick Access denied. Only Ops can use it.
  }
  if ($1 == !own) { mode $chan +q $2 }
  if ($1 == !unown) { mode $chan -q $2 }
  if ($1 == !topic) { cs topic $chan $2- }
  if ($1 == !op) { mode $chan +o $2 }
  .....
  so on and so forth...
}
alias -l commands { return !own !unown !topic !op }

if $nick !isop $chan tells mirc if the nick is not an op.

 Respond  
russjr08   -  Sep 27, 2009

Nice Code
Hint on WyldRyde you can already hire a bot like this but cant change its name so this is really useful

 Respond  
Cracker200   -  Sep 27, 2009

o.O

 Respond  
Jethro   -  Sep 27, 2009

From a good perspective in scripting, this script is redundant. And this sort of script has been done many, many times. Since the author suggests this is his first time, I'll withdraw my further critics.

 Respond  
Cracker200   -  Sep 27, 2009

LOL Nice :D

 Respond  
MackBot   -  Sep 27, 2009

Thanks.

I couldn't find one like it on hawkee and it pissed me off so I hat to write my own.

 Respond  
Vesperia   -  Sep 27, 2009

Good snippet. Very useful.

 Respond  
Cracker200   -  Sep 27, 2009

Nice =) I like it ;)

 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.