Goggled_Bot Version 2.0

By supergeo on Aug 15, 2005

Version 2.1 Notes
I just finished another partial update/cleaning/revision on the code. Also, I made it so that it will add a # if someone forgets it in the channel command. I need more ideas, guys!

Version 2.0 Notes I updated the code and added a coowner. I fixed errors and fixed some security issues for owner. The code is also a little easier on the eyes.
To set up:
type /setup

to change chan: /chan
to change coowner: /coowner
to change owner: /owner

Includes: Modes for channels and users, greet system, Slots game, question game, coin toss, Stats, Kicking, Banning.

Access Modes:
(From greatest to least)
Owner(1): Set by /owner or in /setup
Co-Owner(1)(NEW!): set by /coowner or in /setup
Op(Unlimited): Default Ops
Halfop(Unlimited): Default Halfops
Voice(Unlimited): Default Voices.

alias coowner { set %coowner $$?="Co-Owner:" }

alias chan {
 set %chan $$?="Channel:" 
 if ($chr(35) !isin %chan) set %chan $chr(35) $+ %chan
}

alias owner { set %owner $$?="Owner's nick:" }

alias setup { chan 
              owner
              coowner
}

on *:Text:!toss*:%chan:{
  set %z $rand(1,2)
  if (%z == 1)  set %pi Heads 
  else set %pi Tails 
  set %wow $rand(1,2) 
  if (%wow == 1) set %outcome Heads 
  else set %outcome Tails 
  if (%outcome == %pi) { msg $chan $nick needs %pi to win. $me flips the coin. It lands on %outcome . $nick wins! }
  else { msg $chan $nick needs %pi to win. $me flips the coin. It lands on %outcome . $nick loses. }
}

on *:Text:!owner*:%chan:{
  If ($nick == %owner) || ($nick == %coowner) {
    If ($2 == $null) set %1 $nick
    Else set %1 $2 
    If ($nick == %coowner) && (%1 == %owner) halt 
    Mode $chan +qa-ohv %1 %1 %1 %1 %1
    Msg $chan %1 now has OWNER status.
    Unset %1
  }
}

on *:Text:!admin*:%chan:{
  if ($nick == %owner) || ($nick == %coowner) {
    If ($2 == $null) set %1 $nick 
    Else set %1 $2 
    If ($nick == %coowner) && (%i == %owner) halt 
    Mode $chan +a-ohv %1 %1 %1 %1
    Msg $chan %1 now has ADMIN status.
    Unset %1
  }
}

on *:Text:!op*:%chan:{
  if ($me isop $chan) {
    If ($2 == $null) set %1 $nick 
    Else set %1 $2 
    If ($nick == %coowner) && (%1 == %owner) halt 
    If ($nick == %owner) || ($nick == %coowner) { mode $chan +o-qahv %1 %1 %1 %1 %1 }
    Elseif ($nick isop $chan) && (%1 != %owner) && (%1 != %coowner) { mode $chan +o-hv %1 %1 %1 }
    Msg $chan %1 now has OP status 
    Unset %1
  }
}

on *:Text:!halfop*:%chan:{
  If ($me isop $chan) {
    If ($2 == $null) set %1 $nick 
    Else set %1 $2 
    If ($nick == %coowner) && (%1 == %owner) halt 
    If ($nick == %owner) || ($nick == %coowner) { mode $chan +h-qaov %1 %1 %1 %1 %1 }
    Elseif ($nick isop $chan) && (%1 != %owner) && (%1 != %coowner) { mode $chan +h-v %1 %1  }
    Elseif ($nick ishelp $chan) && (%1 != %owner) && (%1 != %coowner) { mode $chan +h-v %1 %1 }
    Msg $chan %1 now has Half-OP status 
    Unset %1
  }
}

on *:Text:!voice*:%chan:{
  if ($me isop $chan) || ($me ishelp $chan) {
    if ($2 == $null) { set %1 $nick }
    else { set %1 $2 }
    if ($nick == %coowner) && (%1 == %owner) { halt }
    if ($nick == %owner) || ($nick == %coowner) { mode $chan +v-qaoh %1 %1 %1 %1 %1 }
    elseif ($nick isop $chan) && (%1 != %owner) && (%1 != %coowner) { mode $chan +v-h %1 %1  }
    elseif ($nick ishelp $chan) && (%1 != %owner) && (%1 != %coowner) { mode $chan +v-h %1 %1 }
    elseif ($nick isvoice $chan) && (%1 != %owner) && (%1 != %coowner) { mode $chan +v %1 }
    msg $chan %1 now has Voice status 
    unset %1
  }
}

