Trigger Issue (lusternia)

Posted by Acekj on Wed 10 Aug 2016 01:14 PM — 14 posts, 47,349 views.

#0
Hi all, wondering if someone could help me with this:

I've made a set of triggers in MushClient to basically rotate my influencing prompts for mobs. However, the system seems to have trouble picking up the lines that trigger the changes.

---

e.g. "You compliment" sends to script:
world.setvariable "infatt" , "admiration"

"You confide in" sends to script
world.setvariable "infatt" , "praise"

"You sing the praises" sends to script
world.setvariable "infatt" , "compliments"

then I keep hitting the alias which sends "influence @target with @infatt"

Now when I engage with mobs, it seems like it's only picking up the triggers sometimes, but not all the time. Is there something I need to change about the initial trigger line (like adding in (*.?) or ^??

Appreciate any help with this, thanks!

===

further e.g. from logs:


influence centaur with admiration
You confide in a centaur hunter how much you admire his dazzling mental and 
***CHANGING INF TO PRAISE***
physical skills.
A centaur hunter nods in agreement but avoids eye contact, looking somewhat 
embarrassed.
He pauses briefly as though considering what you said.
4260h, 3930m, 4314e, 10p, 17560en, 17560w x-

You have recovered equilibrium.
4260h, 3930m, 4314e, 10p, 17560en, 17560w ex-
influence centaur with praise
You sing the praises ((supposed to trigger here but didn't)) of the heroic exploits of a centaur hunter, recounting his 
many incredible adventures.
A centaur hunter nods in agreement but avoids eye contact, looking somewhat 
embarrassed.
He pauses briefly as though considering what you said.
4260h, 3930m, 3952e, 10p, 17560en, 17560w x-

You have recovered equilibrium.
4260h, 3930m, 3952e, 10p, 17560en, 17560w ex-
influence centaur with compliments
You compliment ((supposed to trigger here but didn't)) a centaur hunter on his outstanding intellect and physique.
A centaur hunter nods in agreement but avoids eye contact, looking somewhat 
embarrassed.
He pauses briefly as though considering what you said.
4260h, 3930m, 3653e, 10p, 17560en, 17560w x-

You have recovered equilibrium.
4260h, 3930m, 3653e, 10p, 17560en, 17560w ex-
influence centaur with admiration
You confide in a centaur hunter how much you admire his dazzling mental and 
***CHANGING INF TO PRAISE***
physical skills.
A centaur hunter puffs up his chest and a crazy gleam enters his eyes as he 
vigorously agrees with you that his intelligence and strength far surpass anyone
else's.


[EDIT] Code tags added.
Amended on Wed 10 Aug 2016 08:31 PM by Nick Gammon
Australia Forum Administrator #1
Please post the actual triggers and aliases you are using:

Template:copying
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.


Also post the actual log output (not interspersed with your comments) so we can test against it.
Amended on Wed 10 Aug 2016 08:32 PM by Nick Gammon
#2
Hi, sorry about that, and thanks for the pasting tips!

I did a few more tests and all the other influencing triggers seem to work against test mobs (for now).

Please find the triggers and output below for your reference:

 <triggers>
  <trigger
   custom_colour="5"
   enabled="y"
   expand_variables="y"
   group="InfluencingEmpower"
   ignore_case="y"
   make_underline="y"
   match="has a brave soul."
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>world.setvariable "infatt" , "compliments"
world.note "BRAVE: EMPOWER|WEAKEN"</send>
  </trigger>


  <trigger
   custom_colour="11"
   enabled="y"
   expand_variables="y"
   group="InfluencingEmpower"
   ignore_case="y"
   match="You compliment"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>world.setvariable "infatt" , "admiration"
world.note "***CHANGING INF TO ADMIRATION***"</send>
  </trigger>


  <trigger
   custom_colour="11"
   enabled="y"
   expand_variables="y"
   group="InfluencingEmpower"
   ignore_case="y"
   match="You confide in"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>world.setvariable "infatt" , "praise"
world.note "***CHANGING INF TO PRAISE***"</send>
  </trigger>
</triggers>


Example log:

influence lady with compliments
You compliment an elfen lady on her outstanding intellect and physique.
An elfen lady keeps asking herself why she considered giving so much away, and 
pays you no attention.
4260h, 3930m, 6669e, 10p, 17560en, 17560w x-

You have recovered equilibrium.
4260h, 3930m, 6807e, 10p, 17560en, 17560w ex-
influence lady with admiration
You confide in an elfen lady how much you admire her dazzling mental and 
***CHANGING INF TO PRAISE***
physical skills.
An elfen lady keeps asking herself why she considered giving so much away, and 
pays you no attention.
4260h, 3930m, 6807e, 10p, 17560en, 17560w x-

You have recovered equilibrium.
4260h, 3930m, 6807e, 10p, 17560en, 17560w ex-
influence lady with praise
You sing the praises of the heroic exploits of an elfen lady, recounting her 
***CHANGING INF TO COMPLIMENTS***
many incredible adventures.
An elfen lady keeps asking herself why she considered giving so much away, and 
pays you no attention.
4260h, 3930m, 6807e, 10p, 17560en, 17560w x-

You have recovered equilibrium.
4260h, 3930m, 6900e, 10p, 17560en, 17560w ex-
influence lady with compliments
You compliment an elfen lady on her outstanding intellect and physique.
An elfen lady keeps asking herself why she considered giving so much away, and 
pays you no attention.
4260h, 3930m, 6900e, 10p, 17560en, 17560w x-

You have recovered equilibrium.
4260h, 3930m, 6900e, 10p, 17560en, 17560w ex-


 analyze centaur
A centaur hunter has a brave soul. He is currently laidback.
BRAVE: EMPOWER|WEAKEN
4260h, 3930m, 6570e, 10p, 17560en, 17560w x-

You have recovered equilibrium.
4260h, 3930m, 6570e, 10p, 17560en, 17560w ex-

influence centaur with compliments
You compliment a centaur hunter on his outstanding intellect and physique.
A centaur hunter nods in agreement but avoids eye contact, looking somewhat 
embarrassed.
He pauses briefly as though considering what you said.
4260h, 3930m, 6284e, 10p, 17560en, 17560w x-

You have recovered equilibrium.
4260h, 3930m, 6284e, 10p, 17560en, 17560w ex-
influence centaur with compliments
You compliment a centaur hunter on his outstanding intellect and physique.
A centaur hunter nods in agreement but avoids eye contact, looking somewhat 
embarrassed.
He pauses briefly as though considering what you said.
4260h, 3930m, 5998e, 10p, 17560en, 17560w x-

You have recovered equilibrium.
4260h, 3930m, 5998e, 10p, 17560en, 17560w ex-

A centaur hunter demands of you, "What am I supposed to think of that?"
Your ego drains as you consider your response.
4260h, 3930m, 5782e, 10p, 17560en, 17560w ex-
influence centaur with admiration
You confide in a centaur hunter how much you admire his dazzling mental and 
***CHANGING INF TO PRAISE***
physical skills.
A centaur hunter nods in agreement but avoids eye contact, looking somewhat 
embarrassed.
He pauses briefly as though considering what you said.
4260h, 3930m, 5465e, 10p, 17560en, 17560w x-

You have recovered equilibrium.
4260h, 3930m, 5465e, 10p, 17560en, 17560w ex-
influence centaur with praise
You sing the praises of the heroic exploits of a centaur hunter, recounting his 
***CHANGING INF TO COMPLIMENTS***
many incredible adventures.
A centaur hunter nods in agreement but avoids eye contact, looking somewhat 
embarrassed.
He pauses briefly as though considering what you said.
4260h, 3930m, 5224e, 10p, 17560en, 17560w x-

You have recovered equilibrium.
4260h, 3930m, 5355e, 10p, 17560en, 17560w ex-
influence centaur with compliments
You compliment a centaur hunter on his outstanding intellect and physique.
A centaur hunter nods in agreement but avoids eye contact, looking somewhat 
embarrassed.
He pauses briefly as though considering what you said.
4260h, 3930m, 5099e, 10p, 17560en, 17560w x-

You have recovered equilibrium.
4260h, 3930m, 5099e, 10p, 17560en, 17560w ex-
Australia Forum Administrator #3
It seems to be working for me. In fact yours matched more than mine, in particular:


You sing the praises of the heroic exploits of a centaur hunter, recounting his 
***CHANGING INF TO COMPLIMENTS***
many incredible adventures.


Did you leave out one of the triggers?

Template:version
Please help us by advising the version of MUSHclient you are using. Use the Help menu -> About MUSHclient.
#4
Hi Nick, yes I did miss out a trigger there. I've done a few more tests and it really seems the Compliments -> Admiration -> Praise -> Compliments loop is the one with an issue.

I'm currently using Version 4.94

Not sure if its clashing with any one of my other triggers or I need to change the phrase which triggers it?

Could you also help to advise on what the difference is between a normal trigger line and a multi-trigger line, please?

Thank you for your help in advance again, sorry for the constant questions!

Please find another excerpt of all my influencing triggers and the test logs below:

(sorry I can't paste them all here as it exceeds the forum characters limit. Please find a link here:

https://docs.google.com/document/d/1hy_qqaNr-3ZVKHiXw_1_M_E3K836Y_JbAqujhuuq7Ns/edit?usp=sharing)
Amended on Fri 12 Aug 2016 04:15 PM by Acekj
Australia Forum Administrator #5
A multi-line trigger invokes a multi-line regular expression checked on the last x lines (where x is the number of lines you specify). They aren't fabulously useful, but can sometimes be used where you are looking for a certain phrase that is usually split over two lines.
Australia Forum Administrator #6
I tried your triggers and test data and it looked OK. Can you specify which one doesn't work?

I test with Ctrl+Shift+F12 (which you can too). I pasted the entire log into it, and saw quite a few matches. See which ones you think are not matching when you do that.
#7
Hi Nick,

Thanks so much for your help!! I did a bunch of testing using the ctrl+shift+f12 function and I looked through the triggers and there were some overlapping ones afterall on the exact same phrases which was causing them not to map!

Silly mistake, issue resolved thank you!!

Would you be able to point me to which docs I should begin reading first from the quicklinks at the bottom of this page to learn more about how to script around the system and about Lua? (I'm playing around with a free system for the game and would like to pick up the basics about scripting here to enhance it further. Feeling a little behind not knowing what a 'regular expression' is besides knowing it has to be ticked for most triggers to function)
Australia Forum Administrator #8
A good starting point is my page on regexps:

Template:regexp
Regular expressions
  • Regular expressions (as used in triggers and aliases) are documented on the Regular expression tips forum page.
  • Also see how Lua string matching patterns work, as documented on the Lua string.find page.



Also see my tutorials in the "Getting Started" part of this forum:

http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=120

There are some videos there which walk through some of the basics.

You could also read the documentation pages in general:

http://www.gammon.com.au/scripts/doc.php
#9
Perfect, thanks again!
#10
Hi all, just checking but I have a new issue with a further set of triggers:



<triggers>
  <trigger
   enabled="y"
   expand_variables="y"
   group="InfluenceEnd"
   match="is so caught up in admiring (himself|herself) that"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>world.setvariable "infauto" , "0"
world.enabletrigger "autoinfluence", "0"
world.note "***Influence Mode Off***"</send>
  </trigger>

  <trigger
   custom_colour="5"
   enabled="y"
   expand_variables="y"
   group="InfluencingEmpower"
   ignore_case="y"
   make_underline="y"
   match="has a brave soul\."
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>world.setvariable "infatt" , "compliments"
world.note "BRAVE: EMPOWER|WEAKEN"</send>
  </trigger>
</triggers>




These are basically to stop the auto-influencing triggers and also to solve for what the appropriate influencing attacks are for a certain mob.

Issue is, both trigger vs one mob, but not another, and I can't figure out why?



analyze centaur
A centaur hunter has a brave soul. He has an inflated sense of himself.
BRAVE: EMPOWER|WEAKEN
4380h, 3795m, 7100e, 10p, 18080en, 18080w x-

You have recovered equilibrium.
4380h, 3795m, 7100e, 10p, 18080en, 18080w ex-
influence centaur with compliments
You compliment a centaur hunter on his outstanding intellect and physique.
***CHANGING INF TO ADMIRATION***
A centaur hunter is so caught up in admiring himself that he barely notices you.
***Influence Mode Off***
4380h, 3795m, 7100e, 10p, 18080en, 18080w x-





4380h, 3965m, 3172e, 10p, 18080en, 18080w ex-
You sing the praises of the heroic exploits of a frost hag, recounting her many 
***CHANGING INF TO COMPLIMENTS***
incredible adventures.
A frost hag is so caught up in admiring herself that she barely notices you.
4380h, 3965m, 3172e, 10p, 18080en, 18080w x-

You have recovered equilibrium.
influence hag with compliments
4380h, 3965m, 3172e, 10p, 18080en, 18080w ex-
You compliment a frost hag on her outstanding intellect and physique.
***CHANGING INF TO ADMIRATION***
A frost hag is so caught up in admiring herself that she barely notices you.
4380h, 3965m, 3172e, 10p, 18080en, 18080w x-
***Influence Mode Off***

You have recovered equilibrium.
4380h, 3965m, 3172e, 10p, 18080en, 18080w ex-
analyze hag
A frost hag has a brave soul. She has an inflated sense of herself.
4380h, 3965m, 6367e, 10p, 18080en, 18080w x-
Australia Forum Administrator #11
Maybe another trigger is firing. Please use Game menu -> Trace to see what is happening.
#12
thanks, solved! another query:

what's the difference between this:

 
sub TestRoutine (a, b, c)

end sub



and

 
sub TestRoutine 

end sub



I'm looking through a script already there and can't figure out what the (a, b, c) changes?
Amended on Fri 19 Aug 2016 03:00 PM by Acekj
Australia Forum Administrator #13
I strongly advise you to change to Lua rather than VBscript. It is much easier to use in many ways, and there are quite a few extra functions in MUSHclient targetted at Lua alone.

To answer your question, trigger and alias scripts expect three arguments: name, matching_line, wildcards. That would be the (a, b, c) in your example.