Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ Organizing contents of a container
|
Organizing contents of a container
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
| Posted by
| Whisk3rz
(17 posts) Bio
|
| Date
| Reply #15 on Sat 30 Apr 2011 03:16 AM (UTC) |
| Message
| Much better. I do appreciate all of your help. I was thinking var seemed like a different language, but I didn't want to say that, heh.
In regards to removing the count, is there any way to format this to just exclude some items from the count? | | Top |
|
| Posted by
| Twisol
USA (2,257 posts) Bio
|
| Date
| Reply #16 on Sat 30 Apr 2011 07:14 AM (UTC) |
| Message
|
Whisk3rz said: Much better. I do appreciate all of your help.
Sure thing.
Whisk3rz said: In regards to removing the count, is there any way to format this to just exclude some items from the count?
Hmm, do you have an example? I'm not sure what exactly you mean. |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | | Top |
|
| Posted by
| Whisk3rz
(17 posts) Bio
|
| Date
| Reply #17 on Sun 01 May 2011 01:26 AM (UTC) |
| Message
| Lets say I want a number and (s) beside all things except (some copper) (some gold) (a gold) (a copper)
Putting a number beside currency really throws me off. heh. | | Top |
|
| Posted by
| Twisol
USA (2,257 posts) Bio
|
| Date
| Reply #18 on Sun 01 May 2011 02:08 AM (UTC) |
| Message
| Conceptually, you need to store a list of these exceptions somewhere. For each item you display, you need to check that list and do something different if it's in that list.
-- The list doesn't need to (and arguably shouldn't) be in
-- the trigger itself; you could put it in your script file
-- (minus the 'local' and probably changing the name) so
-- it's only created once.
local blacklist = {
["some copper"] = true,
["some gold"] = true,
["a copper"] = true,
["a gold"] = true,
}
-- blacklist["foobarbaz"] returns nil
-- blacklist["a gold"] returns true
-- This is perfect for an if condition.
for k,v in pairs(counts) do
-- Check the blacklist
if blacklist[k] then
Note(k)
else
local plural = (v != 1 and "(s)" or "")
Note(("%i %s%s"):format(v, k, plural)
end
end
|
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
75,006 views.
This is page 2, subject is 2 pages long:
1
2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top