ID:147711
 
client
command_text = "> "
show_verb_panel = 0
mob/verb
connect(text as text|null)
set name = "> connect"
set hidden = 1
cd(text as text|null)
set name = "> cd"
set hidden = 1
usr << text


I've got this as an code, however...

When I type in "> cd hi", it returns "cd hi".
How do I make it so that it returns "hi" (without "cd")?
The error is becuse command names with spaces in it. Just do not use a command-prefix such as "> " and it will work OK. Wy do you need the "> " enyways? You can alredy see wat you ar typeing on the botom uv the screen
That wouldn't work too well, as I'm not too familiar myself with such verb usage. However! I'm sure it's possible (as I've done a little command line thing as this before, but a bit different.) I'll explain how I would do this, some code might be a little sparce, but I'm sure it should be enough to assist you.

Your code:
client
command_text = "> "
show_verb_panel = 0
mob/verb
connect(text as text|null)
set name = "> connect"
set hidden = 1
cd(text as text|null)
set name = "> cd"
set hidden = 1
usr << text


My revision:
client
command_text = "> "
verb/command(cmd as command_text)
set hidden = 1
doCcommand(cmd)
proc/doCommand(var/cmd)
if(cmd == "connect")
//Do what you want here.
else if(cmd == "cd")
src << "[cmd]" //Obviously, here we output the text to the client.
else
src << "Invalid command." //Just added an invalid command output.


All in all, hope this helped you. this will also stop it for when you type in, "> connect" and press enter, a dialog box doesn't come up, as I thinking that this is for a command line type thing, it should work well (as I've used it before.).

-GDT