|
rtatum Novice
Joined: 19 Sep 2004 Posts: 45 Location: Houston
|
Posted: 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 |
|
|
|
Danlo Magician
Joined: 28 Nov 2003 Posts: 313 Location: Australia
|
Posted: 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}}
|
|
|
|
|
rtatum Novice
Joined: 19 Sep 2004 Posts: 45 Location: Houston
|
Posted: Wed Oct 27, 2004 6:25 am |
Thanks for the help Danlo, just what I needed
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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 |
|
|
|
Danlo Magician
Joined: 28 Nov 2003 Posts: 313 Location: Australia
|
Posted: 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
|
|
|
|
|
|