Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Plugins ➜ trigger script and or plugin help

trigger script and or plugin help

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Shave Your Leges   (6 posts)  Bio
Date Sat 16 Apr 2005 10:36 AM (UTC)
Message
I play at a Large mud 300-500 peeps on at most times

I don't know much about scripts triggers and plugins i just started trying to learn today but it's a pain. Anyways i was wondering if anyone could help me with a few things i'd like to have if anyone has something similar. (took me 1 hour to get level_timer plugin to work) ps is there a way to add seconds to that?

1. Exp & Gold per hour
2. Damage done during fight. [1109]&Dam done by groupy
<6594hp 3116mn 4644mv WUD 2415tnl -865>
Your miasma of pain does UNTHINKABLE things to an ugly harpy! [1109]
An ugly harpy's body is wracked with pain as it drops to the ground!
You receive 10+1 experience points.
You receive 11 experience points because of double exp.
You get 333 gold coins from the twisted corpse of an ugly harpy.
Mota gives you 88 gold coins for your twisted corpse of an ugly harpy.

Thanx for reading, these are just things i've seen while grouping with others. I don't where i would start =(

Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #1 on Sat 16 Apr 2005 06:26 PM (UTC)

Amended on Sat 16 Apr 2005 06:27 PM (UTC) by Flannel

Message
If you're just keeping track of stuff earned (especially if the numbers are given and not masked as words) then it's just triggers incrementing a variable. And then you could have a timer to reset that variable (every hour, or whatnot).

As for triggers match text, there are plenty of examples in the forums, however, all you really need to do is figure out what changes, and what doesn't. For instance:
You receive 11 experience points because of double exp.
becomes
You receive * experience points because of double exp.
and then you'd access it with %1 in the send box.
And you'll have to watch out for other things (like mob names):
You get * gold coins from the twisted corpse of an ugly harpy.
Will only work on that type of mob, assuming every corpse is a 'twisted corpse' then this would be it:
You get * gold coins from the twisted corpse of a*.
Since, not only will the "ugly harpy" change, but also the a/an.

With damage this gets even more complicated:
Your miasma of pain does UNTHINKABLE things to an ugly harpy! [1109]
needs to become:
Your * does * to a*! [*]
and then you'd use %4 (since its the fourth wildcard). But that trigger may not work, since that might not be a correct generalization of the line.

Group damage will become even more complicated (what does other people doing damage look like?) because you'll need to keep track of who is and isn't in your group. Which isn't too hard, and there's lots of examples of it.

But first just try and get the gold thing working, since it's pretty straightforward.

The adding of the variable can be done like this:
Setvariable "GoldEarned", CInt(GetVariable("GoldEarned")) + %1
provided that %1 is the other number.
You can also use @GoldEarned to get the value (but not set it) if you check the 'expand variables' box.
SetVariable "GoldEarned", CInt(@GoldEarned) + %1
Those are both in VBscript, put them in the 'send' box of the triggers and change the 'sendto' to script (it's the dropdown box).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Shave Your Leges   (6 posts)  Bio
Date Reply #2 on Sat 16 Apr 2005 07:48 PM (UTC)
Message
Thanx alot i got a little of that and lost alot =)

i've got the triggers lines down i think now i just need help with everything else, i don't know how to set timers, add two lines together and stuff like that

i'd like.
You get * gold coins from the * corpse of a*.
+
Mota gives you * gold coins for your * corpse of a*.
&
You receive *+* experience points.
+
You receive * experience points because of double exp.
to send msg "gt # of gold coins, # of exp Last hour

i don't know if plurals matter, cuz coins can be coin and points can be point rare but does happen


I think this is what would be needed for the damage thingy and your right it is even more confusing =(

[4] Your beating does UNBELIEVABLE things to a flying monkey! [2269] <--damage numbers to add(every thing with a star changes and the number of words(stars) are not always the same.)



[*] Your * * * * a* * *! [*] (1)
sometimes it looks like:
Your * * * * * * * a* *! [*] (2)
end on "You receive * experience points"
start message would look like (1) or (2)

Thanx for reading again, I know i sound real newbish.. well cuz i am day two of trying to understand this. i should beable to figure out the rest on my own.

Thanx flannel









Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #3 on Sun 17 Apr 2005 05:50 PM (UTC)
Message
Your solution will obviously be regular expressions. In Mushclient, we use PCRE (Perl Compatible Regular Expressions) and not posix. Theres a good rundown of them in the docs directory in your mushclient folder. And an expanded list thing in the VBScript/JScript documentation, which you can download on the page before you get to the list of functions for mushclient. (Mushclient Forum > Script Functions at the top, scroll down a little).
It will give you some good documentation on VB and JScript.

Regular Expressions will allow you to narrow down * wildcards into matching only certain values. So things can be a list of things (like damage messages) or certain types (numbers vs words).

With regular expressions you can even allow for the messages to be plural or singular, by having an optional s.

To answer your first question, provided you have the addition and stuff already, you can simply add this next line to the bottom of your triggers (that use send to script):
send "gt @goldEarned, @expEarned Last Hour"
or if you don't use send to script, you can just send this:
gt @goldEarned, @expEarned Last Hour
Presuming "expand variables" is checked in your trigger

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Shave Your Leges   (6 posts)  Bio
Date Reply #4 on Sun 17 Apr 2005 11:51 PM (UTC)
Message
Thanx again. trigger's working fine.

Could you tell me how i would get a variable to reset on a timer. (i think it's a variable the number that keeps adding)
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #5 on Mon 18 Apr 2005 04:09 AM (UTC)
Message
You mean a trigger to reset it? Or so that you can change the number of seconds it takes to fire?

To do the latter (and have any sense of sanity) you'll need to do both (well, not nessisarily with a trigger).

You'll need to have a label for your timer, and then you'll use settimeroption to change the length of time for your timer.
The page on SetTimerOption has an example (it sets the minutes to five). After you do that, you should reset the timer (using resettimer) to reset the counter back to zero (so it's a full duration, timers get wierd if you change their values mid count and then expect them to still work without resetting them).

So your line will be:
SetTimerOption "[timername]", "[H/M/S]", "amount"
ResetTimer "[timername]"

And remember, all it does is change the specific item to that amount (if you have a timer that is 30s and you set the minutes to 1, your timer now fires every 1:30, so you might need to use a few setTimerOptions to get what you need, and you'll only need to reset the timer once, after everything is changed).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


19,124 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.