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


Joined: 30 Apr 2003
Posts: 43
Location: Sweden

PostPosted: Wed Mar 31, 2004 4:33 am   

%additem etc.
 
Ok. Here's the thing.

I am trying to make something I would like to call a party history.
I have asked this question earlier but had no good answer.
So I will try to show everything.

here is the deal. First of all I want to show you how it look like the pattern:

[ Party ] xxx: talks something


That's the way it looks like.

Now i want the first 30 says to be in an variable.
So i can type: partyhistory and I will get an echo with the last 30 Party says.
Showing me:

[ Party hist ] xxx: said this and that

Now I got help. and that worked.

But the thing is. When someone typed in a special char. The whole system broke. So the variable messed up somehow.

The second problem is that when there comes a newline,
it wont show it.
"! XXXX: Ne mourir pas en l'étas unis! Naitre un canadien, mourir un
canadien!" <-- That's how the new line looks alike.

So. Special chars, and newlines mess it up. Can someone write me the exact thing I should have?
Reply with quote
jessew
Apprentice


Joined: 03 Mar 2003
Posts: 141

PostPosted: Wed Mar 31, 2004 10:50 am   
 
Think your special character problem can be stopped by surrounding the %1 in the additem function with quotes.
Forexample lets say your trigger is this
#TRIGGER {~[ Party ~] *~: (*)} {history = %additem("%1",@history)}

as for the newline, the easiest way I can think of is if your mud sends a blank line after everything. So when you triggered on the party line you could turn on triggers that would add everything the mud sent to a string until it reached a blank line, which would shut off those triggers and add that string to the party history list.

Might be an easier way of doing it not sure.

Cheers Jesse
Reply with quote
Hibio
Beginner


Joined: 19 Mar 2004
Posts: 22

PostPosted: Wed Mar 31, 2004 11:36 am   
 
Why create all the trouble, why don't you just create a child window and capture the "talk" into the child window, when you want to see the history, you just have to click over the child window.

This way you don't have to deal with using additem that also involves in having to check for 30 in the history and so on.

#trigger {[party]: talks blah blah} {#CAP Party}

this captures the whole line to the child window 'Party', but don't forget to take off the auto wrap from the mud.
Reply with quote
Corleidum
Novice


Joined: 30 Apr 2003
Posts: 43
Location: Sweden

PostPosted: Wed Mar 31, 2004 1:13 pm   
 
quote:
Originally posted by Hibio

Why create all the trouble, why don't you just create a child window and capture the "talk" into the child window, when you want to see the history, you just have to click over the child window.

This way you don't have to deal with using additem that also involves in having to check for 30 in the history and so on.

#trigger {[party]: talks blah blah} {#CAP Party}

this captures the whole line to the child window 'Party', but don't forget to take off the auto wrap from the mud.



Ok. that sounds even better. Help me then. What is auto wrap?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Mar 31, 2004 6:21 pm   
 
What Hibio refers to is that some MUDs let you configure if you want the MUD to autmatically split a line longer than some amount of characters into more than one line or have the MUD send it to yuo all in one long line. If the line is split into more lines, then it is harder for zMUD to capture it. If it is just in one big line, zMUD has no problem capturing it.
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