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
Toihva
Novice


Joined: 20 Nov 2004
Posts: 38

PostPosted: Sat Jul 21, 2007 3:04 am   

Threshhold Channel Capture script
 
Ok, I am planning on making a channel capture script for threshold. The thing is I am not sure exactly how to do it. Here is an example of the text outlook:

Sanskrista [heritage] Sorry, matey. Death isn't to be treated as a trivial
wham-bam thank you ma'am kind of event.

as well as

[heritage] Rosuav chuckles at Sair


New to using CMud and been away from coding for over a year. Any and all help is greatly appreciated.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sat Jul 21, 2007 3:16 am   
 
So you either have a simple word, followed by the channel name, followed by whatever, or just the channel name followed by whatever? You could do

^%w ~[%w~]
^~[%w~]

or you could use a regex to combine the two

^(?:\w+ )?[\w+]

Once you've got the triggers matching, you just add "#cap windowname;#gag" to their scripts (you might need to gag twice to get rid of extra prompts) and bob's your uncle.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Daagar
Magician


Joined: 25 Oct 2000
Posts: 461
Location: USA

PostPosted: Sat Jul 21, 2007 8:56 pm   
 
Unfortunately, I'm guessing the solution by Fang will only capture a single line. For multiple capture, you'll have to pull a few more tricks - if you can make your channels a unique color, I find that to be one of the easier ways to go about it. Other options are multi-step triggers, where you use what Fang provided to start, then a loop trigger on *, and then a final conditional trigger on ^$ (blank line) to exit out.

I think Fang comes from worlds that let you configure everything to come at you as a single line, which drastically simplifies channel captures :)
Reply with quote
Toihva
Novice


Joined: 20 Nov 2004
Posts: 38

PostPosted: Sat Jul 21, 2007 10:55 pm   
 
Fang is from Imperian, and he is a cool guy.

But yah, there is two lines I have to play with.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Jul 22, 2007 12:35 am   
 
It's been a while since I played in Threshold. Is there a wordwrap command of some sort there? If so, use it to turn off wordwrap or set it wider than your screen (by a really REALLY large amount, so that long lines like room descriptions don't wrap weirdly on you). This will get rid of the multi-line pain in the ass without having to make your scripting complicated.
_________________
EDIT: I didn't like my old signature
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