|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Tue Jul 20, 2004 3:59 pm
From TinyFugue to ZMud |
Been using TinyFugue for about 7 years now, and just recently converted to ZMud, so, I'm sorry if ANY questions I ask are stupid
1st question:
/def -F -mregexp -t"^Questor tells you 'of (.*) which is in the general area'" questsend=\
/if ({P2} =~ 'On the Coastfollow Road') /Coastfollow_Road%;\
/elseif ({P2} =~ 'On the Dragon Sea') /Dragon_Sea%;\
etc...
/def Coastfollow_Road=run sne
/def Dragon_Sea=run d3s2e2s3e2seswse3s2e3sws2eses
What this would do is take the (.*) and depending on what it said, speedwalk me to where it was.
How would i do this in ZMud? I got this so far:
#TRIGGER {^Questor tells you 'of %w which is in the general area'} {?}
#ALIAS {/Coastfollow_Road} {run sne}
#ALIAS {/Dragon_Sea} {run d3s2e2s3e2seswse3s2e3sws2eses}
I have looked and I can't see anything about an #elseif type command nor multiple #if statements.
BTW, after using TF for so many years, the / before everything is a habit i can't break easiy, so that's why it's there.
-----
2nd Question:
How do i add more than one space in #echos/#says?
#ECHO H E L (extraspace) L O
will just do H E L L O which is not what I asked for when i wanted H E L (extraspace) L O
Yet again, I can't find any refrence to it.
If anyone can help I would be most apprectiative. |
|
Last edited by DeathDealer on Tue Jul 20, 2004 5:04 pm; edited 2 times in total |
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Tue Jul 20, 2004 4:46 pm |
found what MIGHT be a help to me, but it still dont work.
Looking thru the forums i found out how one can nest #if's. but the trigger is still not firing.
#TRIGGER {^Questor tells you 'of %w which is in the general area'} {#if (%w = "On the Coastfollow Road") {/Coastfollow_Road};#if (%w = "On the Dragon Sea") {/Dragon_Sea}}
#ALIAS {/Coastfollow_Road} {run sne}
#ALIAS {/Dragon_Sea} {run d3s2e2s3e2seswse3s2e3sws2eses}
I thought maybe it had something to do with the alias cause i HAVE had problems with them when i had something like e;/quest i had to do, .e;/quest but I replaced #if (%w = "On the Coastfollow Road") {/Coastfollow_Road} with #if (%w = "On the Coastfollow Road") {#ECHO WHEEEE} and there was no WHEEEE echoed when i tested it.
Also tried ~' rather than ' and still not working.
SO while i am closer, I am also at a standstill :( |
|
_________________
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Jul 20, 2004 5:07 pm |
1. #TR {^Questor tells you 'of (*) which is in the general area'} {#IF ("%1" =~ "On the Coastfollow Road") {/Coastfollow_Road} {#IF ("%1" =~ "On the Dragon Sea") {/Dragon_Sea}}}
Use of false-command explained and demonstrated in #IF. Multiple or nested #IF commands is unexplained, but should be self-evident.
Use of * in trigger patterns explained in Pattern Matching.
Use of () and %1 in triggers explained in Pattern Matching.
Use of =~, the pattern-matching operator, explained in Expressions.
2. #ECHO {H E L L O}
Use of {} demonstrated in #ECHO example. Double-quotes also work. (The forum also refuses to display multiple spaces)
Learning a new scripting language can be challenging, but I think you'll find zMUD worth the effort. I strongly suggest breaking your habit of using /, which already has several uses, including the Class special-character. Making aliases which begin with / won't help. |
|
_________________ 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. |
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Tue Jul 20, 2004 5:19 pm |
Yet another followup:
Looking at the advanced triggers part of Zuggsoft I found this:
#TRIGGER {(%w) tells you} {#IF (%trigger =~ "Zugg") {#ADD NumZugg 1};#IF (trigger =~ "Darker") {#ADD NumDark 1}}
(NOTE TO ZUGG: ya got an error on the 2nd #IF. Should be (%trigger
SOOOOO, following that example, which worked because i made them #echo wheee, I made this:
#TRIGGER {^Questor tells you ~'of (%w) which is in the general area~'} {#IF (%trigger =~ "On the Coastfollow Road") {#ECHO WHEEE};#IF (%trigger =~ "On the Dragon Sea") {#EHCO BOOYAH}}
Still don't work. |
|
_________________
|
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Tue Jul 20, 2004 5:24 pm |
[quote="LightBulb"]1. #TR {^Questor tells you 'of (*) which is in the general area'} {#IF ("%1" =~ "On the Coastfollow Road") {/Coastfollow_Road} {#IF ("%1" =~ "On the Dragon Sea") {/Dragon_Sea}}}
Use of false-command explained and demonstrated in #IF. Multiple or nested #IF commands is unexplained, but should be self-evident.
Use of * in trigger patterns explained in Pattern Matching.
Use of () and %1 in triggers explained in Pattern Matching.
Use of =~, the pattern-matching operator, explained in Expressions.
Actually there are MORE than just the 2. thats why I was looking for more than that.
there are over 20 parts that it could be. I only provided 2 due to trying make the note as short as possible, tho now that seems it was a mistake :-) |
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Tue Jul 20, 2004 5:28 pm |
Opps, hit submit by mistake.
LightBulb, thanks for the help!
Winds up this is perfect:
#TRIGGER {^Questor tells you 'of (*) which is in the general area'} {#if ("%1" = "On the Coastfollow Road") {/Coastfollow_Road};#if ("%1" = "On the Dragon Sea") {/Dragon_Sea}}
#ALIAS {/Coastfollow_Road} {run sne}
#ALIAS {/Dragon_Sea} {run d3s2e2s3e2seswse3s2e3sws2eses}
where the (*)/#IF combos will be expanded on.
#2 the #ECHO {} works GREAT! thanks again!!! |
|
_________________
|
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Tue Jul 20, 2004 5:48 pm |
Small note for #ECHO {} & #ECHO "":
#echo { ###### #######} will produce:
###### #######
But #echo " ###### #######" will produce the DESIRED effect of:
###### #######
^Note: Space before the 1st # |
|
|
|
|
|