|
Spuck00 Newbie
Joined: 02 Jun 2006 Posts: 2
|
Posted: Fri Jun 02, 2006 6:19 pm
Tick Timmer for a random tick time |
The tick time on my mud is random every tick. I think it varries by a sec or two. What I want to do i rest the tick time to 31 every tick based on my prompt
I use one like %h/%H %m/%M %v/%V
What I want to do is reset the tick TS31? each time %m is greater than itself
%m is current mana
Im not sure how to set up the commands to store %m so that if its the same (no tick yet) nothing happens, but when %m is greater than its previous command line a tick has gone by so it resets itself |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Fri Jun 02, 2006 6:51 pm |
First you need to set-up a trigger that will match on your prompt. Going by what you described, you would most likely need a pattern of
%d/%d (%d)/%d %d/%d
Notice how the %d that corresponds to the current mana is surrounded in parenthesis. This is donde so that the value that zMUD matches in this part of the pattern is available to the commands of the trigger. Also, this trigger needs the option of Trigger on Prompt to be checked, so that it can properly recognize the line that will contain your prompt.
The next step is to put the commands for the trigger. It first needs to check the value that was match by the trigger against the last value that was matched. Let's assume that we are going to store this value inside a variable called @mana. You could do the check with an #IF, like this:
#IF (%1 > @mana) {a tick has ocurred, reset the tick time}
The %1 refers to the value that was matched by the first set of parenthesis in the pattern. In this case, this would be the current amount of mana. Now, besides comparing the current mana to the previously stored value, we must also update the variable with the value we have just seen, so that it works correctly the next time the trigger fires. This would be done after the #IF using the #VAR command, like this:
#VAR mana {%1}
This updates the value of the variable to whatever was matched in the pattern. Read more in the help file about triggers and the commands mentioned here if you don't fully understand them. Also, read the section in the help file that talks about the tick timer. It should contain references to how you would go about resetting its value. |
|
_________________ Kjata |
|
|
|
Spuck00 Newbie
Joined: 02 Jun 2006 Posts: 2
|
Posted: Fri Jun 02, 2006 7:32 pm |
Got it thanks!
|
|
|
|
|
|
|
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
|
|