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


Joined: 19 Sep 2004
Posts: 45
Location: Houston

PostPosted: Wed Oct 27, 2004 1:34 am   

Idea for a script, need help though
 
I want to be able to store tells or whatnot in a text file or variable, and then type in a command like... history tells to have it read out the text file/variable they are stored in, and have the text file/variable reset whenever I log in/out of the mud so it's fresh every time... I think it'd probably be pretty easy to do with a variable, I just need a bit of help getting it done, primarily, just finding a command to capture a line of text into a variable

Also, if there was a way to limit it to the last 20 or so things, that'd be great, no use in having it scroll hundreds of lines
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Wed Oct 27, 2004 5:22 am   
 
Try this. All you have to do is type history for a recount of all the tells you've received:

Code:

#var TellHistory "" ""
#trigger {^%w {tells you|replies}, '*'} {#var TellHistory {%additem(%time(ddd hh:mm): %line,@Tellhistory)}
#delnitem Tellhistory 21}
#alias history {#forall @TellHistory {#ECHO Message received at %i}}
Reply with quote
rtatum
Novice


Joined: 19 Sep 2004
Posts: 45
Location: Houston

PostPosted: Wed Oct 27, 2004 6:25 am   
 
Thanks for the help Danlo, just what I needed
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Oct 27, 2004 10:25 am   
 
The %additem function adds to the end of the list. So the #DELNITEM will simply remove the most recently added. To maintain chronological order use "#IF (%numitems(@TellHistory))>20) {#DELNITEM TellHistory 1}" instead of "#DELNITEM TellHistory 21". To use a reverse chronological order replace %additem with %push.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Wed Oct 27, 2004 5:54 pm   
 
Ah yeah, that's right, I forgot I was adding to the end instead of the beginning. Thanks vij
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