[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  prompt
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

prompt

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Frobozz   (75 posts)  [Biography] bio
Date Mon 22 Nov 2004 04:08 PM (UTC)  quote  ]
Message
Question:

I found the code for display_prompt and default_prompt and do_prompt, however, I am unable to figure out how to do or achieve the following:

Keep the prompt (not fprompt) from spamming each time some form of input reaches the char. Ideally I want the prompt to look like this:

> sayto frobozz You are a newbie coder
You say to Frobozz "You are a newbie coder"
Frobozz says, "I am not!"
Frobozz says, "I swear"
> sayto frobozz "hah"

Where now the code makes it look like this:

<hp/hp sp/sp mp/mp> sayto frobozz You are a newbie coder
You say to Frobozz "You are a newbie coder"
<hp/hp sp/sp mp/mp>
Frobozz says, "I am not!"
<hp/hp sp/sp mp/mp>
Frobozz says, "I swear"
<hp/hp sp/sp mp/mp> sayto frobozz "hah"

So I guess my question is how do I set the default prompt to ">" and keep the prompt from spamming unless the player enters a command or return?

Thank you again.
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Reply #1 on Mon 22 Nov 2004 05:43 PM (UTC)  quote  ]
Message
You can't really do what you want, because that would require the program to know when the user is going to type in a command. If you think about it,
> sayto frobozz You are a newbie coder
You say to Frobozz "You are a newbie coder"
Frobozz says, "I am not!"
Frobozz says, "I swear"
(how do you know it's time to print out '>'?)
> sayto frobozz "hah"
The answer is that you don't and I believe you can't. That's why SMAUG prints out the prompt after every 'block' of output.

As for setting the default prompt, that should be as simple a matter as just changing the default_prompt function, right? I don't remember what it looks like off the top of my head but it should be in there.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Frobozz   (75 posts)  [Biography] bio
Date Reply #2 on Tue 23 Nov 2004 08:58 PM (UTC)  quote  ]
Message
By editing the default_prompt, display_prompt and "bust a prompt" I was able to get the desired results.

Anyone else looking to do the same can look there!
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Reply #3 on Tue 23 Nov 2004 09:21 PM (UTC)  quote  ]
Message
Could you explain how you manage to display a prompt only when the user is about to type in a command?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Tinkle   (2 posts)  [Biography] bio
Date Reply #4 on Sun 27 Feb 2005 08:58 AM (UTC)  quote  ]
Message
You could only display a full prompt under certain circumstances, such as
1. A certain amount of time (i.e. 4 seconds) has elapsed since the last time that user was sent a full prompt.
2. A certain amount of text (i.e. 20 lines) have been sent since the last full prompt.
3. The user has sent a line of input.

That would have pretty much the same affect.

Im too new to know how to code it, but adding a few variables to the character and changing the prompt function should be sufficient.
[Go to top] top

Posted by Gatewaysysop2   USA  (142 posts)  [Biography] bio
Date Reply #5 on Sun 27 Feb 2005 08:53 PM (UTC)  quote  ]
Message
Are people to understand from the lack of response that they're supposed to offer what they know in order to answer your question, but when you stumble upon the answer yourself, the rest of us are aren't worth sharing it with? I sincerely hope not, because that'd be rather selfish.

It would seem like common courtesy to give a bit more info on this, especially since someone else already made the request. To be quite honest, if I figured out how to code something that people claimed to be impossible, I would surely post and brag. But hey, that's just me.

"The world of men is dreaming, it has gone mad in its sleep, and a snake is strangling it, but it can't wake up." -D.H. Lawrence
[Go to top] 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.


2,926 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]