All pastes #624534 Raw Edit

whois script

public text v1 · immutable
·published 2007-07-18 10:45 UTC
rendered paste body
on *:TEXT:!commands:*: { msg $nick }


-----------------------------------------------------------


on *:Start:{
  if (!$hget(greet)) {
    hmake Greet
  }
  if ($exists(greet.txt)) {
    hload greet greet.txt
  }
}

on *:Exit:{
  hsave greet greet.txt
}

on *:text:!setgreet*:#:{
  if ($len($2-) > 200) { .notice $nick That greet is too long. Your greet must be under 200 characters. | Halt }
  else {
    if (!$2) { 
      .notice $nick No greet set. 
      halt 
    }
    if ($2 == off) && (!$3) {
      .hadd greet $nick off
      .notice $nick Greets turned off for the nick $+($nick,.)
    } 
    else { 
      .notice $nick Your greet has been set to $+($2-,.) 
      .hadd greet $nick $2-
      .hsave greet greet.txt
    }
  }
}

on *:TEXT:!Greets*:#:{
  if ($nick isop $chan) || ($address($nick,2) == $address($me,2)) {
    if (!$2) {
      if ($hget(greet,$chan)) {
        .notice $nick Greets are currently off in $+($chan,.)
      }
      else {
        .notice $nick Greets are currently on in $+($chan,.)
      }
    }
    if ($2 == off) { 
      .notice $nick Greets are now off in channel $+($chan,.) 
      .hadd greet $chan on 
      .hsave greet greet.txt 
    }
    elseif ($2 == on) { 
      .notice $nick Greets are now on in channel $+($chan,.) 
      .hdel greet $chan 
      .hsave greet greet.txt
    }
  }
  else { .notice $nick You must be an op to alter this channel's greet settings. | halt }
}

on *:Text:!viewgreet:*:{
  if (!$hget(greet,$nick)) {
    notice $nick No Greet Found, please type !greethelp to get help with greets.
  }
  else {
    notice $nick Your greet is set to $hget(greet,$nick))
  }
} 

on *:TEXT:!Delgreet*:#:{
  if ($hget(greet,$nick)) {
    .hdel greet $nick 
    .notice $nick Your greet has been deleted.
  }
  else { .notice $nick You have no greet set. Type !setgreet greet here to set one. | halt }
}

on *:Join:#:{
  if (($hget(Greet,$chan)) || ($hget(greet,$nick) == off) || ($nick == $me)) {
    Halt
  } 
  if ((!$hget(greet,$nick)) && (!$hget(greet,$chan))) { 
    .notice $nick You have no greet set. To set a greet, type !setgreet greet here.
    halt 
  }
  elseif (($hget(greet,$nick)) && (!$hget(Greet,$chan))) {
    .msg $chan [2 $+ $nick $+ ] $hget(greet,$nick) 
  }
}

on *:TEXT:!setclansite*:#:{
  if ($nick isop $chan) {
    set %clansite $2- 
    .notice $nick Clan Site has been set to $+($2-,)
  }
}

on *:TEXT:!clansite*:#:{
  .notice $nick The Clan Site URL is $+(%clansite,)
}


On $*:Text:/^[!@.]Price */Si:#:{
  if (!$2) {
    notice $nick No item entered.
  }
  else {
    var %x = 1
    while ($sock($+(Price.,%x))) {
      inc %x
    }
    set $+(%,price.target,.,%x) $iif($left($1,1) == @,msg $chan, notice $nick)
    set $+(%,price.search,.,%x) $replace($2-,$chr(32),+)
    sockopen $+(Price,.,%x) www.slushpuppy.silverinterlocution.org 80
  }
}

On *:SockOpen:Price.*:{
  var %id = $right($sockname,-6)
  sockwrite -nt $sockname GET /price.php?price= $+ $eval($+(%,price.search,.,%id),2) HTTP/1.1
  sockwrite -nt $sockname Host: www.slushpuppy.silverinterlocution.org $+ $crlf $+ $crlf
}

On *:SockRead:Price.*:{
  var %id = $right($sockname,-6)
  var %target = $eval($+(%,price.target,.,%id),2)
  if ($sockerr) {
    %target A socket error has occured, please try again later.
    cleanup %id
  }
  else {
    var %read
    var %matches 
    while (1) {
      sockread %read
      if (!$sockbr) { 
        break
      }
      if (*gp* iswm %read) {
        tokenize 32 %read
        inc %matches  
        var %results = %results $iif(%results,$col1($+($chr(2),$chr(124),$chr(2))),$chr(32)) $col2($deltok($1-,$0,32))
      }
    }

    if (!%matches) {
      %target $col1(No Results found.)
    }

    else { 
      %target $col1(Returning) $col2(%matches) $col1(results:)
      %target $right(%results,-1) 
    }    

    sockclose $sockname
    cleanup %id
  }
}



alias -l col1 {
  return $+($chr(3),2,$1-,$chr(3)) 
}

