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 ➜ General ➜ Please help me with those triggers / timers

Please help me with those triggers / timers

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


Posted by Rjak   Romania  (42 posts)  Bio
Date Mon 27 Mar 2006 01:29 PM (UTC)

Amended on Mon 27 Mar 2006 02:50 PM (UTC) by Rjak

Message
In the mud I play I can "offer <mob> <amount> <item>" to buy an item he's wearing. That self-trains commercial skills like "basic trading", "barter", "enlightement purchasing" and so on.
So I "hired" a mob, I gave him some cheap items (aka a jacket and a lantern) and I started... but something goes wrong.
This is basically because the mob can say "no" to my offer. In that case I have to "assuage" him and try again. Is like this:

Quote:

l hop
A dirty punk with pants that are six sizes too big.
A hip hopper is in excellent condition.

a hip hopper is using:
<worn on body> a scuffed leather jacket
<held in hand> a lantern (glow)

offer hopper 10000 jacket
offer hopper 10000 lantern
You attempt to offer a hip hopper a sum of 10000 bucks for 'jacket'.
You attempt to offer a hip hopper a sum of 10000 bucks for 'lantern'.

A hip hopper frowns.
A hip hopper says 'Fuckin A!'

A hip hopper whispers to you, 'Ok Hayd.. for 10000 bucks it's yours.'
A hip hopper gives you a lantern.


I've set a trigger for "A hip hopper frowns." (memo hopper / assuage hopper) but I'm supposed to end the loop. So I have to "offer" again, but the mob can say "no" at any of the items.
Bottom line, those are the triggers I have. My problem: the commands are too many. Are kinda overloading the client. If in the meantime I become hungry or thirsty, the coresponding triggers are firing, but my character uses them after 5 mins or even more.

<triggers>
  <trigger
   enabled="y"
   match="*hip hopper frowns."
   sequence="100"
   other_text_colour="black"
   other_back_colour="black"
  >
  <send>give jacket hopper
give lantern hopper
o hopper wear all
memo hopper
assua hopper
offer hopper 10000 jacket
memo hopper
assua hopper
offer hopper 10000 lantern</send>
  </trigger>
</triggers>

<triggers>
  <trigger
   enabled="y"
   match="*hip hopper gives you a lantern."
   sequence="100"
   other_text_colour="black"
   other_back_colour="black"
  >
  <send>give lantern hopper
o hopper wear lantern
memo hopper
assua hopper
offer hopper 10000 lantern</send>
  </trigger>
</triggers>

<triggers>
  <trigger
   enabled="y"
   match="*hip hopper gives you a scuffed leather jacket."
   sequence="100"
   other_text_colour="black"
   other_back_colour="black"
  >
  <send>give jacket hopper
o hopper wear jacket
memo hopper
assua hopper
offer hopper 10000 jacket</send>
  </trigger>
</triggers>


I also have timers that are "supposed" to make my character sleep at every 5 minutes and wake up at every 6, but because of so-called overloading with commands are no longer usefull. Here are the timers:


<timers>
  <timer enabled="y" minute="5" >
  <send>sleep</send>

  </timer>
</timers>

<timers>
  <timer enabled="y" minute="6" >
  <send>wake
stand
give jacket hopper
give lantern hopper
o hopper wear all
memo hopper
offer hopper 10000 jacket
offer hopper 10000 lantern</send>

  </timer>
</timers>



Please, give me some help. Thank you.
Top

Posted by Rjak   Romania  (42 posts)  Bio
Date Reply #1 on Tue 28 Mar 2006 02:14 PM (UTC)
Message
Ah, c'mon guys, help me a bit please.

Do you need more informations? My english tricked me again and what I wrote was too unclear?
Top

Posted by HealingFlame   USA  (11 posts)  Bio
Date Reply #2 on Tue 28 Mar 2006 04:10 PM (UTC)

Amended on Tue 28 Mar 2006 04:11 PM (UTC) by HealingFlame

Message
Well the one this That i did notice which mine, on something similar to this, is that the * needs a space after it, for somereason on mine it needs it.

meaning on the match line:
match="*hip hopper frowns."
try
match="* hip hopper frowns."

