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 ➜ Lua ➜ Scripting Help

Scripting Help

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


Posted by Salaz   (5 posts)  Bio
Date Thu 12 Feb 2009 03:27 AM (UTC)

Amended on Thu 12 Feb 2009 03:44 AM (UTC) by Nick Gammon

Message
This i what i'm trying to do. I play the mud Achaea as a monk and we have a certain skill called fullsense that shows you a list of people within your area. this is the format you see"

Quote:
You seek out all mental presences within your reach:
You sense Kurik at Meditation pond.
You sense Akemi at The Silverdrop Inn.
You sense Elone at A cosy teal living room (house).
You sense Arfaroth at Hillwalk Way.
You sense Brivius at Sulaiman Avenue.


So far, i've been able to create a variable containing a list of all enemies so the variabe "enemylist" has name1|name2|name3 and with:


<triggers>
  <trigger
   custom_colour="14"
   enabled="y"
   expand_variables="y"
   ignore_case="y"
   keep_evaluating="y"
   match="(@!enemylist)"
   regexp="y"
   repeat="y"
   sequence="100"
  >
  </trigger>
</triggers> 


i'm able to color anyone on that list.
But i also want to be able to announce the names of those people over a party channel when i use the fullsense ability. How would i do this?
So let say Akemi was an enemy, i want to be able to capture her name from the fullsense list and do:
Quote:
Pt Akemi at Meditation pond.

(pt = party tell)
Top

Posted by WillFa   USA  (525 posts)  Bio
Date Reply #1 on Thu 12 Feb 2009 03:34 AM (UTC)
Message
Easiest way is to change the Send To: to script, and in the send box put

SendNoEcho "partytalk %0"


%0 matches the entire line matched, so "partytalk You sense Foo at Somewhere easy to kill." will be sent to the mud. (without spamming your display)

I don't play Acachea, so substitute partytalk for the real command.
Top

Posted by WillFa   USA  (525 posts)  Bio
Date Reply #2 on Thu 12 Feb 2009 03:37 AM (UTC)
Message
Or change the pattern to be "^You sense ((@!enemylist) at .+)$"

and then

either send to World: pt %1

or send to script: SendNoEcho "pt %1"

That'll crop the You Sense
Top

Posted by Salaz   (5 posts)  Bio
Date Reply #3 on Sat 14 Feb 2009 07:06 PM (UTC)
Message
Thank you so much!
I'll be back with more questions in the near future.! :)
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.


15,820 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.