on *:Text:!viewgreet*:%chan:{ msg $chan Greet: %gmsg }

on *:Text:!av*:%chan:{
  if ($nick == %owner) || ($nick == %coowner) {
    if ($2 == off) { unset %avoice | halt }
    set %avoice on 
  }
}

on *:Join:%chan:{
  msg $chan %gmsg
  inc %joins
  if ($nick != $me) inc %users 
  if (%avoice == on) mode $chan +v $nick 
}

on *:Part:%chan:{ 
  if ($nick != $me) { dec %users 1 | inc %parts }
}

on *:Text:!users*:%chan:{
  if (%users = 1) { 
    msg %chan There is 1 user on the channel.
    if ($nick isop $chan) { msg %chan The user is an op. }
    halt
  }
  msg %chan There are %users users on the channel, including:
  msg %chan %co Ops, %ch Half-Ops, and %cv Voices.
}

on *:Rawmode:%chan:{ 
  if ($2 != $me) {
    if ($1 === +b) { inc %b }
    if ($1 === -h) { inc %dh | dec %ch }
    if ($1 === -o) { inc %do  | dec %co }
    if ($1 === +h) { inc %ho | inc %ch }
    if ($1 === +o) { inc %op | inc %co }
    if ($1 === +v) { inc %v | inc %cv }
    if ($1 === -b) { inc %ub }
    if ($1 === -v) { inc %dv | dec %cv }
  }
}
on *:Join:%chan:{ 
  if ($nick != $me) { inc %j }
}
on *:Kick:%chan:{
  if ($nick != $me) { inc %k }
}
on *:Part:%chan:{ 
  if ($nick != $me) { inc %p }
}
on *:Topic:%chan:{
  if ($nick != $me) { inc %t }
}

on *:Text:!stats*:%chan:{
  if ($nick isop $chan) || ($nick ==%owner) {
    if ($2 == $null) { set %1 $nick }
    else { set %1 $2 }
    notice %1 Stats for $chan $+ :
    notice %1 Joins: %j
    notice %1 Parts: %p
    notice %1 Kicks: %k
    notice %1 Bans: %b
    notice %1 Unbans: %ub
    notice %1 Voices: %v
    notice %1 De-Voices: %dv
    notice %1 Half-Ops: %ho
    notice %1 De-Half-Ops: %dh
    notice %1 Ops: %op
    notice %1 De-Ops: %do
    notice %1 Topic Changes: %t
    notice %1 Users Currently On Channel: %users
  }
}

on *:Text:!greet*:%chan:{
  if ($nick isop $chan) || ($nick == %owner) || ($nick == %coowner) {
    if ($2 == $null) { set %gmsg Welcome to $chan $nick+ ! }
    else { set %gmsg $2- }
    msg $chan %gmsg
  }
}

on *:Text:!down*:%chan:{
  if ($nick == %owner) {
    if ($2 == $null) { set %1 $nick }
    else { set %1 $2 }
    mode $chan -qaohv %1 %1 %1 %1 %1
    msg $chan %1 now has WATCHING status.
    unset %1 
  } 
  elseif ($nick == %coowner) {
    if ($2 == $null) set %1 $nick 
    else set %1 $2 
    if (%1 != %owner) {
      mode $chan -qaohv %1 %1 %1 %1 %1
      msg $chan %1 now has WATCHING status.
      unset %1
    }
  }

  elseif ($nick isop $chan) { 
    if ($2 == $null) { set %1 $nick }
    else { set %1 $2 }
    if (%1 != %owner) { 
      if (%1 == %coowner) && ($nick != %owner) { halt }
      mode $chan -ohv %1 %1 %1
      msg $chhan %1 now has WATCHING status.
      unset %1
    } 
  }
  elseif ($nick ishelp $chan) {
    if ($2 == $null) { set %1 $nick }
    else { set %1 $2 }
    if (%1 != %owner) { 
      if (%1 == %coowner) && ($nick != %owner) { halt }
      mode $chan -hv %1 %1
      msg $chan %1 now has WATCHING status.
      unset %1
    }
  }
  elseif ($nick isvoice $chan) {
    if ($2 == $null) { set %1 $nick }
    else { set %1 $2 }
    if (%1 != %owner) { 
      if (%1 == %coowner) && ($nick != %owner) { halt }    
      mode $chan -v $nick
      msg $chan $nick now has WATCHING status.
      unset %1
    }
  }
}
on *:Text:!rejoin*:%chan:{
  if ($nick == %owner) || ($nick == %coowner) { hop %chan }
}