BUt if the anme of the mob is the same all the time then just putting in:
match="A hip hopper frowns."

Without any Wildcards like that shouldnt be a problem at all.

Usually all the * is good for is when you want to add in %1 into the send window or add something to make the trigger line happy meaning...:

Trigger:
A * * frowns. or A * frowns. or A hip * frowns.

Send:
offer %1 10000 jacket
offer %1 10000 lantern

Or something similar to this, it can be for anything really, that is all the * are good for.

Since you are not leaving the room as you said then you wouldnt need to add the * at all, since it would be the same thing over and over again.

Also....

The Timer...
Well there are a few ways of doing this....
One is to offset you timers, but a few seconds...

<timers>
<timer enabled="y" minute="5" >
<send>sleep</send>

</timer>
<timer enabled="y" minute="6" >
<send>wake
stand</send>

</timer>
<timer enabled="y" minute="6" second="5.00" >
<send>give jacket hopper
give lantern hopper
o hopper wear all</send>

</timer>
<timer enabled="y" minute="6" second="10.00" >
<send>memo hopper
offer hopper 10000 jacket
offer hopper 10000 lantern</send>

</timer>
</timers>


Try that and see if that works, if it doesnt then come on back... it should help out.

And I hope It did help.

-HF
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #3 on Tue 28 Mar 2006 08:30 PM (UTC)
Message
One thing you could look at is this post of mine:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=4957

That presents a way of doing a simple loop with pauses (in Lua) rather than trying to do lots of triggers and trying to work out what to do next.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Rjak   Romania  (42 posts)  Bio
Date Reply #4 on Mon 03 Apr 2006 09:19 AM (UTC)
Message
@HealingFlame
I've put * without space because of 2 reasons:

1) Mud does not ALLWYAS start the sentence with a "clean line" sometimes placed them at the end of the prompt, sometimes no. It can be:
<100F 40B 200E 200S>A hip hopper jumps.
or it can be:
<100F 40B 200E 200S>
A hip hopper jumps.

I don't know why is doing this... is annyoing, I have to think all the triggers in a way to avoid this.

@Nick Gammon
Even I understanded the logic and the concept of "wait_for_something_to_happen_or_not", my lack of skills in programming languages put me in imposibillity to realise that.

It seems I have to stick with my buggy timers and triggers.
Thank you for answers and for your time.
Top

Posted by HealingFlame   USA  (11 posts)  Bio
Date Reply #5 on Mon 03 Apr 2006 10:55 AM (UTC)
Message
1) Mud does not ALLWYAS start the sentence with a "clean line" sometimes placed them at the end of the prompt, sometimes no. It can be:
<100F 40B 200E 200S>A hip hopper jumps.
or it can be:
<100F 40B 200E 200S>
A hip hopper jumps.

1) Yeh sometimes it doesnt depending on who did the prommpt coding in the game (this is coder wise you can control it)

2) <100F 40B 200E 200S> (taking it this is your standard prompt? meanign the one you ALWAYS use?)

I would put 2 triggers in one with the prompt (cause it wnt always be with the prompt) and one without.

match="<*F *B *E *S>A hip hopper frowns."

dont forget to keep the orginal one too. Since if it does appear on that one, it will still work. Also you might or might not want to add a space after the Prompt's >. I dont knwo excactly how it is set up on yours. If ther is no space then you shoudl be set.

Since you dont need any %'s since you arent matching thoes and it is the same mob, the *'s as wild cards just let the game show the value at any limit be it 1-as far as i know infinite.


I hoppe this helps.

-HF
Top

Posted by Rjak   Romania  (42 posts)  Bio
Date Reply #6 on Sat 08 Apr 2006 12:35 AM (UTC)
Message
I managed to solve my problem somehow...
Basically I split the entire "assuage/offer/assuage" group in about 6 different groups with separate triggers.

I suppose this is not of interest for anyone, but I tought would be polite to inform forum members about the sollution i've found.
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #7 on Sat 08 Apr 2006 12:39 AM (UTC)
Message
Glad you got it to work, shows you can do virtually anything with scripting. :)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


26,242 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.