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
Caharin
Beginner


Joined: 08 Oct 2004
Posts: 10
Location: in cardea

PostPosted: Fri Jan 28, 2005 2:56 am   

an odd question out of the blue
 
i doubt i need to be to specific here. i want to make a 'notes' alias that for example i can type this

note bla bla bla blibbidy bla

and zmud will take anything after the word 'note' and place it in a varable i can later read with notes alias that reads say @notes. its probably damn simple and im just forgetting somthing

thanks for your time
Caharin
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Jan 28, 2005 4:49 am   
 
#alias note {notes = %additem("%-1",@notes)}
#alias readnotes {#forall @notes {#say %i}}
_________________
EDIT: I didn't like my old signature
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Fri Jan 28, 2005 7:32 pm   **SOLVED**
 
I got this from somewhere and damned if i remember where:
Code:
#CLASS {Notes}
#ALIAS notepad {#ADDITEM Notepad {%-1};#ECHO Note added.}
#ALIAS shownotes {#FORALL @notepad {#ECHO %i}}
#ALIAS clearnotes {#YE "Do you really want to clear your notes?" {#VAR notepad ""} {}}
#VAR notepad {}
#CLASS 0

Type "notepad blah blah" to add
Type "shownotes" to read your notes
type "clearnotes" to delete all.

To piggy back on this note tho:
notepad testing
notepad testing2
notepad testing3

shownotes
testing
testing2
testing3

How would i get it to add #'s to the notes as in:
1 testing
2 testing2
3 testing3

And be able to delete specific notes:
clearnote 2

and automagically renumber the notes:

1 testing
2 testing3

I'm sorry to piggy back on the note, BUT since it's relevent to the original post thought i would...


Last edited by DeathDealer on Fri Apr 01, 2005 8:26 pm; edited 1 time in total
Reply with quote
Aarlot
Adept


Joined: 30 Dec 2003
Posts: 226

PostPosted: Fri Jan 28, 2005 8:11 pm   
 
Hmm... the original script you gave there DeathDealer looks exactly like a script I wrote for a request on the mud I play, WoTMUD. I wonder if it's the same one or not.
_________________
Everyone is entitled to their beliefs - until they die. Then only the truth matters.
Reply with quote
Vorax
Apprentice


Joined: 29 Jun 2001
Posts: 198
Location: USA

PostPosted: Fri Jan 28, 2005 8:40 pm   
 
Quote:
How would i get it to add #'s to the notes as in:
1 testing
2 testing2
3 testing3
Change the shownotes alias to this:
Code:
#ALIAS shownotes {#LOOP %numitems(@Notepad) {#SHOW %i %item(@Notepad, %i)}}
Quote:
And be able to delete specific notes:
clearnote 2
Code:
#ALIAS clearnote {#EXEC %delnitem(@Notepad, %1)}
These weren't tested, but in theory they should work the way you want.
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Mon Jan 31, 2005 6:01 pm   **SOLVED**
 
Aarlot wrote:
Hmm... the original script you gave there DeathDealer looks exactly like a script I wrote for a request on the mud I play, WoTMUD. I wonder if it's the same one or not.

Wish i could say for sure. At one time I was looking around for any and all scripts so that I could better learn how things go together, and to see if i could merge a few together. If ya think it looks just like what ya wrote, then it more than likely is. Tho my addition mighta been a change from note to notepad since it woulda interfered with the note command in the mud.

Quote:
Code:
#ALIAS clearnote {#EXEC %delnitem(@Notepad, %1)}
These weren't tested, but in theory they should work the way you want.

It's don't work.
It show's the new list on screen, but does not remove it from the list.
Tried it with %delitem as well just in case, with the same result
But the numbering of the list worked perfectly :-)


Last edited by DeathDealer on Fri Apr 01, 2005 8:26 pm; edited 1 time in total
Reply with quote
Vorax
Apprentice


Joined: 29 Jun 2001
Posts: 198
Location: USA

PostPosted: Mon Jan 31, 2005 6:15 pm   
 
It might need an extra %
Code:
#ALIAS clearnote {#EXEC %delnitem(@Notepad, %%1)}
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Mon Jan 31, 2005 6:39 pm   **SOLVED**
 
Seems to be sending the command to the mud:
type:
clearnote 3

result seen on screen:
testing|testing2|testing3 3
Sorry Vitae, I don't understand you.

Note, there is an extra 3 at the end of that (and if i type clearnote 1 there's a 1 there instead).
_________________


Last edited by DeathDealer on Fri Apr 01, 2005 8:25 pm; edited 1 time in total
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Jan 31, 2005 8:40 pm   
 
Yes, results of functions are usually sent to the MUD and they usually don't change a variable's contents directly. Functions just return the altered value, if you actually want the variable changed the function must be combined with a #VARIABLE command.
Code:
#ALIAS clearnote {#VAR Notepad {%delnitem( @Notepad, %1)}}


It's easier to just use the related command.
Code:
#ALIAS clearnote {#DELNITEM Notepad %1}
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Mon Jan 31, 2005 9:13 pm   **SOLVED**
 
The irony here, is that i tried both of those methods LB, and neither worked. had to clear the notepad var and THEN it worked. *shrug*
Thanks tons to both Vorax and LB!.
And I hope that all of this helped Caharin.
_________________
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