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
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sun Sep 30, 2007 9:42 pm   

An easier way for this script? Anyone?
 
I'm writing a note ignore script for Aardwolf. Actually, I've written it, I just want to see if there's a better way to go about scripting it. Here is what a note looks like.

Code:
[#####] SoandSo: Subject
Board: Boardname
Date:  Thu Sep 27 22:38:56 2007
To:    Charneus
===============================================================================
blah blah blah


Currently, this is what my script looks like:

Code:
#CLASS {Notes}
#CLASS 0
#CLASS {Notes|Aliases}
#ALIAS note {#IF (%0) {#IF (%1="ignore") {#IF (%ismember(%proper(%2), @ignorelist)) {#deli ignorelist %proper(%2);#ECHO No longer ignoring notes from %proper(%2).} {#addi ignorelist %proper(%2);#ECHO Now ignoring notes from %proper(%2).}} {~note %0}} {#T+ {Notes|Triggers};~note;#wait 2000;#ECHO %ansi(black)Finished note}}
#CLASS 0
#CLASS {Notes|Triggers}
#TRIGGER {^~[(*)~] (%w): *} {#var notenumber %1;#IF (%ismember(%2, @ignorelist)) {#sub {};#GAGON;#var notegag 1;#wait 1000;#ECHO Note finished!} {#T- {Notes|Triggers}}}
#TRIGGER {^Note finished!$} {#IF (@notegag=1) {#GAGOFF;#var notegag 0;#ECHO Note @notenumber ignored. Type 'note read @notenumber' if you wish to read it.};#T- {Notes|Triggers}}
#TRIGGER {^~[Enter key for more or 'q' to stop~]} {q}
#CLASS 0
#CLASS {Notes|Variables}
#VAR ignorelist {}
#VAR notegag {0}
#VAR notenumber {}
#CLASS 0


And now my prompt:

Code:
[hp: 100% mp: 100% tnl: 2324 gold: 1000000 room: Casa de Fiesta align: 852 qtime: 10]


I started to make this script:

Code:
#CLASS {Notes}
#VAR notegag {0}
#ONINPUT {^note ignore} {#IF (!%0) {#SHOW %ansi(green)You are ignoring notes from:;#LOOP %numitems(@noteignored) {#SHOW %ansi(white)%i.s
 %item(@noteignore, %i)}} {#IF %ismember(%proper(%1),@noteignored) {#DELITEM noteignored %proper(%1);#SHOW %ansi(green)No longer ignoring notes from %ansi(white)%proper(%1)%ansi(green).} {#ADDITEM noteignored %proper(%1);#SHOW %ansi(green)Now ignoring notes from %ansi(white)%proper(%1)%ansi(green).}}}
#ALIAS note {#IF (!%0) {#T+ {Notes|NoteTriggers};~note} {~note %0}}
#CLASS 0
#CLASS {Notes|NoteTriggers}
#TRIGGER {^~[(*)~]%s(%w)} {#IF %ismember(%2,@noteignored) {#SUB {};notegag=1;#GAGON} {#T- {Notes|NoteTriggers}}}
#COND {^~[hp} {#IF (notegag) {notegag=0;#GAGOFF;#SHOW Note %ansi(white)%trim(%t1)%ansi(green) by %ansi(white)%t2%ansi(green) ignored. Type '%ansi(white)note read %trim(%t1) to read it.;#T- {Notes|NoteTriggers}}}
#CLASS 0


I was hoping that it would work correctly with the second code, but it doesn't seem to be working. I'm hoping now that someone could write a better script for it so that I can get rid of those waits and echoes from the first script. As you can probably tell from the script, I'm wanting to ignore notes from people I have on my note ignore list. I appreciate any and all help. :)

Charneus
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Mon Oct 01, 2007 1:30 pm   
 
Could you give us two successive notes with prompts included please?
Put whatever fake info in there that you want.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Thu Oct 04, 2007 4:03 pm   
 
Sorry for the delay - been away from a computer. Here is what you asked for (and more)...

Code:
[ 3217] Charneus: Test
Board: Personal
Date:  Thu Oct 4 22:38:56 2007
To:    Charneus
===============================================================================
This is one variation of a note. Ends on this line

[hp: 100% mp: 100% tnl: 2324 gold: 1000000 room: Casa de Fiesta align: 852 qtime: 10]


Code:
[ 3218] Charneus: Test
Board: Personal
Date:  Thu Oct 4 22:38:56 2007
To:    Charneus
===============================================================================
This is another variation of a note. Ends on a blank line


[hp: 100% mp: 100% tnl: 2324 gold: 1000000 room: Casa de Fiesta align: 852 qtime: 10]


Code:
[13218] Charneus: Test
Board: Personal
Date:  Thu Oct 4 22:38:56 2007
To:    Charneus
===============================================================================
This is yet another variation. This time, the note number fills all spaces between brackets and ends on a name.

Charneus

[hp: 100% mp: 100% tnl: 2324 gold: 1000000 room: Casa de Fiesta align: 852 qtime: 10]


As you can see, the note body itself can change depending on the person writing it. I should also note that notes have a limit of 300 lines, so if someone wants to write 300 lines of text, then they'll do it. The first script I wrote works somewhat ok for me. I just dislike having the extra triggers and wait states to echo Note finished! when I know it probably could go off my prompt. Hopefully this provides enough information to get some help on this. Thanks!

Charneus
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Oct 04, 2007 10:02 pm   
 
Actually it does seem like a prompt based trigger is right way to handle it. Your prompt trigger should handle the #GAGOFF and use an #UNGAG if necessary. You can use a variable to determine whether to send the note command again and use another for gagging control.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Oct 06, 2007 10:30 pm   
 
Thing is, I'm still having trouble with it. I figured the second script would work (and even assumed #ONINPUT would allow for multiple entries) but nothing seems to work in the second script. It's not ignoring anything. *sigh* Time to go back to the drawing board, I suppose. :)

Charneus
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