alias -l col2 {
  return $+($chr(3),10,$1-,$chr(3)) 
}

alias -l cleanup {
  unset $+(%,Price,.,*,.,$1)
}


on *:TEXT:!kb*:#:{
  if (!$2) { .mode $chan +b $address($nick,2) | .kick $chan $nick $3- }
  else { .mode $chan +b $address($2,2) | kick $chan $2 $3- }
}

on $*:TEXT:/^[!@](TempBan|tb) */Si:#:{
  var %minutes = $calc($3 * 60) 
  if ($nick !isop $chan) { .notice $nick You are not authorized to do that. | halt }
  if ($me !isop $chan) && ($me !ishop $chan) { .notice $nick Sorry $nick $+ , I must be a halfop or op to Temp-ban. | Halt }
  if (!$2) { .notice $nick No Name Given | Halt }
  if (!$3) { .notice $nick No Time Given | Halt }
  if ($2 == $me) || ($2 == %owner) { .notice $nick I'm not going to tempban myself. | Halt }
  elseif ($address($nick,2) == $address($me,2)) || ($nick isop $chan) { .mode $chan +b $address($2,2) | .k $2 $2 Temp Banned for $3 $iif($3 == 1,minute,minutes) by $+($nick,.) $iif($4 != $null,Reason: $4-,No Reason Given) | .notice $2 You have been banned from $chan for $3 Minutes By $+($nick,.) $iif($4 != $null,Reason: $4-,No Reason Given) }
  .timer 1 %minutes { .mode $chan -b $address($2,2) | .notice $2 You have been unbanned from $+($chan,.) }
}


alias -l c1 { return $+($chr(3),01,$1-,$chr(3)) } 
alias -l c2 { return $+($chr(3),10,$1-,$chr(3)) } 
alias -l c3 { return $+($chr(3),02,$1-,$chr(3)) }

on $*:TEXT:/^[!@.]/Si:#: {
  if ($remove($1,!,@,.) == stats) {
    set %stats.style level 
  }
  elseif ($regex($remove($1,!,@,.),/^(def(ault)?|set)(rsn|name)/i)) {
    writeini -n DefRSN.ini RSNs $address($nick,2) $replace($2-,$chr(32),_)
    notice $nick $c1(Your default RSN for the host) $c2($address($nick,2)) $c1(has been set to) $c2($replace($2-,$chr(32),_)) $+ $c1(.)  
    halt
  }
  elseif ($statstrue($remove($1,!,@,.))) && ($remove($1,!,@,.) !isnum) { set %stats.style $+(skill.,$v1) }
  elseif ($regex($remove($1,!,@,.),/^co?mb(at)?|duel/i)) { set %stats.style combat }
  else { halt }
  set %stats.display $iif($left($1,1) == @,msg $chan,notice $nick)
  set %stats.n 0
  if ($2) {
    if (& isin $2-) {
      tokenize 32 $remove($1-,&)
      if ($2 !ison $chan) { notice $nick $c1(The username) $c2($2-) $c1(was not found on the channel.) | unset %stats.* | halt }
      elseif (!$readini(DefRSN.ini,n,RSNs,$address($2,2))) { notice $nick $c1(The username) $c2($2-) $c1(has not set a default RSN.) | unset %stats.* | halt }
      else { set %stats.user $readini(DefRSN.ini,n,RSNs,$address($2,2)) }
    }
    else { set %stats.user $replace($2-,$chr(32),_) }
  }
  else { 
    if ((!$readini(DefRSN.ini,n,RSNs,$address($nick,2))) && (!$2)) { .notice $nick You must specify a username between 3 and 12 characters. This can be omitted if defname is set. | Halt } 
    else { set %stats.user $readini(DefRSN.ini,n,RSNs,$address($nick,2)) }
  }
  sockopen stats hiscore.runescape.com 80
} 

on *:SOCKOPEN:stats: {
  sockwrite -n $sockname GET $+(/hiscorepersonal.ws?user1=,%stats.user) HTTP/1.1
  sockwrite -n $sockname Host: hiscore.runescape.com $+ $crlf $+ $crlf
}

