Very odd spacing on %gsl(m) and %gsl(l) 08/14/2010 12:44 AM CDT
In cMUD 2.37 without anything in my hands #ECHO %gsl(m) returns the word "Empty" it has a #ECHO %numwords(%gsl(m)) of 1 word. Makes sense. However, when I get an "apple short bow" in my right hand, it has a #ECHO %gsl(m) of "an apple [there are 5 spaces here] short [there are six spaces here] bow" and a %numwords(%gsl(m)) of 12, despite the fact that there are only 4 words there. Though an issue, before it wasn't noticeable because I was only interested in the last word #ECHO %word(%gsl(m),%numwords(%gsl(m))) would return "bow"

In cMUD 3.22a without anything in my hands #ECHO %gsl(m) returns the word "Empty" it has a #ECHO %numwords(%gsl(m)) of 20 words, I'll assume there are some trailing spaces. Doesn't make sense, when I get an "apple short bow" in my right hand, it has a #ECHO %gsl(m) of "an apple [4 spaces here] short [7 spaces here] bow [5 spaces here]" and a %numwords(%gsl(m)) of 16, again only 4 real words here. This ends up being a major issue, as I am only interested in the last word, which is now a blank. #ECHO %word(%gsl(m),%numwords(%gsl(m))-4) seems to be "bow," I don't know what is going on, if someone could look at how %gsl(m) and %gsl(l) are being processed and sent, it would be very helpful, thanks.
Reply
Re: Very odd spacing on %gsl(m) and %gsl(l) 08/15/2010 11:07 PM CDT
Zugg created those DR gsl codes a LONG time ago. Things are completely different now.

You basically can't use any gsl for CMUD that isn't already working 100%.

The best you could do would is to go raw output, and emulate XML. :)

Good luck!
Reply
Re: Very odd spacing on %gsl(m) and %gsl(l) 08/16/2010 05:47 PM CDT
Figured out a way around it made a function called GSLFixer($hand) with code:


hand=%replace($hand," ","|")
#FORALL (@hand)
{
#IF (%i = "")
{
//#ECHO Nothing here
hand = %delitem("",@hand)
}
//#ECHO %i
}
hand=%replace(@hand,"|"," ")
#RETURN (@hand)



so I can do: rthand = @GSLFixer(%gsl(m)), and everything will appear with the correct spacing and word count. Turns out that earlier versions of CMUD were not getting the spacing right either, but they just didn't add extra spaces after the last word. 3.22a does, which broke my %word(@rthand,%numwords(@rthand)) and essentially all my scripts. There is more detail on it at http://forums.zuggsoft.com/forums/viewtopic.php?t=35639 I asked for some help there getting it to use nothing but temp variables, if no one post anything, I'll repost the code alone in a new thread for people facing the same problem. Ty though.
Reply
Re: Very odd spacing on %gsl(m) and %gsl(l) 08/16/2010 08:05 PM CDT
The Zuggsoft forums are very impressive. When I was using CMUD they were very helpful.



Nice job on creating that function!
Reply