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
Glinka
Wanderer


Joined: 20 Dec 2000
Posts: 53
Location: USA

PostPosted: Fri Sep 20, 2002 10:09 pm   

block text capture ? multiple lines?
 
Hi folks,
jus wondrin if this is at all possible..


I want to capture multiple lines from zmud
and write them to a file or else
stick those lines in a variable or file
of some kind.


here is what the mud output looks like
************************************
Current Adventurers

joe mud .... bill mud
sam mud .... mary mud
julie mud .... susie mud
etc...

You notice 123 adventurers

**********************************

How can i capture all lines between
"Current adventurers" and "You notice.."
including blank lines?

I'll be using this list to check for the names of friends

..and then mebbe put those names in another
list or just #show them.

I've tried to capture blank lines with $
but can't get the hang of it...

the block of text will have up to 60-70 lines..

Thanks for any help
Glinx

Love, Lyte, and Laughter...
Glink
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Sep 20, 2002 10:53 pm   
 
If you wish to simply put them in a file then #LOG would be easiest. Since you want a variable with your friends we will do tht at the same time.

#VAR Friends {}
#VAR FriendsOnline {}
#ALIAS AddFriend {#IF ("%1"=%null) {#ECHO Usage: AddFriend name} {#ADDITEM Friends {%1}}}
#ALIAS Who {FrinedsOnline="";#TEMP {^Current Adventurers$} {#T+ WhoList;#LOG {who.txt} {new}};~who}
#CLASS WhoList {disable}
#TR {^*$} {#IF (%begins(%trigger,"You notice ")) {#LOG;#T- WhoList;#ALARM {+2} {#ECHO Online friends are: %replace(@FriendsOnline,"|",", ").}}}
#TR {({@Friends})} {#ADDITEM FriendsOnline {%1}}
#CLASS 0
Reply with quote
Glinka
Wanderer


Joined: 20 Dec 2000
Posts: 53
Location: USA

PostPosted: Sat Sep 21, 2002 3:13 am   
 
wow!..thanks,
it seems to work great...

fixed the "frineds" typo and took braces off
who.txt and removed a period
after the %replace- works fine now,
*************************************

now for the next help question...

can i put all the who list into a temporary
spot and use it for comparison...without
logging?

here is what i'm tryin to do...
(totals are jus for reference)
who all
check main who list for all names...20 total

who Classes
check who fighter for all names.....10 total
check who cleric fo all names.......9 total

then compare the names of the classes against
the main who list and find the name that
is missing...

Our mud lists all names of players under
"who all"
it doesn't list the thief class, but lists
all other classes..ergo, if a name isnt
a part of the fighter or healer class..
but is still on the main "who all" list
then the missing name is a thief.

I'm guessing that %ismember will be init
something like..
#VAR whoall
#VAR whoclasses
#forall (@whoall
#if(%ismember(whoclasses)#noop
#echo (any of the names leftover?)

..i dont need to save any of this..
just extract any names in whoall, but not
in whoclasses and echo to the screen

sorry to be difficult, and thank you for
all the help, I'm learning alot just from
reading all the posts in here...

Thanks again,
Yours in Laughter,
Glinx


Love, Lyte, and Laughter...
Glink
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Sep 21, 2002 5:07 am   
 
Make a stringlist from the "who all" command, using #ADDITEM.
Usinge the same variable, delete all the fighters using "who fighter" and #DELITEM.
Do the same thing for clerics and any other classes.
When you finish, whoever's left in the list is a thief.

You can make separate lists for the fighters, clerics, etc. by using #ADDITEM with a different variable at the same time you use #DELITEM to remove them from the "all" variable.

LightBulb
Senior Member
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