Esano2010-07-22 11:20:30
Fairly simple trigger I nevertheless find useful. This will calculate the approximate cost to create a particular item, based upon the commodity costs in the trigger file. Doesn't take into account cook's bonuses or similar things: this is per batch.
NOTE: An improved version of this is now available here for a small fee. I will not be taking down this script - but I do advise you to look at the new one!
    enabled="y"
  keep_evaluating="y"
  match="^Commodities: (.*?)\\s*$"
  regexp="y"
  send_to="12"
  sequence="100"
  >
 Âcomms = { = 108,
= 116,
= 95,
= 20,
= 15,
= 87,
= 37,
= 70,
= 37,
= 162,
= 80,
= 50,
= 39,
= 15,
= 90,
= 10,
= 12,
= 14,
= 20,
= 13,
= 12,
= 35,
= 35,
= 35,
= 35,
= 35,
= 35,
= 35,
= 35,
= 35,
= 35,
= 35,
= 35,
= 35 }
commtable = null
commtable = {}
commlist = string.gsub("%1", "Â Â ", " ")
nextcomm = commlist
commnum = 0
cost = 0
unknown = null
while (commnum) do
  commnum = commnum + 1
  curcomm = string.sub(commlist, commnum, string.find(commlist, " ", commnum, false))
  curcomm = string.gsub(curcomm, " ", "")
  commnum = string.find(commlist," ",commnum,false) + 1
  curcount = string.sub(commlist, commnum, string.find(commlist, " ", commnum, false))
  curcount = string.gsub(curcount, " ", "")
  curcount = tonumber(curcount)
  if comms then
      cost = cost + comms * curcount
  else
      Note("Unknown commodity : "..curcomm.." used "..curcount.." times.")
  end
  commnum = string.find(commlist," ",commnum,false)
end
Note("Estimated production cost: "..cost.." gp.")
 Â
It comes out to look like
It has not been rigorously tested.
To change the commodity pricing, just find the trigger and edit the table in there.
And now, for those not using Lua in their main world, a plugin'd version. Not quite so easy to edit the comm prices on.
NOTE: An improved version of this is now available here for a small fee. I will not be taking down this script - but I do advise you to look at the new one!
CODE
 Â
  keep_evaluating="y"
  match="^Commodities: (.*?)\\s*$"
  regexp="y"
  send_to="12"
  sequence="100"
  >
 Â
= 116,
= 95,
= 20,
= 15,
= 87,
= 37,
= 70,
= 37,
= 162,
= 80,
= 50,
= 39,
= 15,
= 90,
= 10,
= 12,
= 14,
= 20,
= 13,
= 12,
= 35,
= 35,
= 35,
= 35,
= 35,
= 35,
= 35,
= 35,
= 35,
= 35,
= 35,
= 35,
= 35 }
commtable = null
commtable = {}
commlist = string.gsub("%1", "Â Â ", " ")
nextcomm = commlist
commnum = 0
cost = 0
unknown = null
while (commnum) do
  commnum = commnum + 1
  curcomm = string.sub(commlist, commnum, string.find(commlist, " ", commnum, false))
  curcomm = string.gsub(curcomm, " ", "")
  commnum = string.find(commlist," ",commnum,false) + 1
  curcount = string.sub(commlist, commnum, string.find(commlist, " ", commnum, false))
  curcount = string.gsub(curcount, " ", "")
  curcount = tonumber(curcount)
  if comms then
      cost = cost + comms * curcount
  else
      Note("Unknown commodity : "..curcomm.." used "..curcount.." times.")
  end
  commnum = string.find(commlist," ",commnum,false)
end
Note("Estimated production cost: "..cost.." gp.")
 Â