on *:SOCKREAD:stats: {
  var %i | sockread %i
  if (*does not feature* iswm %i) {
    %stats.display $c1(The username) $c2(%stats.user) $c1(does not appear in the Runescape Hiscores.)
    unset %stats.* | sockclose stats
  }
  elseif ($statstrue(%i)) { set %stats.skill %i | set %stats.n 1 }
  elseif (%stats.n isnum 3-5) {
    set $+(%,stats.,%stats.skill,.,$statstype(%stats.n)) $gettok($gettok(%i,2,62),1,60)
    if (%stats.n == 5) { set %stats.n 0 }
  }
  elseif (*</table>* iswm %i) {
    if ($left(%stats.style,5) == skill) {
      if ($($+(%,stats.,$gettok(%stats.style,2,46),.exp),2)) {
        var %rank = $($+(%,stats.,$gettok(%stats.style,2,46),.rank),2)
        var %exp = $($+(%,stats.,$gettok(%stats.style,2,46),.exp),2)
        var %level = $($+(%,stats.,$gettok(%stats.style,2,46),.level),2)
        %stats.display $c1($chr(2) $+ [) $+ $c3(%stats.user) $+ $c1(]) $+ $chr(2) $c1($chr(2) $+ [) $c2($statstrue($gettok(%stats.style,2,46))) $c1(]) $+ $chr(2) $&
          $c1(Level:) $c2(%level) $c1($chr(124)) $c1(Rank:) $c2(%rank) $c1($chr(124)) $c1(Exp:) $c2(%exp) $&
          $c1($chr(124)) $c1(Exp until $calc(%level + 1) $+ :) $c2($bytes($calc($statsxp($calc(%level + 1)) - $remove(%exp,$chr(44))),b))
      }
      else {
        %stats.display $c1($chr(2) $+ [) $+ $c3(%stats.user) $+ $c1(]) $+ $chr(2) $c1(User does not appear in the Runescape Hiscores for) $c2($gettok(%stats.style,2,46)) $+ $c1(.)
      }
      unset %stats.* | sockclose stats
    }
    elseif (%stats.style == combat) {
      var %a = $iif(%stats.Attack.level,$v1,1)
      var %d = $iif(%stats.Defence.level,$v1,1)
      var %s = $iif(%stats.Strength.level,$v1,1)
      var %h = $iif(%stats.Hitpoints.level,$v1,10)
      var %r = $iif(%stats.Ranged.level,$v1,1)
      var %p = $iif(%stats.Prayer.level,$v1,1)
      var %m = $iif(%stats.Magic.level,$v1,1)
      {
        var %base = $calc(($calc((%d *100)+(%h *100)) + $iif($isodd(%p),$calc(%p -1) *50,%p *50))/400)
        var %melee = $calc(((%a *130)+(%s *130))/400)
        var %range = $calc($iif($isodd(%r),$calc(((%r -1)+(%r *2))*65),$calc(%r *195))/400)
        var %mage = $calc($iif($isodd(%m),$calc(((%m -1)+(%m *2))*65),$calc(%m *195))/400)
        if (%range >= %mage) && (%range >= %melee) { var %combat = $calc(%range + %base) | var %class = Ranged }
        elseif (%mage >= %range) && (%mage >= %melee) { var %combat = $calc(%mage + %base) | var %class = Magic }
        else { var %combat = $calc(%melee + %base) | var %class = Melee }
      }
      %stats.display $c1($chr(2) $+ [) $+ $c3(%stats.user) $+ $c1(]) $+ $chr(2) $c1(Combat Level is) $c2(%combat) $c1([) $c2($+(%class,-,based Combat)) $c1(])
      %stats.display $c1(Attack:) $c2(%a) $c1($chr(124)) $c1(Defence:) $c2(%d) $c1($chr(124)) $c1(Strength:) $c2(%s) $c1($chr(124)) $c1(Hitpoints:) $c2(%h) $c1($chr(124)) $c1(Ranged:) $c2(%r) $c1($chr(124)) $c1(Prayer:) $c2(%p) $c1($chr(124)) $c1(Magic:) $c2(%m)
      unset %stats.* | sockclose stats
    }
    else {
      var %x = 1
      while (%x <= 17) {
        var %statline = %statline $iif($($+(%,stats.,$statstrue(%x),.level),2),$c1($statstrue(%x) $+ :) $c2($($+(%,stats.,$statstrue(%x),.,%stats.style),2)) $c1($chr(124)) $&,$null)
        inc %x
      }
      while (%x > 17) && (%x < 24) {
        var %statline2 = %statline2 $iif($($+(%,stats.,$statstrue(%x),.level),2),$c1($statstrue(%x) $+ :) $c2($($+(%,stats.,$statstrue(%x),.,%stats.style),2)) $c1($chr(124)) $&,$null)
        inc %x
      }

      %stats.display $c1($chr(2) $+ [) $+ $c3(%stats.user) $+ $c1(]) $+ $chr(2) $c1(Overall:) $iif(%stats.Overall.level,$c2($($+(%,stats.Overall.,%stats.style),2)),$c2(-)) $c1($chr(124)) $&
        $replace(%statline,Attack,Att,Defence,Def,Strength,Str,Hitpoints,HP,Ranged,Range,Prayer,Pray,Magic,Mage,Cooking,Cook,Woodcutting,Woodcut,Fletching,Fletch,Fishing,Fish,Firemaking,FM,Crafting,Craft,Smithing,Smith,Herblore,Herb,Agility,Agil,Thieving,Thief,Slayer,Slay,Farming,Farm,Runecraft,Rc,Hunter,Hunt,Construction,Con) 
      %stats.display $replace(%statline2,Attack,Att,Defence,Def,Strength,Str,Hitpoints,HP,Ranged,Range,Prayer,Pray,Magic,Mage,Cooking,Cook,Woodcutting,Woodcut,Fletching,Fletch,Fishing,Fish,Firemaking,FM,Crafting,Craft,Smithing,Smith,Herblore,Herb,Agility,Agil,Thieving,Thief,Slayer,Slay,Farming,Farm,Runecraft,Rc,Hunter,Hunt,Construction,Con) | unset %stats.* | sockclose stats
    }
  }
  if (%stats.n isnum 1-5) { inc %stats.n }
}

