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
nutsnbolts
Apprentice


Joined: 01 May 2002
Posts: 188
Location: USA

PostPosted: Tue Jun 04, 2002 2:39 am   

Percent sign becoming period.
 
I don't know what is going on but i have a %var for something in one of my triggers.

Whenever it's triggers it's giving something like test(.var) instead. Percent doesn't seem to be understood? Are any setting incorrect?

Sup
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Jun 04, 2002 6:57 am   
 
What do you have a %var in one of your triggers for? Please provide the actual trigger so we don't have to guess.

LightBulb
Vague questions get vague answers
Reply with quote
nutsnbolts
Apprentice


Joined: 01 May 2002
Posts: 188
Location: USA

PostPosted: Tue Jun 04, 2002 12:38 pm   
 

#LOOPDB @tracked {@list = %key"("%val") "@list}
#IF (@list <> "") {
gt Tracks: @list
ct Tracks: @list ~[@maparea~]
}
#IF (@list == "") {
gt No tracks found...
ct No tracks found, ~[@maparea~]


Here it is....



Sup
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Jun 04, 2002 6:17 pm   
 
The first problem is that this is not a trigger. A trigger starts with a trigger command, usually #TRIGGER or #ACTION, followed by a trigger phrase, and then the commands to be employed. You've skipped the first two parts. You also don't have %var anywhere in the script you provided. You do have %val, and I'm guessing your first post was a typo since %val is a predefined variable and %var is not.

It would have been nice if you had taken the trouble to provide some explanation of what you are trying to do, instead of leaving it to us to try to figure out from the script. It would also have been helpful to know what all these variables are expected to contain. It's very difficult to understand scripts without the information they are based on. I did ask for an explanation as well as the script. "What do you have %var in one of your triggers for?"

It looks to me like the predefined variable, %key, has the value "test" and the predefined variable has the value ".var". This will cause the phrase
%key"("%val") "
to equal test(.var)
So the problem is in your script, and with no clue as to what you're trying to do, I can't suggest any remedy. Sorry.

Looking back at the title of the thread, I see you're concerned about the "%" turning into a ".". It's not. The % is part of "%val", which is a variable name. And it appears the contents of %val is ".var", which is a pathname.

LightBulb
Vague questions get vague answers
Reply with quote
marilyn
Newbie


Joined: 01 Jun 2002
Posts: 9
Location: USA

PostPosted: Tue Jun 04, 2002 10:02 pm   
 
quote:

The first problem is that this is not a trigger. A trigger starts with a trigger command, usually #TRIGGER or #ACTION



I do not know what nuts is trying to do either, but if you are at all familiar enough with Zmud to offer advice, you would have been able to understand that he likely did a cut and paste from the value window of the GUI trigger dialog. I don't use command-line #TR pattern {commands} form when I am making fancy triggers either. I bring up the dialog, press New, and use the GUI.

Yes.. he forgot to include what pattern he wanted to set the trigger of with.

BTW, unless I missed an update, #ACTION is the equivalent of #ALIAS, not #TRIGGER.


Mari
Jade is more than stone, more than color. It is beauty made tangible.
Reply with quote
dacheeba
Adept


Joined: 29 Oct 2001
Posts: 250

PostPosted: Tue Jun 04, 2002 10:17 pm   
 
quote:

BTW, unless I missed an update, #ACTION is the equivalent of #ALIAS, not #TRIGGER.


Mari
Jade is more than stone, more than color. It is beauty made tangible.



From #ACTION help file:
quote:

Syntax: #AC pattern command [classname]

This is the same as the #TRIGGER command. See the TRIGGER command for detailed help.



Again nutsnbolts, you have to be more specific if you want an help. You need to

1.Show us your script
2.Tell us what it suppose to do
3.Explain any variable/alias involved.
4.Explain what you think is going wrong.

Otherwise we get these really long threads of people saying 'Huh?' and asking more questions.
Reply with quote
nutsnbolts
Apprentice


Joined: 01 May 2002
Posts: 188
Location: USA

PostPosted: Tue Jun 04, 2002 11:21 pm   
 
Sorry for the confusion everyone. Combined with typo's and thoughts of the problem being a simple one, I assumed that it was just a percent not being read by zmud correctly. Like a special character problem. However, basically here is what I'm trying to do.

I have a tracking system to track players from a list I have which is in a variable. When I initiate the track of these people in the list, it stores the names in a list for when I am finished tracking everyone on the list, whatever it finds (tracks) it will then output in a channel that (x, x1, x2 person has been found).

Here is the script.

Alias
masstrack
Value
#VAR tracked ""
#VAR list ""
@stoptrack = "False"
#T+ masstrackwhite
#FORALL @tracknames {
#IF (@stoptrack =~ "False") {
track %i
#WAIT 1500
}
}
track self
#LOOPDB @tracked {@list = %key"("%val") "@list}
#IF (@list <> "") {
grouptell Tracks: @list
clantell Tracks: @list ~[@maparea~]
}
#IF (@list == "") {
grouptell No tracks found...
clantell No tracks found, ~[@maparea~]
}
#T- masstrackwhite


Here is the supplement script:

Trigger
The({ fresh | old | })tracks of (%x) appear
Value
#IF (%1 == "fresh") {#ADDKEY tracked %2 FresH}
#IF (%1 != "fresh") {#ADDKEY tracked %2 old}
gt %2 tracks %1


Well basically, I'm trying add direction to this. Right now all I have is telling me if it's old, fresh, or medium tracks found.

Here is the exact text that gets outputted.
The fresh tracks of playername appear to leave the area heading north!
The fresh tracks of playername appear to leave the area heading east!
The fresh tracks of playername appear to leave the area heading west!
The fresh tracks of playername appear to leave the area heading south!
The fresh tracks of playername appear to leave the area right below you!
The fresh tracks of playername appear to leave the area right above you!


Right now all I got working is if the tracks are fresh, old, medium but I still need to add the directions.

Sup
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Jun 05, 2002 4:15 am   
 
Yes, Marilyn, I understood that this was probably the Value (commands) portion of a trigger. However, the trigger phrase is often crucial to understanding and troubleshooting a script. When I said Nutsnbolts left out the first two parts, I recognized that this was the third part. Anyway, Dacheeba did a nice job of summing up what I was trying to say -- thanks, Dacheeba.

After looking through the whole script and figuring it out as best I can, one problem might be the variable assignment.
#LOOPDB @tracked {@list = %key"("%val") "@list}
I'd recommend using the #VAR format when concatenating several strings.
#LOOPDB @tracked {#VAR list {%key~(%val~) @list}}
Another possible problem is in the trigger, where you included the leading/trailing spaces in %1. I can't be sure without testing, but I'd expect you'd run into problems with the medium-age tracks when you just have a space -- it would be #IF ( == "fresh"} and #IF ( != "fresh"). By the way, zMUD doesn't require == for comparisons, one = is enough. Probably be best to make this two triggers.
#TR {the ({fresh|old}) tracks of (%x) appear} {#ADDKEY tracked {%2} {%1}}
#TR {the tracks of (%x) appear} {#ADDKEY tracked {%1} {old}}

That's all I could find, perhaps someone else will spot something else.

LightBulb
Vague questions get vague answers
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