All pastes #69490 Raw Edit

Unnamed

public text v1 · immutable
#69490 ·published 2006-06-23 00:46 UTC
rendered paste body
on *:TEXT:.item*:#:{
%item = $2-
if ($readini(items.ini,%item,hs) != $null) {
%id = $readini(items.ini,%item,id)
%hsell = $readini(items.ini,$2-,hs)
%lsell = $int($calc($calc(2 * %hsell) / 3))
%hbuy = $int($calc($calc(5 * %hsell) / 3))
%lbuy = $int($calc(3.175 * %lsell))
%pprice = $readini(items.ini,%item,p)
/notice $nick 3Item:12 %item || 3ID:12 %id || 3Sell Prices: 10{HiAlch}12 %hsell gp 10{GenStore/LoAlch}12 %lsell gp || 3Buy Prices: 10{SpecShop}12 %hbuy gp 10{GenStore}12 %lbuy gp || 3Player Price:12 %pprice gp
/unset %item
/unset %id
/unset %hsell
/unset %lsell
/unset %hbuy
/unset %lbuy
/unset %pprice
}
else {
/notice $nick Item was not found, sorry. Please try again under a different name.
} 
}

on *:TEXT:.additem*:#:{
%item = $4-
if ($2 != help) {
if ($4) {
if ($readini(items.ini,%item,id)) {
%lastsection = $ini(items.ini,0)
%lastname = $ini(items.ini,%lastsection)
%id = $readini(items.ini,%lastname,id)
/inc %id 1
%item = $4-
%hsell = $2
%pprice = $3
/msg $chan %item
/writeini items.ini $+(",%item,") id %id
/writeini items.ini $+(",%item,") hs %hsell
/writeini items.ini $+(",%item,") p %pprice
/writeini itemadds.ini $+(",%item,") adder $nick
/writeini itemadds.ini $+(",%item,") id %id
/writeini itemadds.ini $+(",%item,") HiAlch %hsell
/writeini itemadds.ini $+(",%item,") PPrice %pprice
/notice $nick Item added successfully. Remember all entries will be verified so please don't abuse this.
}
else {
%lastsection = $ini(items.ini,0)
%lastname = $ini(items.ini,%lastsection)
%id = $readini(items.ini,%item,id)
%item = $4-
%hsell = $2
%pprice = $3
/msg $chan %item
/writeini items.ini $+(",%item,") hs %hsell
/writeini items.ini $+(",%item,") p %pprice
/writeini itemadds.ini $+(",%item,") adder $nick
/writeini itemadds.ini $+(",%item,") id %id
/writeini itemadds.ini $+(",%item,") HiAlch %hsell
/writeini itemadds.ini $+(",%item,") PPrice %pprice
/notice $nick Item added successfully. Remember all entries will be verified so please don't abuse this.
}
}
}
else {
/notice $nick Format for adding items is ".additem <HiAlch Price> <Player Price> <Item Name>"
/notice $nick Remember to LEAVE OUT THE BRACKETS, the < > things.  Player price is the price people pay other players for the item.
/notice $nick Please do not fool around with this command. It is a privilege. Abuse it and you lose it.  All entries will be verified.
}