It comes out to look like
CODE
You carefully study a tailoring pattern.
Item: Robes  Type: Greatrobes  Org: Public
Commodities: silk 78 leather 26 pigeon 15 gold 6
Unknown commodity : pigeon used 15 times.
Estimated production cost: 7960 gp.
Mortal Reviews: Allowed
Item: Robes  Type: Greatrobes  Org: Public
Commodities: silk 78 leather 26 pigeon 15 gold 6
Unknown commodity : pigeon used 15 times.
Estimated production cost: 7960 gp.
Mortal Reviews: Allowed
It has not been rigorously tested.
To change the commodity pricing, just find the trigger and edit the table in there.
And now, for those not using Lua in their main world, a plugin'd version. Not quite so easy to edit the comm prices on.
Diamondais2010-07-22 11:27:06
Maybe I missed it, but what client is this for?
Unknown2010-07-22 11:39:39
That would be MUSHclient.
Rika2010-07-22 11:55:59
Missed out beryl.
Nariah2010-07-22 12:13:10
Make this for Zmud!
Esano2010-07-22 12:24:55
QUOTE (rika @ Jul 22 2010, 09:55 PM) <{POST_SNAPBACK}>
Missed out beryl.
Fixed!
QUOTE (Nariah @ Jul 22 2010, 10:13 PM) <{POST_SNAPBACK}>
Make this for Zmud!
It's been a while since I've worked with zmud, sorry. Feel free to hand the script off to someone else to convert!
Calixa2010-07-22 12:44:07
I like! *imports*
You could probably make it a tad more fancier -- if it is possible -- by having it auto-update pricings at the comm shop. Or read prices from your favourite (aether)shop.
You could probably make it a tad more fancier -- if it is possible -- by having it auto-update pricings at the comm shop. Or read prices from your favourite (aether)shop.
Esano2010-07-22 13:05:07
I could! And I might, if I have the time. At the time, I just wrote this off the fly and imported the prices from Mag's comm shop, as it was just for personal use in order to get my shop stocked (and appropriately priced).
Noola2010-07-22 13:11:04
Oooh! Something that makes me not have to do math!
Now, to figure out how to get it in my Mushclient! It's a trigger? I can copy it and then hit Sift+Ctl+8 and then Paste and it'll be in there?
Now, to figure out how to get it in my Mushclient! It's a trigger? I can copy it and then hit Sift+Ctl+8 and then Paste and it'll be in there?
Esano2010-07-22 13:13:35
QUOTE (Noola @ Jul 22 2010, 11:11 PM) <{POST_SNAPBACK}>
Oooh! Something that makes me not have to do math!
Now, to figure out how to get it in my Mushclient! It's a trigger? I can copy it and then hit Sift+Ctl+8 and then Paste and it'll be in there?
Now, to figure out how to get it in my Mushclient! It's a trigger? I can copy it and then hit Sift+Ctl+8 and then Paste and it'll be in there?
Yup!
Noola2010-07-22 13:19:14
QUOTE (Esano @ Jul 22 2010, 08:13 AM) <{POST_SNAPBACK}>
Yup!
And I like that I can go in and put the price for each commodity to be what I want. Cause, I like to add a few gold to the comm shop price for each commodity used in a design (that's my profit). So, like if a commodity is set to 65 in the comm shop, I'll charge 70 for it and so on. And it looks like it's pretty easy to add things to the list, right? I would just put:
= 10
In front of that last } bracket and add a comma behind beryl?
Diamondais2010-07-22 13:21:57
Hmm.. I'm getting this error:
I have badluck, all I did was paste it in.
CODE
Script error
World: Lusternia
Execution of line 1 column 9
Immediate execution
Invalid character
Line in error:
comms = { = 108,
World: Lusternia
Execution of line 1 column 9
Immediate execution
Invalid character
Line in error:
comms = { = 108,
I have badluck, all I did was paste it in.
Esano2010-07-22 13:29:32
QUOTE (Noola @ Jul 22 2010, 11:19 PM) <{POST_SNAPBACK}>
And I like that I can go in and put the price for each commodity to be what I want. Cause, I like to add a few gold to the comm shop price for each commodity used in a design (that's my profit). So, like if a commodity is set to 65 in the comm shop, I'll charge 70 for it and so on. And it looks like it's pretty easy to add things to the list, right? I would just put:
= 10
In front of that last } bracket and add a comma behind beryl?
= 10
In front of that last } bracket and add a comma behind beryl?
Yep! Just remember it has to be in all lower-case (as that's what the commodities are listed as in designs, if not in comm shops).
Noola2010-07-22 13:31:29
QUOTE (Esano @ Jul 22 2010, 08:29 AM) <{POST_SNAPBACK}>
Yep! Just remember it has to be in all lower-case (as that's what the commodities are listed as in designs, if not in comm shops).
Kewl!
Thanks, Esano! You're awesome!
Esano2010-07-22 13:37:08
QUOTE (diamondais @ Jul 22 2010, 11:21 PM) <{POST_SNAPBACK}>
Hmm.. I'm getting this error:
I have badluck, all I did was paste it in.
CODE
Script error
World: Lusternia
Execution of line 1 column 9
Immediate execution
Invalid character
Line in error:
comms = { = 108,
World: Lusternia
Execution of line 1 column 9
Immediate execution
Invalid character
Line in error:
comms = { = 108,
I have badluck, all I did was paste it in.
For anyone else who gets this error, your world isn't using Lua - there's now a plugin version in the first post which you can use instead.
Shishi2010-07-22 16:20:00
CODE
You carefully study a tailoring pattern.
Item: Shirt  Type: Shirts  Org: Public
Commodities: silk 7 silver 2 bluetint 1
Unknown commodity : bluetint used 1 times.
Estimated production cost: 790 gp.
Mortal Reviews: Allowed
Layer: NORMAL Bodyparts: chest, gut
IMPORTANT: The main noun MUST use one of these: SHIRT
Item: Shirt  Type: Shirts  Org: Public
Commodities: silk 7 silver 2 bluetint 1
Unknown commodity : bluetint used 1 times.
Estimated production cost: 790 gp.
Mortal Reviews: Allowed
Layer: NORMAL Bodyparts: chest, gut
IMPORTANT: The main noun MUST use one of these: SHIRT
You are missing prices for tints, but this is awesome!
Shaddus2010-07-22 19:09:27
Missing prices for tints, powerstones, and is there any way to change the prices on certain comms depending where you live? Maybe..... setting the prices when you browse comm shops?
Aubrey2010-07-22 19:44:23
QUOTE (Shaddus Mes'ard @ Jul 22 2010, 03:09 PM) <{POST_SNAPBACK}>
Missing prices for tints, powerstones, and is there any way to change the prices on certain comms depending where you live? Maybe..... setting the prices when you browse comm shops?
This. Besides going in and manually putting it in the trigger. Maybe an alias?
This is really awesome though. I used to have to go through one by one and calculate, save them to a file, open up the file and search every time I needed to tell someone how much something cost... This will save so much time! Thank you!
Kante2010-07-23 00:56:48
God, are you guys really too lazy to edit the trigger file to set comm prices?
Noola2010-07-23 01:00:51
QUOTE (Kante @ Jul 22 2010, 07:56 PM) <{POST_SNAPBACK}>
God, are you guys really too lazy to edit the trigger file to set comm prices?
Not me! I like being able to manually set it. Cause I can set the prices myself instead of having it just go off what it sees or something. For my profits!