All pastes #455234 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-04-24 02:19 UTC
rendered paste body
on *:text:!vall:#:{ 
  if ($nick isop $chan || $nick ishop $chan) { 
    unset %vCount 
    unset %vUser  
    var %i = 0 
    while (%i < $nick($chan,0)) { 
      inc %i 
      if (($me ishop $chan || $me isop $chan) && ($Nick($chan,%i) isreg $chan)) { 
        set %vCount %vcount $+ v 
        set %vUser %vUser $nick($chan,%i) 
      } 
      mode $chan + $+ %vcount %vuser 
    } 
  }
}
on 1:JOIN:#Chan:{
  if ($readini(aov.ini,$nick,aov) == $address($nick,2)) { mode $chan +v $nick }
}
on 1:TEXT:!aov*:#*:{
  if ($nick isop $chan) || ($nick ishop $chan)
  { writeini aov.ini $2 aov $address($2,2) | msg $chan Added $2 to Auto Voice List }
  kick $chan $2 Kewl, Join $chan please, $nick gave you Voice =D
  else { 
    notice $nick I'm sorry, but you can not use this command because you're not an op on $chan $+ . 
  } 
}
if ($readini(aov.ini,$nick,aov) == $address($nick,2)) { mode $chan +v $nick }
}
on 1:TEXT:!delav*:#:{
if ($nick isop $chan) || ($nick ishop $chan) { remini aov.ini $2 | msg $chan Removed $2 From Auto Voice List }
kick $chan $2 sorry, Join #thepc please, $nick removed your Voice =P
else { 
  notice $nick I'm sorry, but you can not use this command because you're not an op on $chan $+ . 
}
on $*:TEXT:/^[!@](cash|price(check)?|gold)/Si:#:{ 
  if (!$2) { notice $nick *** [Price Guide]: You must supply a item - !price <item> } 
  else { 
    inc %id 
    set $+(%,price.item.,%id) $replace($2-,$chr(32),$chr(37) $+ 20) 
    set $+(%,price.style.,%id) $iif($left($1,1) == @,msg $chan,notice $nick) *** [Price Guide]: 
    sockopen $+(price.,%id) zybez.net 80 
  } 
} 
on *:SOCKOPEN:price.*:{ 
  var %id = $gettok($sockname,2,46) 
  sockwrite -nt $sockname GET /priceguide.php?search_terms= $+ $($+(%,price.item.,%id),2) $+ &search_area=1&price_low=&price_high=&member=1 HTTP/1.1 
  sockwrite -nt $sockname Host: www.zybez.net 
  sockwrite -nt $sockname $+($crlf,$crlf) 
} 
on *:SOCKREAD:price.*:{ 
  var %id = $gettok($sockname,2,46) 
  var %style = $($+(%,price.style.,%id),2), $& 
    %item = $replace($($+(%,price.item.,%id),2),$chr(37) $+ 20,$chr(32)) 
  if ($sockerr) { 
    %style An error occured while connecting 
    unset $+(%,price.*) 
    sockclose $+(price.,%id) 
  } 
  else { 
    var %read 
    sockread %read 

    if (*<td class="tablebottom" colspan="5">Your search did not return any results. Please make sure your spelling is correct and that you are typing full words.</td>* iswm %read) { 
      %style No results were found for " $+ %item $+ " 
      unset $+(%,price.*.,%id) 
      sockclose $+(price.,%id) 
    } 
    if (*<!--name--><td class='tablebottom'>*</td>* iswm %read) { 
      tokenize 32 $nohtml(%read) 
      set $+(%,price.name.,%id) $1- 
    } 
    if (*<!--price--><td class="tablebottom">*</td>* iswm %read) { 
      tokenize 32 $nohtml(%read) 
      set $+(%,price.price.,%id) $1- 
    } 
    if (*<td class="tablebottom"><a href="/priceguide.php?category=*">*</a></td>* iswm %read) { 
      tokenize 32 $nohtml(%read) 
      inc $+(%,price.times.,%id) 
      if ($($+(%,price.times.,%id),2) == 6) { 
        %style Max results of 5 allowed. Try making your search for " $+ %item $+ " more specific. 
        unset $+(%,price.*.,%id)  
        sockclose $+(price.,%id) 
      } 
      elseif ($($+(%,price.times.,%id),2) <= 5) { 
        %style Item - $($+(%,price.name.,%id),2) Price - $($+(%,price.price.,%id),2) Category - $1- 
        unset $+(%,price.name.,%id) 
        unset $+(%,price.price.,%id) 
      } 
    } 
    if (*</html>* iswm %read) { 
      unset $+(%,price.*.,%id) 
      sockclose $+(price.,%id) 
    } 
  } 
} 
alias -l nohtml { 
  var %x,%i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x) 
  %x = $replace(%x,&nbsp;,$null) 
  return %x 
}

on *:text:!dvall:#:{ 
  if ($nick isop $chan || $nick ishop $chan) { 
    unset %vCount 
    unset %vUser  
    var %i = 0 
    while (%i < $nick($chan,0)) { 
      inc %i 
      if (($me ishop $chan || $me isop $chan) && ($Nick($chan,%i) isvoice $chan)) { 
        set %vCount %vcount $+ v 
        set %vUser %vUser $nick($chan,%i) 
      } 
    } 
    mode $chan - $+ %vcount %vuser 
  } 
}
on *:TEXT:!lotto*:#:{ 
  /msg $chan $rand(1,$2) $rand(1,$2) $rand(1,$2) $rand(1,$2) $rand(1,$2) $rand(1,$2)13 $rand(1,$2)
}