on *:Text:!silence*:%chan:{
  if ($nick == %owner) || ($nick isop $chan) || ($nick == %coowner) {
    if ($2== off) { mode $chan -m | msg $chan The channel is unsilenced }
    else { mode $chan +m | msg $chan The channel is silenced | mode $chan +qa %owner %owner }
  }
}

on *:Text:!invite*:%chan:{
  if ($nick == %owner) || ($nick isop $chan) || ($nick == %coowner) {
    if ($2 == off) { mode $chan -i | msg $chan The channel is no longer invite only }
    else { mode $chan +i | msg $chan The channel is invite only }
  }
}

on *:Text:!kick*:%chan:{
  set %1 $2
  set %reason $3-
  if ($nick == %owner) { kick %1 %chan %reason }
  if ($nick == %coowner) && (%1 != %owner) { kick %1 %chan %reason }
  elseif ($nick isop $chan) { 
    if (%1 == %owner) || (%1 == %coowner) || (%1 isop %chan) { halt }
    else { kick %1 %chan %reason }
  }
  elseif ($nick ishelp $chan) {
    if (%1 == %owner) || (%1 == %coowner) || (%1 isop %chan) || (%1 ishelp %chan) { halt }
    else { kick %1 %chan %reason }
    unset %1
    unset %reason
  }
}

on *:Text:!ban*:%chan: {
  set %1 $2
  set %reason $3-
  if ($nick == %owner) { mode %chan +b %1 | kick %1 %chan %reason }
  if ($nick == %coowner) && (%1 != %owner) { mode %chan +b %1 | kick %1 %chan %reason }
  elseif ($nick isop $chan) { 
    if (%1 == %owner) || (%1 == %coowner) || (%1 isop %chan) { halt }
    else { mode %chan +b %1 | kick %1 %chan %reason }
  }
  elseif ($nick ishelp $chan) {
    if (%1 == %owner) || (%1 == %coowner) || (%1 isop %chan) || (%1 ishelp %chan) { halt }}
      else { mode %chan +b %1 | kick %1 %chan %reason }
    }
    unset %1
    unset %reason
  }
}
on *:Text:!gag*:%chan:{
  set %1 $2
  if ($nick == %owner) || ($nick isop $chan) || ($nick ishelp $chan) || ($nick == %coowner) {
    if (%1 == %owner) { halt }
    if (%1 == %coowner) && ($nick != %owner) { halt }
    else { mode $chan +b ~q: $+ %1 }
    msg $chan %1 Was gagged by $nick 
    unset %1
  }
}

on *:Text:!ungag*:%chan:{
  set %1 $2
  if ($nick == %owner) || ($nick isop $chan) || ($nick ishelp $chan) || ($nick == %coowner) {
    mode %chan -b ~q: $+ %1 
    msg $chan %1 Was ungagged by $nick 
    unset %1
  }
}

on *:Text:!unban*:%chan:{
  if ($nick == %owner) || ($nick isop $chan) || ($nick ishelp $chan) || ($nick == %coowner) {
    set %1 $2
    mode %chan -b %1
    unset %1
  }
}