alias statstype {
  if ($1 == 3) { return rank }
  elseif ($1 == 4) { return level }
  else { return exp }
}

alias -l statstrue { 
  if ($1 == 0) || ($regex($1,/^(st|(skill)?total|overall)$/Si)) return Overall 
  elseif ($1 == 1) || ($regex($1,/^at(t|k|tack)?$/Si)) return Attack
  elseif ($1 == 2) || ($regex($1,/^def(en[cs]e)?$$/Si)) return Defence
  elseif ($1 == 3) || ($regex($1,/^str(ength)?$/Si)) return Strength
  elseif ($1 == 4) || ($regex($1,/^hp|hit(s|points?)?$/Si)) return Hitpoints
  elseif ($1 == 5) || ($regex($1,/^range(r|d|ing)?$/Si)) return Ranged
  elseif ($1 == 6) || ($regex($1,/^Pray(er)?$$/Si)) return Prayer
  elseif ($1 == 7) || ($regex($1,/^mag(e|ic)$$/Si)) return Magic
  elseif ($1 == 8) || ($regex($1,/^cook(ing)?$/Si)) return Cooking 
  elseif ($1 == 9) || ($regex($1,/^wc|wood(cut(ting)?)?$/Si)) return Woodcutting 
  elseif ($1 == 10) || ($regex($1,/^fletch(ing)?$/Si)) return Fletching 
  elseif ($1 == 11) || ($regex($1,/^fish(ing)?$/Si)) return Fishing 
  elseif ($1 == 12) || ($regex($1,/^(fire|fm)(make?(ing)?|ing)?$/Si)) return Firemaking 
  elseif ($1 == 13) || ($regex($1,/^craft(ing)?$/Si)) return Crafting 
  elseif ($1 == 14) || ($regex($1,/^(smith|smelt)(ing)?$/Si)) return Smithing 
  elseif ($1 == 15) || ($regex($1,/^mine(ing)?$/Si)) return Mining 
  elseif ($1 == 16) || ($regex($1,/^herb(law|lore)?$/Si)) return Herblore 
  elseif ($1 == 17) || ($regex($1,/^agil(ity)?$/Si)) return Agility 
  elseif ($1 == 18) || ($regex($1,/^(th(ei|ie)[fv](e|ing)?)$/Si)) return Thieving 
  elseif ($1 == 19) || ($regex($1,/^slay(er|ing)?$/Si)) return Slayer 
  elseif ($1 == 20) || ($regex($1,/^farm(er|ing)?$/Si)) return Farming 
  elseif ($1 == 21) || ($regex($1,/^(rc|runecraft)(er|ing)?$/Si)) return Runecraft 
  elseif ($1 == 22) || ($regex($1,/^(construct)(ion|ing)?$/si)) return Construction 
  elseif ($1 == 23) || ($regex($1,/^(hunt)(er|ing)?$/si)) return Hunter
}

alias statsxp {
  var %x = 1, %level = $calc($1 - 1), %xp = 0
  while (%x <= %level) {
    var %TempXp = $calc($floor($calc(%x + 300 * 2 ^ (%x / 7))) / 4)
    inc %xp %TempXp
    inc %x
  }
  return $int(%xp)
}

alias isodd { if (. isin $calc($1 /2)) { return true } | else { return false } } 

-------------------------------------------------------------------------------------------




------------------------------------------------------------------------------------------


on *:TEXT:!mute*:#:{  
  if ($address($nick,2) != $address($me,2)) { .notice $nick You are not authorized to do that. | halt }
  else { .mode $chan -qaohvee $2 $2 $2 $2 $2 $address($2,2) | .mode $chan +b ~q: $+ $address($2,2) }
}

on *:TEXT:!unmute*:#:{ 
  if ($address($nick,2) != $address($me,2)) { .notice $nick I'm the juggernaut bitch! | halt }
  else { .mode $chan -b ~q: $+ $address($2,2) }
}
--------------------------------------------------------------------------------------------


on *:Join:#:{
  If ($nick == Kevinneke864) {
    .msg $chan 11,14<12>11<12>11<12>11<12>0 OMG ITS MY 1337 OWNER! 11<12>11<12>11<12>11<12>
  }
}


--------------------------------------------------------------------------------------------

