Aubrey2010-07-29 23:49:56
QUOTE (Esano @ Jul 29 2010, 07:48 PM) <{POST_SNAPBACK}>
That's a fairly minor thing. I'll send you a file without that constants.lua requirement.
You rock.
Lilia2010-08-03 21:54:59
Is there any possibility of porting this to Mudlet? I have no idea how much work that would involve, but I really want this!
Unknown2010-08-03 22:01:13
QUOTE (Lilia @ Aug 3 2010, 05:54 PM) <{POST_SNAPBACK}>
Is there any possibility of porting this to Mudlet? I have no idea how much work that would involve, but I really want this!
It's on my todo list. I don't have his code, I'm just gonna steal the idea and code it myself. But I've been kind of busy, so it might be a week or more before I get around to it.
Lilia2010-08-04 00:49:41
QUOTE (demonnic @ Aug 3 2010, 05:01 PM) <{POST_SNAPBACK}>
It's on my todo list. I don't have his code, I'm just gonna steal the idea and code it myself. But I've been kind of busy, so it might be a week or more before I get around to it.
Take your time, I'm not a demanding mooch.
Lilia2010-08-04 00:49:42
QUOTE (demonnic @ Aug 3 2010, 05:01 PM) <{POST_SNAPBACK}>
It's on my todo list. I don't have his code, I'm just gonna steal the idea and code it myself. But I've been kind of busy, so it might be a week or more before I get around to it.
Take your time, I'm not a demanding mooch.
Calixa2010-11-20 16:52:10
CODE
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(matches, "Â Â ", " ")
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
      cecho("\\nUnknown commodity : "..curcomm.." used "..curcount.." times.")
  end
  commnum = string.find(commlist," ",commnum,false)
end
cecho("\\nEstimated production cost: "..cost.." gp.")
= 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(matches, "Â Â ", " ")
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
      cecho("\\n
  end
  commnum = string.find(commlist," ",commnum,false)
end
cecho("\\n
Mudlet rewrite, make a perl regex trigger on ^Commodities: (.*?)\\s*$ and put this into the code box.
Lilia2010-11-20 19:24:24
Beautiful! Thank you so much!