ID:265571
 
I was wondering which I should use for MUD commands. A verb or have the user input text and then parse it?
I am not sure I understand the question. A text mud is usually a program that uses a parser for input. Alathon has done some work in this area with BMUD and Intermundia. Ebonshadow and Abyssdragon also have parser libs.
In response to Jmurph
Yeah I know. I would use that, as long as people don't mind if I copy it. But I guess that's why it's there.
In response to Dark Weasel
I wrote a custom parser for Sana'te which was a lot of work (and continues to be so) but means I have a lot of flexibility in the way I do things.
In response to Hazman
I'd have to reference Alathon's so much though, that I'd probably end up copying it.
In response to Dark Weasel
Well, if you use a lib as a base, you are not really "copying" it. That's what libs are for. You will have to customize it and modify it to suit your project needs, though. I really like the work done with the parsers and ended up using two slightly different parsers in my mud project. It gives considerable flexibility.

I am still fighting some syntax accessibility issues, but that is just par for the course with these things. I think a DIKU style system would be fairly easy to set up with the tools availible in the parser libs. Something more robust and dynamic that allows more complex interactions takes a bit more work. But that's the fun part, right? ;-)
In response to Dark Weasel
Dark Weasel wrote:
I'd have to reference Alathon's so much though, that I'd probably end up copying it.

The lib, while slightly outdated, is intended to be included as a Library with completely overwritable functionality where applicable. You shouldn't need to.
Both! For simple things such as "talk" or "say" or whatever, make a verb. Also, for "special" commands such as "scale tower", "blow up balloon", "cleave taught line", "rig sailboat", etc, make verbs so that the players don't have to guess at the right command usage or use the help command all the time. For more subjective things, like common item manipulation, etc, run it through the parser.

One of BYOND's great default behaviours is that anything that's a verb will automatically be passed to the correct verb procedure, and anything else will be passed to client/command(), which is an easy hook for your parser. Write the verby-type stuff to your verbs, and then write a parser for everything else. There, the best of both worlds!