Public feed #891539

Hawth sexy runescape stats bot

public text v1 · immutable
Raw Edit
·published 2008-02-04 18:39 UTC
rendered paste body
alias homechan { Return #Casino }

on $*:TEXT:/^[!@]mycolors/Si:#:{ 
  if (!$2) && ($hget(defcolor1, $address($nick,2)) { notice $nick $c1($nick,Your default colors are:) $c2($nick,Color one) $c1($nick,Color two) | halt } 
  if (!$2) { notice $nick $c1($nick,No colors set) $c2($nick,type !mycolors <color1> <color2>) $c1($nick,to set them) | halt } 
  if ($2 !isnum 1-15) { notice $nick $c2($nick,$2) $c1($nick,is not a valid color) | halt } 
  if ($3 !isnum 1-15) { notice $nick $c2($nick,$3) $c1($nick,is not a valid color) | halt } 
  if ($2 == $3) { notice $nick $c1($nick,Please specifie) $c2($nick,Two) $c1(different colors) | halt } 
  hadd -m c1 $address($nick,2) $iif($len($2) == 2,$2,$+(0,$2)) 
  hadd -m c2 $address($nick,2) $iif($len($3) == 2,$3,$+(0,$3)) 
  notice $nick $c1($nick,Your default colors are set to:) $+($chr(3),$hget(c1, $address($nick,2)),$hget(c1, $address($nick,2))) $c1($nick,and) $+($chr(3),$hget(c2, $address($nick,2)),$hget(c2, $address($nick,2)))  
  hsave c1 c1.tXt 
  hsave c2 c2.txt 
} 
alias c1 { 
  var %strip = $strip($2-) 
  var %color = $iif($hget(c1, $address($1,2)),$v1,07) 
  return $+($chr(3),%color,%strip) 
} 
alias c2 { 
  var %strip = $strip($2-) 
  var %color = $iif($hget(c2, $address($1,2)),$v1,14) 
  return $+($chr(3),%color,%strip) 
} 
on $*:TEXT:/^[!@](rs)?stats/Si:#:{ 
  var %name = $iif($2,$replace($2-,$chr(32),$chr(95)),$iif($hget(defname, $address($nick,2)),$v1,$nick)) 
  var %x 1 
  if ($hget(runescapelevel,%x)) { hdel runescapelevel %x }
  while ($sock(Runescapestats. $+ %x)) { 
    inc %x 
  }  
  sockopen $+(Runescapestats.,%x) hiscore.runescape.com 80 
  sockmark $+(Runescapestats.,%x) $+($iif($left($1,1) == !,notice $nick,msg $chan),~,%name,~,%x,~,$nick) 
} 
on *:sockopen:Runescapestats.*:{ 
  sockwrite -nt $sockname GET $+(/index_lite.ws?player=,$gettok($sock($sockname).mark,2,126)) HTTP/1.1 
  sockwrite -nt $sockname Host: hiscore.runescape.com 
  sockwrite -nt $sockname $crlf 
} 
on *:SOCKREAD:Runescapestats.*:{ 
  tokenize 126 $sock($sockname).mark 
  if ($sockerr) { $1 $c1($4,Socket error $+ $chr(44)) $c2($4,please try again) | sockclose $sockname } 
  else { 
    var %read 
    sockread %read 
    if (*<html><head><title>404 - Page not found</title></head>* iswm %read) { $1 $c1($4,*** $chr(91)) $c2($4,$upper(stats)) $c1($4,$chr(93)) $c2($4,$+($2,'s)) $c1($4,stats could not be found) | sockclose $sockname } 
    if (*,*,* iswm %read) { 
      hadd -m runescapelevel $3 $iif($hget(runescapelevel, $3),$+($v1,~)) $+ $gettok(%read,2,44) 
      if ($count($hget(runescapelevel, $3),$chr(126)) == 24) { 
        sockclose $sockname 
        $1 $c1($4,$chr(91)) $c2($4,$upper(stats)) $c1($4,$chr(93)) $+ : $c1($4,for:) $c2($4,$2) $c1($4,$chr(91) Overall:) $c2($4,$gettok($hget(runescapelevel, $3),1,126))  $c1($4,$chr(93))
        $1 $levels1($3,$4) 
        $1 $levels2($3,$4) 
      } 
    } 
  } 
} 
alias levels1 { 
  var %att = $gettok($hget(runescapelevel, $1),2,126) 
  var %def = $gettok($hget(runescapelevel, $1),3,126) 
  var %str = $gettok($hget(runescapelevel, $1),4,126) 
  var %hp = $gettok($hget(runescapelevel, $1),5,126) 
  var %range = $gettok($hget(runescapelevel, $1),6,126) 
  var %pray = $gettok($hget(runescapelevel, $1),7,126) 
  var %mage = $gettok($hget(runescapelevel, $1),8,126) 
  var %cook = $gettok($hget(runescapelevel, $1),9,126) 
  var %wc = $gettok($hget(runescapelevel, $1),10,126) 
  var %fletch = $gettok($hget(runescapelevel, $1),11,126) 
  var %fish = $gettok($hget(runescapelevel, $1),12,126) 
  return $replace($c1($2,Attack:) $c2($2,%att) $c1($2,Defence:) $c2($2,%def) $c1($2,Strength:) $c2($2,%str) $c1($2,Hitpoints:) $c2($2,%hp) $& 
    $c1($2,Ranged:) $c2($2,%range) $c1($2,Prayer:) $c2($2,%pray) $c1($2,Magic:) $c2($2,%mage) $c1($2,Cooking:) $c2($2,%cook) $c1($2,Woodcutting:) $c2($2,%wc) $& 
    $c1($2,Fletching:) $c2($2,%fletch) $c1($2,Fishing:) $c2($2,%fish),-1,0) 
} 
alias levels2 { 
  var %fm = $gettok($hget(runescapelevel, $1),13,126) 
  var %craft = $gettok($hget(runescapelevel, $1),14,126) 
  var %smith = $gettok($hget(runescapelevel, $1),15,126) 
  var %mining = $gettok($hget(runescapelevel, $1),16,126) 
  var %herb = $gettok($hget(runescapelevel, $1),17,126) 
  var %agil = $gettok($hget(runescapelevel, $1),18,126) 
  var %thiev = $gettok($hget(runescapelevel, $1),19,126) 
  var %slay = $gettok($hget(runescapelevel, $1),20,126) 
  var %farm = $gettok($hget(runescapelevel, $1),21,126) 
  var %rc = $gettok($hget(runescapelevel, $1),22,126) 
  var %hunt = $gettok($hget(runescapelevel, $1),23,126) 
  var %con = $gettok($hget(runescapelevel, $1),24,126) 
  var %summ = $gettok($hget(runescapelevel, $1),25,126) 
  return $replace($c1($2,Firemaking:) $c2($2,%fm) $c1($2,Crafting:) $c2($2,%craft) $c1($2,Smithing:) $c2($2,%smith) $c1($2,Mining:) $c2($2,%mining) $& 
    $c1($2,Herblore:) $c2($2,%herb) $c1($2,Agility:) $c2($2,%agil) $c1($2,Thieving:) $c2($2,%thiev) $c1($2,Slayer:) $c2($2,%slay) $c1($2,Farming:) $c2($2,%farm) $& 
    $c1($2,Runecraft:) $c2($2,%rc) $c1($2,Hunter:) $c2($2,%hunt) $c1($2,Construction:) $c2($2,%con) $c1($2,Summoning:) $c2($2,%summ),-1,0) 
} 
on $*:TEXT:/^[!@](set)?(def|set)name/si:#:{ 
  var %way = $iif($left($1,1) == !,notice $nick,msg $chan) 
  if (!$2) { notice $nick $colors(DEFNAME) $c1($nick,I need a) $c2($nick,nick) | halt } 
  if ($hacked($1-)) { notice $nick $hackedd | halt } 
  if ($len($2-) > 13) { notice $Nick $colors(DEFNAME) $c2($nick,$2) $c1($nick,is not a) $c2($nick,runescape name) | HALT } 
  .who $nick 
  hadd defname $address($nick,2) $2- 
  %way $colors(DEFNAME) $c1($nick,Your default) $c2($nick,runescape name) $c1($nick,for address) $c2($nick,$address($nick,2)) $c1($nick,has been set to) $c2($nick,$2-) 
  hsave defname hashtables.txt 
} 
on $*:TEXT:/^[!@](rsn|runescapename)\b/si:#:{ 
  .who $nick 
  if ($hacked($1-)) { notice $nick $hackedd | halt } 
  var %way = $iif($left($1,1) == !,notice $nick,msg $chan) 
  var %nick = $iif($2,$2-,$nick) 
  %way $colors(RUNESCAPE NAME) $iif($hget(defname, $address(%nick,2)),$c1($nick,The rsn for) $c2($nick,%nick) $c1($nick,is) $c2($nick,$v1),$c1($nick,I don't know the rsn for) $c2($nick,%nick)) 
} 
on *:CONNECT:{ 
  hmake defname 
  hmake c1 
  hmake c2 
  hload defname hashtables.txt 
  hload c1 c1.txt 
  hload c2 c2.txt 
}


on $*:TEXT:/^[!@]weather/Si:#: {
  inc %sc
  set %weatherplace $2 $+ $(%20,) $+ $3
  var %id WEATHER $+ %sc
  hadd -m %id send $iif(@* iswm $1,msg #,notice $nick)
  sockopen %id jerrcs.net 80
}
on *:SOCKOPEN:WEATHER*:{
  sockwrite -nt $sockname GET /weather.php?w= $+ %weatherplace HTTP/1.1
  sockwrite -nt $sockname Host: jerrcs.net
  sockwrite -nt $sockname $crlf
}

on *:SOCKREAD:WEATHER*:{
  var %weather
  sockread %weather 
  if (weather for isin %weather) {
    if (Temperature: F/C Humidity: isin %weather) { 
      $hget($sockname,send) Sorry your place couldnt be found please be more specific or check the spellings.
    }
    else {
    $hget($sockname,send) 4 $gettok(%weather,1-2,32) 11 $gettok(%weather,3-14,32) 4 $gettok(%weather,15,32) 11 $gettok(%weather,16,32) 4 $gettok(%weather,17,32) 11 $gettok(%weather,18,32) 4 $gettok(%weather,19-20,32) 11 $gettok(%weather,21-27,32) 4 $gettok(%weather,28,32) 11 $gettok(%weather,29-30,32) 4 $gettok(%weather,31,32) 11 $gettok(%weather,32,32)        }
  }
}


on $*:text:/^[@!]shop */iS:?,#: { 
  inc %sh 
  set $+(%,shopsexy.,%sh) $2- 
  set $+(%,shopway.,%sh) $iif($left($1,1) == @,msg #,notice $nick) 
  sockopen $+(SHOP.,%sh) www.stirk.org 80 
} 
on *:SOCKOPEN:SHOP*:{ 
  sockwrite -nt $sockname GET $(/parsers/shops.php?name= $+ $($+(%,shopsexy.,$gettok($sockname,2,46)),2) $+ &c1=07&c2=14,2) HTTP/1.1 
  sockwrite -nt $sockname Host: www.stirk.org 
  sockwrite -nt $sockname $crlf 
} 
on *:SOCKREAD:SHOP*:{ 
  var %shopread 
  sockread %shopread 
  var %strippedshopread $strip(%shopread) 
  if (*Shop Name* iswm %strippedshopread) { 
    $($+(%,shopway.,$gettok($sockname,2,46)),2) 7[14Shop7] %shopread 
  } 
  elseif (Shop not found isin %strippedshopread) { 
    $($+(%,shopway.,$gettok($sockname,2,46)),2) 7[14Shop7]14 Sorry, no results were found for:7 $($+(%,shopsexy.,$gettok($sockname,2,46)),2) $+ . 
  } 
} 


alias c1 return $+($chr(3),11,$1,$chr(3)) 
alias c2 return $+($chr(3),04,$1,$chr(3)) 


on $*:TEXT:/^[!@]world/Si:#:{ 
  inc %sc 
  set %world $2 
  var %id WORLD $+ %sc 
  hadd -m %id send $iif(@* iswm $1,msg #,notice $nick)
  if ($2 !isnum 1-144) { $iif($left($1,1) == @,msg $chan,notice $nick) Specify a number between 1-444 | halt }
  sockopen %id astralscript.org 80 
} 
on *:SOCKOPEN:WORLD*:{ 
  sockwrite -nt $sockname GET /bot/serv7.php?world= $+ %world HTTP/1.1 
  sockwrite -nt $sockname Host: astralscript.org 
  sockwrite -nt $sockname $crlf 
} 
on *:SOCKREAD:WORLD*:{ 
  var %world 
  sockread %world 
  if (World: isin %world) { 
    tokenize 124 $remove(%world,full) 
    $hget($sockname,send) $c2($1) $c1($2) $c2($3) $c1($4) $c1($5) $c2($6) $c1($7) $c2($8) $c2($9) $c1($10) $c2($11) $c1($12) $c1($13) $c2($14) $c1($15) $c2($16) 
  }
}


ON $*:TEXT:/^[@!.](famous)?quote/Si:#:{
  inc %sc 
  var %id JOKE $+ %sc 
  hadd -m %id send $iif(@* iswm $1,msg #,notice $nick) 
  sockopen %id www.quotability.com 80 
} 
on *:SOCKOPEN:JOKE*:{ 
  sockwrite -nt $sockname GET / HTTP/1.1 
  sockwrite -nt $sockname Host: www.quotability.com
  sockwrite -nt $sockname $crlf 
} 
on *:SOCKREAD:JOKE*:{ 
  var %joke 
  sockread %joke 
  if (<td><font face="Verdana" size="4"><strong><i>" isin %joke) {
    $hget($sockname,send) $remove(%joke,<td><font face="Verdana" size="4"><strong><i>",.")
  } 
} 


on $*:TEXT:/^[!@]urban/Si:#:{
  inc %sc
  set %urbanword $2
  var %id URBAN $+ %sc
  hadd -m %id send $iif(@* iswm $1,msg #,notice $nick)
  sockopen %id www.urbandictionary.com 80
}

on *:SOCKOPEN:URBAN*:{
  sockwrite -nt $sockname GET /define.php?term= $+ %urbanword HTTP/1.1
  sockwrite -nt $sockname Host: www.urbandictionary.com
  sockwrite -nt $sockname $crlf
}

on *:SOCKREAD:URBAN*:{
  var %urban
  sockread %urban
  if (*<p>*</p>* iswm %urban) {
    $hget($sockname,send) [URBAN] $c1(%urbanword) $c2($remove(%urban,</p>,<p>))
  }
}



on $*:TEXT:/^[!@.]herb/Si:#:{ 
  if (!$2) { notice $nick You must supply a herb to lookup }
  else {
    inc %sc 
    var %id = herb. $+ %sc 
    set $+(%,h.herb.,%sc) $2- 
    set $+(%,h.send.,%sc) $iif($left($1,1) == @,msg $chan,notice $nick)
    sockopen %id tip.it 80 
  }
} 

on *:SOCKOPEN:HERB.*:{ 
  sockwrite -n $sockname GET /runescape/?page=herblore_guide.htm#pots HTTP/1.1 
  sockwrite -n $sockname Host: tip.it 
  sockwrite -n $sockname $+($crlf,$crlf) 
} 
on *:SOCKREAD:HERB.*:{ 
  var %var, %id = $gettok($sockname,2,46)
  sockread %var 
  if ($sock($sockname).mark == continue) {
    if (!$($+(%,h.name.,%id),2)) { set $+(%,h.name.,%id) $nohtml(%var) }
    elseif (!$($+(%,h.lvl.,%id),2)) { set $+(%,h.lvl.,%id) $nohtml(%var) }
    elseif (!$($+(%,h.exp.,%id),2)) { set $+(%,h.exp.,%id) $nohtml(%var) }
    else {
      sockmark $sockname
      $($+(%,h.send.,%id),2) $c1(The herb) $c2($($+(%,h.name.,%id),2)) $c1(requires level) $c2($($+(%,h.lvl.,%id),2)) $c1(and gives) $c2($($+(%,h.exp.,%id),2)) $c1(xp)
      unset %h.*
      sockclose $sockname
    }
  }
  if (*<td class="members"><img src="item2/*.gif" width="40" height="40" alt=" $+ $($+(%,h.herb.,%id),2) $+ " /></td>* iswm %var) { sockmark $sockname continue }
  if (*</html* iswm %var) {
    $($+(%,h.send.,%id),2) $c1(No results found for) $c2($qt($($+(%,h.herb.,%id),2)))
    unset %h.*
    sockclose $sockname
  }
}
alias -l nohtml { return $remove($regsubex($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null),&nbsp;,$chr(09)) }

on $*:TEXT:/^[!@]rsplayers/Si:#: {
  inc %sc
  var %id RUNESCAPE $+ %sc
  hadd -m %id send $iif(@* iswm $1,msg #,notice $nick)
  sockopen %id runescape.com 80
}
on *:SOCKOPEN:RUNESCAPE*:{
  sockwrite -nt $sockname GET /lang/en/aff/runescape/title.ws HTTP/1.1
  sockwrite -nt $sockname Host: runescape.com
  sockwrite -nt $sockname $crlf
}

on *:SOCKREAD:RUNESCAPE*:{
  var %runescape
  sockread %runescape
  if (There are currently * people playing!* iswm %runescape) { 
    $hget($sockname,send) $c1($gettok(%runescape,1-3,32)) $c2($gettok(%runescape,4,32)) $c1($gettok(%runescape,5-7,32))
  }
}

on $*:TEXT:/^[!@]potion/Si:#: {
  if ($2 == $null) {
    $iif($left($1,1) == @,msg $chan,notice $nick) *** [Error]: Enter a potion name.
  }
  else {
    var %x = $calc($sock(potion.*,0) +1)
    sockopen $+(potion.,%x) tip.it 80
    sockmark $+(potion.,%x) $iif($left($1,1) == @,msg $chan,notice $nick) $+ $chr(64) $+ $2- $+ @0@1@4Potion10
  }
}

on *:SOCKOPEN:potion.*: {
  sockwrite -n $sockname GET /runescape/index.php?page=herblore_guide.htm HTTP/1.1
  sockwrite -n $sockname Host: tip.it
  sockwrite -n $sockname $crlf
}

on *:SOCKREAD:potion.*: {
  sockread %read
  var %infos = First Ingredient@Second Ingredient@Experience@effect
  var %n
  var %c
  set $+(%,old.,$sockname) %read
  if ($sockerr != 0) return
  while ($sockbr) {
    %c = $gettok($sock($sockname).mark,3,64)
    %n = $gettok($sock($sockname).mark,4,64)
    if ($+(*<br />,$gettok($sock($sockname).mark,2,64),*) iswm %read) {
      sockmark $sockname $puttok($sock($sockname).mark,1,3,64)
      sockmark $sockname $sock($sockname).mark $htmlfree(%read) $+ : 4Level:10 $htmlfree($($+(%,old.,$sockname),2))
    }
    else if (%c && %n <= $numtok(%infos,64)) {
      if (*<td>* iswm %read) {
        sockmark $sockname $sock($sockname).mark 4 $+ $gettok(%infos,%n,64) $+ :10 $htmlfree(%read) 
        if (*</td>* iswm %read) {
          sockmark $sockname $puttok($sock($sockname).mark,$calc(%n +1),4,64)
        }
      }
      else {
        sockmark $sockname $sock($sockname).mark and $htmlfree(%read)
        if (*</td>* iswm %read) {
          sockmark $sockname $puttok($sock($sockname).mark,$calc(%n +1),4,64)
        }
      }
    }
    %n = $gettok($sock($sockname).mark,4,64)
    if (%n > $numtok(%infos,64)) {
      $gettok($sock($sockname).mark,1,64) $gettok($sock($sockname).mark,5-,64)
      unset $+(%,old.,$sockname)
      sockclose $sockname
      return
    }
    set $+(%,old.,$sockname) %read
    sockread %read
  }
}

alias -l htmlfree {
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
  return %x
} 

on $*:TEXT:/^[!@.](rs)?price/Si:*: {
  if ($1 == $me $+ ,) tokenize 32 $strip($2-)
  if ($left($strip($1),1) == @) && ($chan == #stats) { halt }
  inc %id 1
  while ($sock($+(price.,%id))) inc %id 1
  hadd -m price $+(real.,%id) $2-
  hadd -m price $+(target.,%id) $replace($2-,$chr(32),$chr(37) $+ 20)
  hadd -m price $+(return.,%id) $iif($left($1,1) == @,msg $chan,notice $nick)
  sockopen $+(price.,%id) www.zybez.net 80
}
on *:SOCKOPEN:price.*:{
  var %id = $gettok($sockname,2,46)
  sockwrite -nt $sockname GET /priceguide.php?search_terms= $+ $hget(price,$($+(target.,%id),2)) $+ &search_area=1&price_low=&price_high=&member=1 HTTP/1.1
  sockwrite -nt $sockname Host: www.zybez.net $+ $str($crlf,2)
}
on *:SOCKREAD:price.*:{
  var %id = $gettok($sockname,2,46)
  if ($sockerr) { echo -a Error. | halt }
  var %read
  sockread %read
  if (*Your search did not return any results.* iswm %read) {
    $hget(price,$($+(return.,%id),2)) $c1(my search did not return) $c2(" $+ $hget(price,$($+(real.,%id),2)) $+ ") $c1(please make sure) $c2(" $+ $hget(price,$($+(real.,%id),2)) $+ ") $c1(is actually a tradeable runescape item.)
    sockclose $sockname
    halt
  }
  if ($regex(mem,%read,/^<td><img(.*)></td>$/Si)) {
    inc $+(%,m.,%id)
    hadd -m price $+(members.,$($+(%,m.,%id),2),.,%id) true
  }
  if ($regex(name,%read,/^<td>([^0-9]*)<\/td>$/Si)) {
    if ($htmlfree($regml(name,1)) != $null && $htmlfree($regml(name,1)) != $chr(32)) {
      inc $+(%,q.,%id)
      inc $+(%,n.,%id)
      hadd -m price 
      $+(name.,$($+(%,n.,%id),2),.,%id) $htmlfree($regml(name,1))       
    }
  }
  if ($regex(price,%read,/^<td>(.*)-(.*)</td>$/Si)) {
    inc $+(%,p.,%id)
    hadd -m price $+(price.,$($+(%,p.,%id),2),.,%id) $htmlfree($regml(price,1) - $regml(price,2))
  }
  if ($regex(cat,%read,/^<td>(.*)</a></td></tr>$/Si)) {
    inc $+(%,c.,%id)
    hadd -m price $+(cat.,$($+(%,c.,%id),2),.,%id) $htmlfree($regml(cat,1))
    if ($($+(%,q.,%id),2) > 5) {
      $hget(price,$($+(return.,%id),2)) $c1(your search for) $c2(" $+ $hget(price,$($+(real.,%id),2)) $+ ") $c1(showed more then) $c2(5) $c1(results. try making your search more specific.)
      sockclose $sockname
    }
    if ($($+(%,q.,%id),2) <= 5) {
      $hget(price,$($+(return.,%id),2)) $c2($($+(%,q.,%id),2)) $+ $c1(:) $iif($hget(price,$($+(members.,$($+(%,m.,%id),2),.,%id),2)) == true,$+($c1($chr(91)),$c3(M),$c1($chr(93)))) $c2($hget(price,$($+(name.,$($+(%,n.,%id),2),.,%id),2))) $c1(Price:) $c2($hget(price,$($+(price.,$($+(%,p.,%id),2),.,%id),2))) $c1(Category:) $c2($hget(price,$($+(cat.,$($+(%,c.,%id),2),.,%id),2)))
      .timer 1 1 sockclose $sockname
      .timer 1 1 unset $+(%,*.,%id)
    }
  }
}

on $*:TEXT:/^[!@]commands/Si:#:{ 
  notice $nick !price
  notice $nick !weather
  notice $nick !shop 
  notice $nick !weather
  notice $nick !quote
  notice $nick !rsplayers
  notice $nick !herb
  notice $nick !potion
  notice $nick !quote
  notice $nick !setgreet greet here
  notice $nick !greet on - turn greets on
  notice $nick !greet off - turn greets off
  notice $nick !stats nick
  notice $nick !defname rsn
  noticE $nick !mycolours 1 2 will make my colours black and dark blue
  notice $nick !addadmin if you are op in $homechan
  notice $nick !deladmin if you are op in $homechan
  noticE $nick !blist chan - blacklist an chan
  notice $nick !unblist chan - unblacklist an chan
  notice $nick !say - if you are an admin you can say whatever you want with the bot
  notice $nick !amsg - amsg anything with the bots name
}

on $*:TEXT:/^[!@]setgreet/Si:#:{ 
  writeini greet.ini greet $nick $2-
  notice $nick $c1(Your greet has been set to) $c2($2-)
}

