[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Trigger/alias help needed

Trigger/alias help needed

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


Posted by Victory   USA  (16 posts)  [Biography] bio
Date Wed 12 Jun 2002 05:34 AM (UTC)
Message
i've tried, i can't script, thats final! anyone willing to help me make this work?
the farsight trigger i need..

need it to turn on when i type fs

cast "farsight"

need it to match
You can momentarily see in all directions..

trigger on
*Baron Dude* <some place>

send
gtell *Baron Dude <place>

and then turn itself off.

any help is appriciated..
-Vic
[Go to top] top

Posted by Nick Gammon   Australia  (22,989 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Wed 12 Jun 2002 05:56 AM (UTC)
Message
The first part is easy, the alias:


<aliases>
  <alias
   match="fs"
   enabled="y"
  >
  <send>cast &quot;farsight&quot;</send>
  </alias>
</aliases>


Quote:

need it to match

You can momentarily see in all directions


What do you want to do when that matches? Turn on detection of Baron Dude?

Now for the triggers:


<triggers>
  <trigger
   custom_colour="1"
   match="^\*Baron Dude\* (.*?)$"
   name="BaronDudeTrigger"
   regexp="y"
   script="OnBaronDudeTrigger"
   sequence="100"
  >
  <send>gtell *Baron Dude* %1</send>
  </trigger>
  <trigger
   custom_colour="2"
   enabled="y"
   match="You can momentarily see in all directions"
   name="FarSiteTrigger"
   regexp="y"
   script="OnFarSiteTrigger"
   sequence="100"
  >
  </trigger>
</triggers>


And a bit of scripting to make it work ...


sub OnBaronDudeTrigger (sName, sLine, wildcards)
  world.enabletrigger "BaronDudeTrigger", vbFalse
end sub

sub OnFarSiteTrigger (sName, sLine, wildcards)
  world.enabletrigger "BaronDudeTrigger", vbTrue
end sub

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,989 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Wed 12 Jun 2002 06:29 AM (UTC)
Message
And just to give you an idea of how that will look when plugins work, here is the same thing as a plugin ...


<muclient>
<plugin 
  name="Baron_Dude"
  author="Nick Gammon"
  language="vbscript"
  purpose = "Find that Baron Dude"
  id = "5ba4633a105829f800796d53"
  >
</plugin>

<aliases>
  <alias
   match="fs"
   enabled="y"
  >
  <send>cast &quot;farsight&quot;</send>
  </alias>
</aliases>

<triggers>
  <trigger
   custom_colour="1"
   match="^\*Baron Dude\* (.*?)$"
   name="BaronDudeTrigger"
   regexp="y"
   script="OnBaronDudeTrigger"
   sequence="100"
  >
  <send>gtell *Baron Dude* %1</send>
  </trigger>
  <trigger
   custom_colour="2"
   enabled="y"
   match="You can momentarily see in all directions"
   name="FarSiteTrigger"
   regexp="y"
   script="OnFarSiteTrigger"
   sequence="100"
  >
  </trigger>
</triggers>

<script>
sub OnBaronDudeTrigger (sName, sLine, wildcards)
  world.enabletrigger "BaronDudeTrigger", vbFalse
end sub

sub OnFarSiteTrigger (sName, sLine, wildcards)
  world.enabletrigger "BaronDudeTrigger", vbTrue
end sub
</script>

</muclient>

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Victory   USA  (16 posts)  [Biography] bio
Date Reply #3 on Wed 12 Jun 2002 03:42 PM (UTC)
Message
thanks, but something is wrong..

You can momentarily see in all directions..
*Baron Beaver* Entrance to the Training Tower
gtell {RNAME:{Y *Baron Beaver* Tower Entrance to the Training* Tower

*Lord Michelangelo* Main Street of Cairn
*Duke Yang* Entrance to the Training Tower
*Duke Booyah* Entrance to the Training Tower

doesn't do them all, any ideas?
[Go to top] top

Posted by Victory   USA  (16 posts)  [Biography] bio
Date Reply #4 on Wed 12 Jun 2002 03:47 PM (UTC)
Message
it'll do the other names also, but it only does the first on in the output, such as that one was *Baron Beaver*, next time around it does *Duke Yang* and so on, but it will not send all the names..
[Go to top] top

Posted by Nick Gammon   Australia  (22,989 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Thu 13 Jun 2002 09:38 PM (UTC)
Message
When you said:

trigger on
*Baron Dude* <some place>

I thought you only wanted that guy. Maybe if you said:

*<some person>* <some place>

Anyway, change the name to a wildcard, and to stop it only doing the first, remove the script reference (which was turning off the trigger), like this:


<triggers>
  <trigger
   custom_colour="1"
   match="^\*(.*?)\* (.*?)$"
   regexp="y"
   sequence="100"
  >
  <send>gtell *%1* %2</send>
  </trigger>
</triggers>

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Slickricksc777   (5 posts)  [Biography] bio
Date Reply #6 on Mon 03 Feb 2003 01:37 AM (UTC)
Message
i have a hunt comand that hunts multiple enemies and creatures

ex: You see tracks of *Baron Whoever* leading west from here.

to

gtell tracks of *Baron Whoever* > west (or whatever direction)

but i dont want to pick up creatures that dont have astricks around them
[Go to top] top

Posted by Hobson   USA  (6 posts)  [Biography] bio
Date Reply #7 on Mon 03 Feb 2003 02:45 AM (UTC)
Message
Yo Victory do you play AoW cause that looks really fimalliar
[Go to top] 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.


17,522 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]