on $*:TEXT:/^[!]timebomb */Si:#:{
  if ($nick !isop $chan) && ($nick !ishop $chan) { .notice $nick You must be halfop or op to timebomb. | halt }
  if ($2 !ison $chan) { .notice $nick [2Time Bomb]: person MUST be on $+($chan,.) | halt }
  if ($2 == $me) { .msg $chan [2Time Bomb]: Choose a person OTHER than me please. | halt }
  if (%timebomb.nick ison $chan) { .describe $chan Points to the bulge in the front of %timebomb.nick $+ 's pants. | halt }
  elseif ($nick isop $chan) || ($nick ishop $chan) || ($address($nick,2) == $address($me,2)) { timebomb $chan $2 }
}

alias timebomb {
  set %timebomb 1
  set %timebomb.nick $2
  set %timebomb.address $address($2,2)
  set %tbrunaway. $2
  set %timebomb.chan $1
  set %timebomb.time $rand(20,60)
  set %timebomb.w. $rand(2,15)
  if (%timebomb.w. == 2) { .set %timebomb.w Red, Blue }
  if (%timebomb.w. == 3) { .set %timebomb.w Red, Blue, Green }
  if (%timebomb.w. == 4) { .set %timebomb.w Red, Blue, Green, White }
  if (%timebomb.w. == 5) { .set %timebomb.w Red, Blue, Green, White, Black }
  if (%timebomb.w. == 6) { .set %timebomb.w Red, Blue, Green, White, Black, Purple }
  if (%timebomb.w. == 7) { .set %timebomb.w Red, Blue, Green, White, Black, Purple, Orange }
  if (%timebomb.w. == 8) { .set %timebomb.w Red, Blue, Green, White, Black, Purple, Orange, Turquoise }
  if (%timebomb.w. == 9) { .set %timebomb.w Red, Blue, Green, White, Black, Purple, Orange, Turquoise, Yellow }
  if (%timebomb.w. == 10) { .set %timebomb.w Red, Blue, Green, White, Black, Purple, Orange, Turquoise, Yellow, Brown }
  if (%timebomb.w. == 11) { .set %timebomb.w Red, Blue, Green, White, Black, Purple, Orange, Turquoise, Yellow, Brown, Lime }  
  if (%timebomb.w. == 12) { .set %timebomb.w Red, Blue, Green, White, Black, Purple, Orange, Turquoise, Yellow, Brown, Lime, Pink }
  if (%timebomb.w. == 13) { .set %timebomb.w Red, Blue, Green, White, Black, Purple, Orange, Turquoise, Yellow, Brown, Lime, Pink, Gray } 
  if (%timebomb.w. == 14) { .set %timebomb.w Red, Blue, Green, White, Black, Purple, Orange, Turquoise, Yellow, Brown, Lime, Pink, Gray, Silver }
  if (%timebomb.w. == 15) { .set %timebomb.w Red, Blue, Green, White, Black, Purple, Orange, Turquoise, Yellow, Brown, Lime, Pink, Gray, Silver, Gold }
  while (%timebomb.w2 !isin %timebomb.w) {
    set %timebomb.w2 $rand(1,15)
    set %timebomb.w2 $replace(%timebomb.w2,1,Red,2,Blue,3,Green,4,White,5,Black,6,Purple,7,Orange,8,Turquoise,9,Yellow,10,Brown,11,Lime,12,Pink,13,Gray,14,Silver,15,Gold)
  }
  echo -a *** Correct wire is %timebomb.w2
  notice %owner Correct wire is %timebomb.w2 in %timebomb.chan
  describe $chan stuffs a Time Bomb down %timebomb.nick $+ 's Pants.  The display reads %timebomb.time seconds.
  msg $chan %timebomb.nick $+ : You have the choice of %timebomb.w. wires ( $+ %timebomb.w $+ ) 
  msg $chan use !cutwire (color) to cut one!
  .enable #bombon
  .timerbombhalf 1 $calc(%timebomb.time / 2) msg %timebomb.chan Hurry %timebomb.nick $+ ! You only have $calc(%timebomb.time / 2) seconds left!
  .timerbomb 1 %timebomb.time /tblose
}

#bombon off
on $*:TEXT:/^[!]cutwire */Si:%timebomb.chan:{
  if ($address($nick,2) == %timebomb.address) {
    if (($findtok($remove(%timebomb.w,$chr(32)),$2,1,44)) && ($2 == %timebomb.w2)) {
      msg $chan $nick has cut the $2 wire.
      msg $chan 3 $+ $nick has successfully diffused the Bomb!
      msg $chan Congratulations $nick $+ , you don't get to die today.
      .timerbombhalf off
      .timerbomb off
      .disable #bombon
      .unset %timebomb* %tbrunaway.
    }
    elseif (!$findtok($remove(%timebomb.w,$chr(32)),$2,1,44)) {
      msg $chan Retard! there are no $2 wires! Choices are %timebomb.w $+ !
    }
    else {
      msg $chan $nick has cut the $2 wire. 
      msg $chan The Bomb has 4 EXPLODED!
      if ($me isop $chan) { .mode $chan +b $address(%timebomb.nick,2) }
      if ($me isop $chan) || ($me ishop $chan) { .kick $chan $nick 4*BOOM*3 }
      notice %timebomb.nick the correct wire was %timebomb.w2 
      .timerbombhalf off
      .timerbomb off
      .disable #bombon
      .unset %timebomb* %tbrunaway. 
    }
  }
}
#bombon end