on $*:TEXT:/^[!@]greet/Si:#:{ 
  if ($2 == on) {
    set %greet [ $+ [ $chan ] ] on
    msg $chan $c1(Greets for) $c2($chan) $c1(is now on)
  }
  elseif ($2 == off) {
    unset %greet [ $+ [ $chan ] ] 
    msg $chan $c1(Greets for) $c2($chan) $c1(is now off)
  }
}
on *:JOIN:#:{
  if (%greet [ $+ [ $chan ] ] == on)
  msg $chan $c1(The greet for) $c2($nick) $c1(is) $c2($readini(greet.ini,greet,$nick) 
}

on *:INVITE:#: {
  if ($chan(0) >= 30) {
    notice $nick $c2($nick,I am currently full, please try again later.)
    halt
  }
  else { 
    join $chan
    timer 1 2 msg $chan $c1(Hi, i am) $c2($me) $+ $c1(.) $c1(Please do) $c2(!commands) $c1(to view my commands)
    msg $homechan $c1(I have been invited to) $c2($chan) $c1(and i joined)
  }
  elseif $readini,kick.ini,kick,$chan >= 5 {
    join $chan
    timer 1 2 part $chan $c1(Your channel has been blacklsited for) $c2(5 kicks) $c1(Please memo) $c2($me) $c1(or talk to my owners in) $c2($homechan)
    msg $homechan $c1(I have parted $chan because they have been blacklised for the reason of) $c2(5 kicks) 
  }
}


