mIRC Homepage
Posted By: Cred Bought / Sell / Count Script - 28/09/08 07:20 PM
on $1:TEXT:/^!bought \d+$/iS:#private-merch:

Problem:
I got stuck from here when oliver told me its the middle part of the script i need and i need to start with variables.

Purpose:
I have a merching team and i want to be able to know how much of an item my team ahd bought. So when they type !bought 10000 or !bought 107 it will add it together and it will say how many in total are bought when you type @bought. Also i would like it to be able to take away some of the items when a member types !sold 1000 or !sold 894.

If you could help me i would realy apreciate it thanks.
Posted By: RusselB Re: Bought / Sell / Count Script - 28/09/08 08:01 PM
Code:
on *:text:!bought &:#private-merch:{
  if $$2 !isnum {    .notice $nick Usage: !bought <number>  }
  else inc %bought $$2
}
on *:text:!sold &:#private-merch:{
  if $$2 !isnum {    .notice $nick Usage: !sold <number>  }
  else inc %sold $$2
}
on *:text:@bought:#private-merch:{
  .notice $nick %bought bought, %sold sold, $calc(%bought - %sold) in stock
}
© mIRC Discussion Forums