alias tblose {
  .disable #bombon
  .unset %tbrunaway.
  msg %timebomb.chan %timebomb.nick has failed to defuse the bomb, and it has 4DETONATED!
  if ($me isop %timebomb.chan) { .mode %timebomb.chan +b $address(%timebomb.nick,2) }
  if ($me isop %timebomb.chan) || ($me ishop %timebomb.chan) { .kick %timebomb.chan %timebomb.nick 4*BOOM*3 }
  notice %timebomb.nick the correct wire was %timebomb.w2 
  .unset %timebomb*
}


--------------------------------------------------------------------------------------------

on $*:text:/^[!]except */Si:#:{
  if ($nick isop $chan) || ($address($nick,2) == $address($me,2)) { 
    if (!$2) { .mode $chan +ee $nick $address($nick,2) }
    else { .mode $chan +ee $2 $address($2,2) }  
  }
} 


on $*:TEXT:/^[!]deexcept */Si:#:{ 
  if ($nick isop $chan) || ($address($nick,2) == $address($me,2)) { 
    if (!$2) { .mode $chan -ee $nick $address($nick,2) }
    else { .mode $chan -ee $2 $address($2,2) } 
  }
}

--------------------------------------------------------------------------------------------
on $*:TEXT:/^[!](mode|setmode) */Si:#:{
  if ($me !isop $chan) && ($me !ishop $chan) { .notice $nick Sorry $nick $+ , I must be op or halfop to set the mode. | Halt }
  if (!$2) { .notice $nick You must specify a mode to set. | Halt }
  if ((q isin $2) || (a isin $2)) && ($address($nick,2) !=  $address($me,2)) { .notice $nick Sorry, you are not authorized to do that. | Halt }
  elseif ($nick isop $chan) || (($nick ishop $chan) && (o !isin $2)) || ($address($nick,2) == $address($me,2)) { .mode $chan $2- }
}



on $*:TEXT:/^[!](fgt-meter|gaymeter) */Si:#:{
  if ($2 == $me) { .describe $chan ran some gay-ness tests on $me $+ , and came up with these results:
    .msg $chan 8,0¤0,8¤9,8¤8,9¤13,9¤9,13¤1,13¤13,1¤9,14 $me is 0 $+ % gay. 13,1¤1,13¤9,13¤13,9¤8,9¤9,8¤0,8¤8,0¤ 
  .msg $chan 9,1STRAIGHT!! | halt }

  if (($2- == Michael Jackson) || ($2 == Michael_Jackson)) {
    .describe $chan says: WOW! MJ!? I don't even need to run tests on him, here : 
    .msg $chan 8,1`°*¤%7,8%8,7%8,4%7,4%¤1,4 Michael Jackson is 100% gay. 7,4¤%8,4%8,7%7,8%8,1%¤*°`
  .msg $chan 9,1TOTAL FAG! | halt }





  if (!$2) { 
    .describe $chan ran some gay-ness tests on $nick $+ , and came up with these results:
    .msg $chan 11,14<12,14>11,14<12,14>11,14<12,14>0,14 $nick is $rand(1,100) $+ % gay. 11,14<12,14>11,14<12,14>11,14<12,14>  

  }


  else { 
    var %number = $calc($len($2-) - 1)
    var %target = $upper($left($2-,1)) $+ $right($2-,%number)

    .describe $chan ran some gay-ness tests on %target $+ , and came up with these results:
    .msg $chan 13,1 $+ 8,12o1,12¤8,12o1,12¤8,12o1,12¤8,12o1,12¤8,12o %target is $rand(0,100) $+ % gay. o1,12¤8,12o1,12¤8,12o1,12¤8,12o1,12¤8,12o
  }
}

on $*:TEXT:/^[!@]calc */Si:#:{
  $iif($left($1-,1) == @,.msg $chan,.notice $nick) 1[2Calculator1] $2- = $bytes($calc($remove($replace($2-,k,*1000,m,*1000000,b,*1000000000,x,*,pi,3.141592)$2-,$chr(44),$chr(32))) ,bd) 
}

-----------------------------------------------------------------------------------------------


on $*:TEXT:/^[!]cya */Si:#:{  
  if ($2 != $me) || (!$2) { .notice $nick To avoid confusion, type !cya $me to make me leave. | halt }
  if ($nick isop $chan) || ($address($nick,2) == $address($me,2)) || ($nick == remy) { .part $chan Requested by $+($nick,.) $iif($3 != $null,Reason: $3-,No Reason Given) }
  else { halt }
}
 
----------------------------------------------------------------------------------------


