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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Feanrath
Newbie


Joined: 24 Feb 2007
Posts: 2

PostPosted: Sat Feb 24, 2007 2:44 pm   

Storing multiline messages in a variable
 
Ok, I've seen a fair few multiline #capture scripts after searching for long enough, but they dont really do what I want, as I dont want to use a seperate window at all.

Basically I'm looking for a way to take a channel message like so:

Quote:
(Ring): Tek says, "Your awesome."

And put it into a variable. This so far didnt seem so bad, in fact:

Code:
#trigger (~(Ring~)~: %1) {ADDITEM ListofRingtells %copy("%1",1,82)}


Seemed to work fine.

The trouble I've struck is when someone decides to keep on talking, and stretches the message onto multiple lines.

Quote:
(Ring): Erin says, "Concoctions,woodcrafter, jeweler and tattooist, all
skills trans available to hire. I reserve the right to refuse service. See AD
84 and AD 97 for details."


At which point my variable'll only store the first line. Increasing the number of characters to copy wont work, because the mud wraps at 82 characters.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sat Feb 24, 2007 3:05 pm   
 
From the lingo they're using, it sounds like an IRE game. My recommendation to make this UNBELIEVABLY easier is to set your line length to 0 so the server does no word wrapping. You can set zMUD's wrapping to 80 characters if you want to keep it the same width visually, but triggers won't need to be multiline. You can just do

#trig {^~(Ring~)~: (*)$} {#additem ListofRingtells {%1}}

That said, it's also possible to do something like this:

#trig {^~(Ring~)~: (*)$} {#if (%ends(%line,.~")) {#state 0;#additem ListofRingtells %1} {#t+ CaptureRing;#additem TempTells {%1}}}
#cond {.~"$} {#additem TempTells {%line};#t- CaptureRing;#additem ListofRingtells {%replace(@TempTells,"|"," ");#var TempTells ""}

#trig "CaptureRing" {^(*)$} {#additem TempTells {%line}}
Reply with quote
mikeC130
Apprentice


Joined: 03 Jul 2006
Posts: 110

PostPosted: Sat Feb 24, 2007 8:08 pm   
 
[quote="Fang Xianfu"]From the lingo they're using, it sounds like an IRE game. My recommendation to make this UNBELIEVABLY easier is to set your line length to 0 so the server does no word wrapping. [/quote]

That sounds like it would be extremely helpful, but I can't seem to find any directions in the systems helpfiles to change the line width settings. Do you happen to know the commands for configuring the output for IRE games (I am in imperian).

Mike
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sat Feb 24, 2007 8:34 pm   
 
It's one of the CONFIG commands. If you type CONFIG on its own it'll list the settings you can change with it. One of them is screenwidth or linelength or something.

EDIT: Actually, logging onto Imperian now it seems the command has vanished, or I imagined it, or Imperian doesn't have it. You'll have to go with the second method.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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