|
haiku Wanderer
Joined: 19 Nov 2004 Posts: 70
|
Posted: Sun Aug 26, 2007 6:58 pm
Clear window information |
They added a new feature to my mud, which has a map, and some nice color coding stuff in it. I got another window to capture the output, but it's ungainly. Basically, the output is 25 lines of text, and I go about capturing via
#C+ atlas
#TEMP {*>} {#C- }
The *> above is when if finds my prompt. I tried doing
#CAP 25 atlas
but that didn't work either (it took the previous 25 lines).
Anyway, how do I clear the window so I can refresh it (instead of having to scroll up in the window)?
The help function in cmud wasn't much help on this one. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sun Aug 26, 2007 7:02 pm |
One simple command:
:windowname:#clr |
|
|
|
haiku Wanderer
Joined: 19 Nov 2004 Posts: 70
|
Posted: Sun Aug 26, 2007 7:10 pm |
groovy, thanks Fang. Also, looking over some other threads, I've seen something regarding you posted regarding #STATE.
My jaw dropped, my pulse quickened, and I raced to the help file. Which was pretty lame and unhelpful.
Typically I handle state in my bots via variables, e.g. (#VAR prepFullState 1) and then later do stuff based off of it. #IF (@prepFullState = 1) {do stuff} {do different stuff}
Is there a better method of doing this via #STATE? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sun Aug 26, 2007 7:22 pm |
It depends on what you're doing - probably not. #STATE is specifically for multistate triggers. Multistate triggers are really meant to receive a list of patterns in a certain order, like so:
#trig {first pattern} {first command}
#cond {second pattern} {second command}
#cond {third pattern} {third command}
And the trigger always follows the 1-2-3-1-2-3 pattern. The #STATE command is used to set or reset the state of the trigger. It's possible to do conditional matching with this system, but it's not really ideal. For many things, there are better ways. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sun Aug 26, 2007 7:39 pm |
Since you know it is going to be 25 lines, you can use a looplines state. I would actually do it this way
Code: |
#REGEX "AtlasCap" {\377\377\377Impossible!} {}
#COND {} {#CAP Atlas} {looplines|param=25} |
Then where you currently have
Code: |
#C+ atlas
#TEMP {*>} {#C- } |
You would replace it with
Code: |
:Atlas:#CLR
#STATE AtlasCap 1 |
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
haiku Wanderer
Joined: 19 Nov 2004 Posts: 70
|
Posted: Sun Aug 26, 2007 8:41 pm |
Vijilante wrote: |
Since you know it is going to be 25 lines, you can use a looplines state. I would actually do it this way
Code: |
#REGEX "AtlasCap" {\377\377\377Impossible!} {}
#COND {} {#CAP Atlas} {looplines|param=25} |
|
Can you buy chance explain this a little further? Do I make an alias named looplines? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sun Aug 26, 2007 8:59 pm |
Looplines is a kind of trigger state - check it out here. Basically, it checks itself against the next X lines, and then moves on to the next state.
|
|
|
|
|
|