on $*:TEXT:/^[!@](gratz|grats) */Si:#:{
  if ($2 isnum) { .msg $chan $gratz(Gratz on level $2 $+($3,$chr(44)) $+($nick,!) WOOT!) }
  if ($3 isnum) { .msg $chan $gratz(Gratz on level $3 $+($2,$chr(44)) $+($nick,!) WOOT!) }
  if ($2 !isnum) && ($3 !isnum) { .msg $chan $gratz(Gratz on your $2 level, $+($nick,!) WOOT!) }
}



alias gratz {
  var %gratzrand = $rand(1,4)
  if (%gratzrand == 1) { return 8,0¤0,8¤9,8¤8,9¤13,9¤9,13¤1,13¤13,1¤9,1 $1- 13,1¤1,13¤9,13¤13,9¤8,9¤9,8¤0,8¤8,0¤ }
  if (%gratzrand == 2) { return 11,14<12>11<12>11<12>11<12>0 $1- 11<12>11<12>11<12>11<12> }
  if (%gratzrand == 3) { return 4»0,4»5»4,5»1»5,1»0 $1- 5,1«1,5«4«5,4«0«4,0« }
  if (%gratzrand == 4) { return 8,12o1,12¤8,12o1,12¤8,12o1,12¤8,12o1,12¤8,12o $1- o1,12¤8,12o1,12¤8,12o1,12¤8,12o1,12¤8,12o }
}

-------------------------------------------------------------------------------------


on *:TEXT:!av*:#:{
  if ($address($nick,2) != $address($me,2)) { .notice $nick You are not authorized to do that. | Halt }
  if (!$2) { .notice $nick You need to tell me who to autovoice | HALT }
  elseif ($2) { 
    .writeini av.ini avoice $address($2,2) autovoiced 
    .notice $nick $2 Has been added to the $chan Autovoice list. 
  }
}

on *:Join:#:{
  if ($readini(av.ini,np,avoice,$address($nick,2)) == autovoiced) { 
    .mode $chan +v $nick 
  }
}

--------------------------------------------------------------------------------------

on *:TEXT:!setpcw*:#:{ 
  if (($nick isop $chan) || ($nick ishop $chan)) { 
    set %pcw $2- 
    describe $chan return 8,12o1,12¤8,12o1,12¤8,12o1,12¤8,12o1,12¤8,12o $1- o1,12¤8,12o1,12¤8,12o1,12¤8,12o1,12¤8,12o The pcw has been set, plz type !pcw to see it! 
  } 
} 
on *:TEXT:!pcw:#:{ 
  if %pcw { 
    notice $nick return 8,12o1,12¤8,12o1,12¤8,12o1,12¤8,12o1,12¤8,12o $1- o1,12¤8,12o1,12¤8,12o1,12¤8,12o1,12¤8,12o The pestcontrol world is ~~ %pcw ~~ and the suggest world is ~~ %suggest ~~ 
  } 
} 
on *:TEXT:!suggest*:#: { 
  set %suggest $2- { 
    describe $chan return 8,12o1,12¤8,12o1,12¤8,12o1,12¤8,12o1,12¤8,12o $1- o1,12¤8,12o1,12¤8,12o1,12¤8,12o1,12¤8,12o $nick has suggested a world, please type !pcw to see it! 
  } 
} 
on *:TEXT:!delpcw*:#:{ 
  if (($nick isop $chan) || ($nick ishop $chan)) { 
    unset %pcw 
    unset %suggest 
    Notice $chan return 8,12o1,12¤8,12o1,12¤8,12o1,12¤8,12o1,12¤8,12o $1- o1,12¤8,12o1,12¤8,12o1,12¤8,12o1,12¤8,12o The pcw has been deleted 
  } 
} 
on $*:TEXT:/^[!@.]s(et)?pc-?l(ist)?/Si:#:{ 
  if ($nick isop $chan || $nick ishop $chan) { 
    if ($2 !isnum || !$3) { notice $nick You must supply a number in this fashion: $1 <number> <rsn> } 
    if ($2 != 1 && !$readini(Pcl.ini,-n,$chan,$calc( $2 - 1 ))) { notice $nick You have not yet supplied the $calc( $2 - 1 ) person in the list } 
    else { 
      writeini Pcl.ini $chan $2 $3 
      notice $nick $3 has been added as number $2 on the PC list 
    } 
  } 
} 
on $*:TEXT:/^[!@.]pc-?l(ist)?/Si:#:{ 
  if (!$readini(Pcl.ini,-n,$chan,1)) { notice $nick No list has been made } 
  else { 
    var %x = 1 
    while ($readini(Pcl.ini,-n,$chan,%x)) { 
      msg $nick %x $+ . $readini(Pcl.ini,-n,$chan,%x) 
      inc %x 
    } 
  } 
}

-------------------------------------------------------------------------------------