on *:KICK:#:{
  if ($knick == $me) {
    inc %a [ $+ [ $chan ] ] 
    writeini kick.ini kick $chan %a [ $+ [ $chan ] ] 
    notice $nick Your channel has been kicked $readini(kick.ini,kick,$chan) $+ /5
  }
}

on $*:TEXT:/^[!@]addadmin/Si:#:{ 
  if ($nick isop $homechan) {
    writeini admin.ini admin $2
    msg $chan $c2($2) $c1(is now an admin of) $c2($me)
  }
}

on $*:TEXT:/^[!@]deladmin/Si:#:{ 
  if (!$2) { 
    notice $nick $c1(You must supply an nick)
    halt
  }
  elseif ($nick isop $homechan) {
    remini admin.ini admin $2 
    notice $nick $c1(You are now not my staff!)
    msg $homechan $c2($2) $c1(isn't my staff now!)
  }
}

on $*:TEXT:/^[!@]blist/Si:#:{ 
  if (!$2) { 
    notice $nick $c1(You must supply an chan)
    halt
  }
  else {
    writeini kick.ini kick $2 5
    msg $chan $c2($2) $c1(has now been blacklisted)
  }
}

on $*:TEXT:/^[!@]unblist/Si:#:{ 
  if (!$2) { 
    notice $nick $c1(You must supply an chan)
    halt
  }
  else {
    writeini kick.ini kick $2 5
    msg $chan $c2($2) $c1(has now been unblacklisted)
  }
}

on $*:TEXT:/^[!@]say/Si:#:{ 
  if ($readini,admin.ini,admin,$nick) {
    /msg $2 $3-
  }
  else { notice $nick $c1(You aren't one of my admins)
  }
}

on $*:TEXT:/^[!@]amsg/Si:#:{ 
  if ($readini,admin.ini,admin,$nick) {
    /amsg $2-
  }
  else { notice $nick $c1(You aren't one of my admins)
  }
}