All pastes #710013 Raw Edit

Stuff

public text v1 · immutable
#710013 ·published 2007-09-25 04:21 UTC
rendered paste body
ON $*:TEXT:/[@!](category|price)/Si:#market: {
  var %send $iif($left($1,1) == @,msg $chan,notice $nick)
  if ($read(Prices.txt,wn,* $+ $2 $+ *)) {
    %send $+($chr(91),PRICE,$chr(93)) Item: $ifmatch
  }
}

ON $*:TEXT:/[@!](add|del)/Si:#: {
  if ($nick isop $chan) {
    if ($2) {
      if ($right($1,-1) == add) {
        if ($read(Prices.txt,w,* $+ $2 $+ *)) {
          write $+(-ol,$readn) Prices.txt $2-
          ;write $+(-ol,$readn) Prices.txt $regsubex($ifmatch,/(.+) ?- ?(.+)/Si,\1) - $regsubex($2-,/- ?(.+)/Si,\1)
          notice $nick Appended $qt($2-) within the prices database.
        }
        else {
          write Prices.txt $2-
          notice $nick Added $qt($2-) to the prices database.
        }
      }
      if ($right($1,-1) == del) {
        if ($read(prices.txt,wn,* $+ $2 $+ *)) {
          write $+(-dl,$readn) Prices.txt
          notice $nick Deleted line $2- (Line Number: $qt($readn) $+ )
        }
      }
    }
  }
}