Using PennMUSH version 1.8.3 patchlevel 3, I have set the +sheet to search for the active skill that are set on the sheet object which works fine, but I am having trouble with it not showing the values of the skill themselves. They'll show the skill name and that is all. If anyone has any advice I'd appreciate it. The current code that I am using is:
To be a bit more verbose, your problem is there's nothing in the code you posted that gets the contents of the attributes you're listing. Hence, I added get(get(%#/db)/##), after you edit the attribute name for display, hoping that will work.
Once you get it working, you might try putting get(%#/db) in setq1, as you're iterating it a few times (then it would be simply 'get(%q1/##)' ). I'd also replace the last switch() with ifelse(). That would look like:
Wasn't it recently claimed that MUSH code was fairly easy on beginners? Even after seeing an "expanded" version I still find that pretty hard to read… maybe it's just the magic symbols that aren't terribly obvious.
Well, a "beginner" would be one who's never taken a programming course. :)
And this code is hardly "beginner level". The use of mid() is just too cute to live.
It's easier to write unreadable mushcode than not, truth be told, and I see no way around this that wouldn't make it harder for beginners and pros, so you just have to suck it up and scale the sheer rock face that lies between the newbie and the psychocoder. Mushcode works best for people with no knowledge of structured programming and no beliefs about object orientation. Of course it's easier to read when pretty printed, but it's not used that way.
Oh, I understood the functions themselves… but not knowing the magic words, I couldn't tell what was being manipulated. I suspect many would have the same issues with me posting perl code filled with things like $+, $!, $?, %$$foo, and the like.
At least the perl folk recognize this and have a "use English;" statement that gives you expanded names for all those nasty litlte shortcuts. Of course, the person writing the code still has to use them. :)