Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Malie
Newbie


Joined: 18 Apr 2007
Posts: 3

PostPosted: Wed Apr 18, 2007 8:28 am   

Newbie needs help
 
Alright..

I'm no good at scripting, or dealing with this type of thing, But I'm trying to learn so please bear with my newbie-style.

For Lusternia, I'm trying to make a simple little script to transfer all my incomming and outgoing tells to a child window.
I'm having a few problems...

1. I get the Callia tells you, "Blah blah blah
to show up in the child window, and that is also gagged on the parent window. But the second, third, fourth, or how every many lines that follow show on the parent window, but are gagged in the child window.

2. I'm trying to run the gag off my prompt, but somehow I got my prompt to be gagged!

I'm not sure what I've done wrong, so any advice would be helpful.
I've also scoured these forums looking for help, and the only thing I could find was a "Channel Capture" script made by someone else, but that captures all channels, and I only want tells.

I'll list the triggers I have made here.

#TRIGGER {* tells you, } {#GAG;#CW Cyan;#CAPTURE Tellswin;#C+ Tellswin}

#TRIGGER {You tell *, } {#GAG;#CW Red;#CAPTURE Tellswin;#C+ Tellswin}

#TRIGGER {^(%d)h, (%d)m, (%d)e, (%d)p (*)-} {#C-;#GAGOFF}

#TRIGGER {Capture text OFF} {#GAG}

#TRIGGER {Capture text ON} {#GAG}

The first #GAG on the Tell lines is to gag the first line of the tell, which works.
#CAPTURE seems to only rollover the first line, so I tried using C+ to grab the rest. It WAS working, but just stopped for some reason.
I tried putting #GAGON in with my tell lines, but that didnt do much of anything.

Thanks for any help you guys offer!
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Wed Apr 18, 2007 1:59 pm   
 
Okay, let me let you in on a little secret:

Code:
config wrapwidth 0;#call %pref(WordWrap,1);#call %pref(AutoWrap,0);#call %pref(WrapWidth,80);#call %pref(WrapIndent,0)


Run that on your command line, and do a little dance because this problem (and many others) just got ten times easier. What this does is turn off server-side word wrapping and then configure CMUD's word wrapping to look identical (you can also play with the settings if you want to experiment, they're in the GUI as well). The benefit of this is that CMUD tests the trigger patterns BEFORE it does client-side word wrapping. Everything between two prompts now appears to CMUD as one line, including long tells. All you need is this code:

#trig {^%w tells you, ~"} {#gag;#cap tellswin}
#trig {^You tell} {#gag;#cap tellswin}

and you're done. You don't need the colour - #cap should move colour codes as well.

If that method really doesn't appeal (it might require rewriting some multi-line triggers) you're going to need a script that handles single lines and multiple lines as separate cases - #cap for single lines and #c+ for multiple. Have a look at this thread - it's quite complicated so take it slow and look up the functions and commands you don't understand.
Reply with quote
Malie
Newbie


Joined: 18 Apr 2007
Posts: 3

PostPosted: Wed Apr 18, 2007 8:40 pm   
 
Thank you for your help.

config wrapwidth 0;#call %pref(WordWrap,1);#call %pref(AutoWrap,0);#call %pref(WrapWidth,80);#call %pref(WrapIndent,0)

I sent that through my command prompt. wrapwidth 0 didnt work, but I did set it to 200 last night when I was trying to figure this all out. I didnt realize I could set it to 250, so I did that this morning.

Without doing anything, I logged onto the MUD to test it again, to try and pick up where I left off, and everything worked perfectly, without me changing anything!

Last night before I went to bed I was having all kinds of problems, and now nothing!

I did however take out those extra triggers I had, and changed the ones to match what you gave me. And it's still working just fine.

Although, I would like to note a few more of the problems I have having, just incase they resurface.

When I would send or receive a tell, it would be sent to the Child window twice.
The first time would just be a normal line.
The second would be with my colour change.

Also, after I received the tell, it would still continue to capture lines after that, including my prompt and everything else I did in the parent window.
I'm pretty sure that was because I was using #C+ to capture everything, So I removed them, but it still continued to happen.

Not too sure on this, but I think it stopped happening because I closed the session and reopened it.

The same thing happens with my Ticker. If I set it while my session is active, the ticker doesnt work.
If I close the session and reopen it, the Ticker then starts to work.

But, thank you!
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Wed Apr 18, 2007 9:54 pm   
 
Ah, Lusternia doesn't let you set it to 0 to turn it off. Setting it to 250 should be high enough to work the same way, though.

Whatever you're using the tick timer for can probably done better and in a more versatile way by the #alarm command - give it a look.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Malie
Newbie


Joined: 18 Apr 2007
Posts: 3

PostPosted: Wed Apr 18, 2007 11:44 pm   
 
Well, I just use it to do something random, depending on my characters mood..

Like hiccuping, for instance.

Or petting Daedalions shrunken head.

Although I could use #alarm to reset itself after the command happens, right?

Maybe I'll give that a try.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu Apr 19, 2007 12:26 am   
 
Well, you could do something like this:

#var command ""
#var commandlist {pet head|hiccup|bounce|smile}
#alias moodcommand {#if (%1=reset) {#var command ""} {#var command %1}}

#alarm *300 {#if (@command) {#exec @command} {#exec %item(@commandlist,%random(1,%numitems(@commandlist)))}}

Or something? Maybe that's more complex than you were after :P
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net