on *:Text:!slots:#:{
  if (%hgslots == on) {
    set %sa $rand(1,4)
    if (%sa == 1) { set %sb & }
    if (%sa == 2) { set %sb % }
    if (%sa == 3) { set %sb 8 }
    if (%sa == 4) { set %sb JackPot }
    set %sc $rand(1,4) 
    if (%sc == 1) { set %sd & }
    if (%sc == 2) { set %sd % }
    if (%sc == 3) { set %sd 8 }
    if (%sc == 4) { set %sd JackPot }
    set %se $rand(1,4)
    if (%se == 1) { set %sf & }
    if (%se == 2) { set %sf % }
    if (%se == 3) { set %sf 8 }
    if (%se == 4) { set %sf JackPot }
    if (%rm == chan) { msg $chan $nick Got: %sb %sd %sf }
    if (%rm == nick) { msg $nick You got: %sb %sd %sf }
    if (%wm == chan) {
      if (%sb == &) && (%sb == %sd) && (%sd == %sf) { msg $chan $nick has won! }
      if (%rewards == on) && (%gandreward == voice) && ($me isop $chan) { mode $chan +v $nick }
      if (%rewards == on) && (%gandreward == op) && ($me isop $chan) { mode $chan +o $nick }
      if (%sb == %) && (%sb == %sd) && (%sd == %sf) { msg $chan $nick has won! }
      if (%rewards == on) && (%gprcreward == voice) && ($me isop $chan) { mode $chan +v $nick }
      if (%rewards == on) && (%gprcreward == op) && ($me isop $chan) { mode $chan +o $nick }
      if (%sb == 8) && (%sb == %sd) && (%sd == %sf) { msg $chan $nick has hit the JackPot! }
      if (%rewards == on) && (%geightreward == voice) && ($me isop $chan) { mode $chan +v $nick }
      if (%rewards == on) && (%geightreward == op) && ($me isop $chan) { mode $chan +o $nick }
      if (%sb == Jackpot) && (%sb == %sd) && (%sd == %sf) { msg $chan $nick has hit the Super JackPot! }
      if (%rewards == on) && (%gjpotreward == voice) && ($me isop $chan) { mode $chan +v $nick }
      if (%rewards == on) && (%gjpotreward == op) && ($me isop $chan) { mode $chan +o $nick }
    }
    if (%wm == user) {
      if (%sb == &) && (%sb == %sd) && (%sd == %sf) { msg $nick You have won! }
      if (%rewards == on) && (%gandreward == voice) && ($me isop $chan) { mode $chan +v $nick }
      if (%rewards == on) && (%gandreward == op) && ($me isop $chan) { mode $chan +o $nick }
      if (%sb == %) && (%sb == %sd) && (%sd == %sf) { msg $nick You have won! }
      if (%rewards == on) && (%gprcreward == voice) && ($me isop $chan) { mode $chan +v $nick }
      if (%rewards == on) && (%gprcreward == op) && ($me isop $chan) { mode $chan +o $nick }
      if (%sb == 8) && (%sb == %sd) && (%sd == %sf) { msg $nick You have hit the JackPot! }
      if (%rewards == on) && (%geightreward == voice) && ($me isop $chan) { mode $chan +v $nick }
      if (%rewards == on) && (%geightreward == op) && ($me isop $chan) { mode $chan +o $nick }
      if (%sb == Jackpot) && (%sb == %sd) && (%sd == %sf) { msg $nick You have hit the Super JackPot! }
      if (%rewards == on) && (%gjpotreward == voice) && ($me isop $chan) { mode $chan +v $nick }
      if (%rewards == on) && (%gjpotreward == op) && ($me isop $chan) { mode $chan +o $nick }
    }
  }
  else { msg $chan Slots are currently off! }
}
on *:Text:!*:#:{ 
  var %c $1 
  goto %c 
  :!slots 
  if ($nick isop #) && ($istok(on off,$2,32)) set %gslots $2 
  halt 
  :!status 
  msg # Slots are currently %gslots $+ ! 
  halt 
  :!help 
  msg # to play, type !slots . 
  halt 
  :%c 
} 

menu nicklist,channel {
  Slots
  .Turn On { set %gslots on }
  .Turn Off { unset %gslots }
  .Addy Slots On:msg $chan Slots is now on!
  .Addy Slots Off:msg $chan Slots are now off!
  .Message outcomes to user:unset %wm | set %wm user
  .Message outcomes to channel:unset %wm | set %wm chan
  .Rewards
  ..On:set %rewards on
  ..Off:unset %rewards
  ..-
  ..% Voice:unset %gprcreward | set %gprcreward voice
  ..% Op:unset %gpcrreward | set %gprcreward op
  ..% None:unset %gprcreward
  ..-
  ..& Voice:unset %gandreward | set %gandreward voice
  ..& Op:unset %gandreward | set %gandreward op
  ..& None:unset %gandreward
  ..-
  ..8 Voice:unset %geightreward | set %geightreward voice
  ..8 Op:unset %geightreward | set %geightreward op
  ..8 None:unser %geightreward
  ..-
  ..JackPot Voice:unset %gjpotreward | set %gjpotreward voice
  ..JackPot Op:unset %gjpotreward | set %gjreward op
  ..JackPot None:unset %gjpotreward 
  ..-
  ..Voice for all:unset %g* | set %g* voice
  ..Op for all:unset %g* | set %g* op 
  ..None for all:unset %g*
}
on *:Text:!question*:#:{ 
  set %Question $2
  set %answer $rand(1,3)
  if (%answer == 1) { msg $chan %question : Yes }
  if (%answer == 2) { msg $chan %question : No }
  if (%answer == 3) { msg $chan %question : Maybe }
}

Comments

Sign in to comment.
KuTsuM   -  Aug 31, 2005

you mean $chr*, and I know that

 Respond  
supergeo   -  Aug 31, 2005

Actually it is! $chan(35) turns out as # in the text! Will add that in an update, though. Guys I need more ideas here!

 Respond  
KuTsuM   -  Aug 30, 2005

alias chan { set %chan $$?=\"Channel:(Don\'t forget the $chr(35) before the channel\'s name):\" } Not very idiot/noobie-proof

 Respond  
supergeo   -  Aug 30, 2005

Anyone have any comments on the new version

 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.