on *:TEXT:hello:#:{ msg $chan Hi $nick }
on *:JOIN:#:{
  notice $nick Hello $nick welcome to $chan !
  notice $nick Make sure you enjoy your visit!
  notice $nick Pls Type /mode <nick> -f to see our CLANSITE
}

------------------------------------------------------------------------------------

on *:TEXT:!away*:#: { 
  if ($2 == $null) { msg $chan $chr(3) $+ 07 $+  $nick $chr(3) $+ 14 $+ please submit an away message } 
  else {  
    /set %away [ $+ [ $nick ] ] $2- 
    msg $chan $chr(3) $+ 07 $+ $nick $chr(3) $+ 14 $+ is now away for the following reasons: $chr(3) $+ 07 $+  %away [ $+ [ $nick ] ] 
  } 
} 
on *:TEXT:!back:#: { 
  if (%away [ $+ [ $nick ] ] == $null) { msg $chan $chr(3) $+ 07 $+  $nick $chr(3) $+ 14 $+ you havn't been marked as away yet! } 
  else { 
    msg $chan $chr(3) $+ 07 $+ $nick $chr(3) $+ 14 $+ is now back from: $chr(3) $+ 07 $+  %away [ $+ [ $nick ] ] 
  } 
} 

------------------------------------------------------------------------------------------

on *:OP:#: { 
  if ($opnick == $me) { 
    inc %op 
    msg $chan Thanks So Much!!for the Op $nick Do You Have A Partyhat You Own That Bad I Bet You Got One $+ . I've been opped %op times 
  } 
} 


on *:HELP:#: { 
  if ($hnick == $me) { 
    inc %halfop 
    msg $chan  8Thanks for the Halfop You Own You Know That? 14But not as much as me  $nick $+ . 8 I've been halfopped %halfop times 
  } 
} 

on *:DEVOICE:#: { 
  if ($vnick == $me) { 
    inc %devoice 
    msg $chan 11Gimme Me Back My Voice.. Or I'll Get My Owner  $nick $+ !! I've been devoiced %devoice times 
  } 
} 

---------------------------------------------------------------------------------



-------------------------------------------------------------------------------------

on *:sockopen:google: { 
  if ($sockerr) { msg $nick error: connecting failed ... } 
  else { 
    sockwrite -n $sockname GET $+(/search?btnI=&q=,$replace($hget(google,search),$chr(32),%)) HTTP/1.1 
    sockwrite -n $sockname Host: www.google.ch 
    sockwrite -n $sockname $crlf 
  } 
} 
on *:sockread:google: { 
  sockread %data 
  if ($gettok(%data,1,32) == location:) { 
    msg %chan %nick google: found for $+(",$hget(google,search),") $gettok(%data,2,32)
    sockclose $sockname 
    hdel google search 
  } 
  elseif (*We couldent find anything -*- .* iswm %data) { 
    msg %chan %nick google: nothing found for $+(",$hget(google,search),") 
    sockclose $sockname 
    hdel google search 
  } 
} 
on 1:text:!google*:#:{ 
  if ($2) {
    set %channel $chan 
    set %nick $nick
    hadd -m google search $2-
    if ($sock(google)) { sockclose google } 
    sockopen google google.ch 80 
  } 
}

------------------------------------------------------------------------------------------

on *:QUIT: { 
  if ($network isin $1-) && (*.*.*.* iswm $1-) && (Quit: !isin $1) && (Killed !isin $1-) { 
    if (%netsplit == yes) { halt } 
    [-Netsplit Alert-] $gettok($1,1,42) and $gettok($2,1,42) $+ at time $time $+ .
    timersplit 0 15 /set %netsplit no 
  } 
}
-----------------------------------------------------------------------------------------

on *:TEXT:!whois*:#: { 
  if ($nick isop $chan || $nick ishop $chan) { 
    if ($2 == on) { 
      if (%whois [ $+ [ $chan ] ] != on) { 
        set %whois [ $+ [ $chan ] ] on 
        msg $chan Whois on join has been enabled for $chan by $nick $+ . 
      } 
      else { 
        notice $nick Whois on join is already on for $chan $+ . | halt 
      } 
    } 
    elseif ($2 == off) { 
      if (%whois [ $+ [ $chan ] ] == on) { 
        set %whois  [ $+ [ $chan ] ] off 
        msg $chan Whois on join has been disabled for $chan by $nick $+ . 
      } 
      else { 
        notice $nick Whois on join is allready off for $chan $+ . 
      } 
    } 
  } 
} 
on *:JOIN:#: { 
  if (%whois [ $+ [ $chan ] ] == on) { 
    set %whoisnick $nick 
    set %whoischan $chan 
    whois $nick 
  } 
  else { 
    halt 
  } 
} 
raw *:*: { 
  if (%whoisnick && %whoischan) { 
    if ($numeric == 319) { 
      msg %whoischan %whoisnick is currently on: $3- 
      unset %whoisnick 
      unset %whoischan 
    } 
  } 
  else { 
    halt 
  } 
}