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.
Entire forum
➜ MUSHclient
➜ Plugins
➜ help with lua..
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Castawaymg
(2 posts) Bio
|
Date
| Sat 25 Apr 2009 07:00 PM (UTC) |
Message
| Hi, Using nick's chat_redirector I need a script that captures these:
I'm having a hard time w/ lua, it's not a language I know and I'm on ubuntu so I can't capture to notepad at least that is my understanding (it keeps crashing even after I switch to 98 etc), so I need a lua script that captures this and redirects to a blank world.
[PKTALK A] Person: 'whatever they say.'
[PKTALK B] Person: 'whatever they say.'
[PKTALK C] Person: 'whatever they say.'
[PKTALK A] MyName: 'whatever I say' [58]
[PKTALK B] MyName: 'whatever I say' [58]
[PKTALK C] MyName: 'whatever I say' [58]
**58 changes depending on who is online
Someone tells you 'hi'
You tell Someone 'hi'
Someone shouts 'a'
[33] people heard you shout 'hi'
**Comment=(33 changes depending on the people in my area)
[ARCHON] Someone: whatever they say
[34] MyName: whatever I say
[5] alliance members heard you say, 'whatever I say'
**comment = [5] can change depending on how many people are online.
'whatever I say' you say.
You say, 'whatever I say'
[CLAN] Someone: 'whatever they say'
[5] clan members heard you say, 'whatever I say'
currently I have this from nick's previous thread:
<trigger
enabled="y"
match="^[A-Za-z]+ (says|shouts|yells|tells you) \'(.*?)\'$"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
and only tells/yells captures/works for me (think I added tells, but if someone could help me I would appreciate it, thank you
on a side note... I would like to be able to replace text in a game okay.. for example..
When I lose detect invis in the game it says:
You feel different as your senses become less heightened.
I would like to replace that line with:
**Detect Invis Gone**
Is there a way to do that? and is there a way to color it, aka make it yellow and highlight it? Is there something else similar I can do instead?
| Top |
|
Posted by
| LupusFatalis
(154 posts) Bio
|
Date
| Reply #1 on Sun 26 Apr 2009 02:13 AM (UTC) |
Message
| The highlighting I can do in python, but lua... no idea
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Saturday, April 25, 2009, 10:07 PM -->
<!-- MuClient version 4.40 -->
<!-- Plugin "HighlightDetect" generated by Plugin Wizard -->
<muclient>
<plugin
name="HighlightDetect"
id="18b515a653cab877d9c3f681"
language="Python"
date_written="2009-04-25 22:07:11"
requires="4.40"
version="1.0"
>
</plugin>
<!-- Get our standard constants -->
<include name="constants.pys"/>
<!-- Triggers -->
<triggers>
<trigger
enabled="y"
match="^You feel different as your senses become less heightened\.$"
omit_from_output="y"
regexp="y"
send_to="14"
sequence="100"
>
<send>world.NoteColourBack = 0xFF0000
world.ColourNote('#FFFF00', '', '**Detect Invis Gone** ')</send>
</trigger>
</triggers>
</muclient>
| Top |
|
Posted by
| LupusFatalis
(154 posts) Bio
|
Date
| Reply #2 on Sun 26 Apr 2009 02:25 AM (UTC) |
Message
| with respect to your first question, you will need several triggers... for example:
<triggers>
<trigger
enabled="y"
match="^\[(.+)\] (.+)\: (\'(.*)\'|\'(.*)\' \[\d+\])$"
regexp="y"
send_to="2"
sequence="100"
>
<send>FIRED!</send>
</trigger>
</triggers>
works for these types:
[PKTALK A] Person: 'whatever they say.'
[PKTALK A] MyName: 'whatever I say' [58] | Top |
|
Posted by
| Castawaymg
(2 posts) Bio
|
Date
| Reply #3 on Sun 26 Apr 2009 04:51 AM (UTC) |
Message
| Thank you.. but.. I can't use python.. it has to be lua.. from what I understand.. and that trigger just sent:
[PKTALK A] me: 'eek' [38]
FIRED!
It doesn't capture in the world window.. | Top |
|
Posted by
| LupusFatalis
(154 posts) Bio
|
Date
| Reply #4 on Sun 26 Apr 2009 05:33 AM (UTC) Amended on Sun 26 Apr 2009 05:36 AM (UTC) by LupusFatalis
|
Message
| any reason you can't use python? as far as the trigger... what would you like it to do? go to the redirect script? if so modify it like so... I don't have the script, etc... so I'm just testing to make sure the trigger I gave you would be able to capture things, etc...
<triggers>
<trigger
enabled="y"
match="^[(.+)] (.+)\: (\'(.*)\'|\'(.*)\' [\d+])$"
regexp="y"
script="redirect"
send_to="12"
sequence="100"
>
</trigger>
</triggers>
here is another you'll need...<triggers>
<trigger
enabled="y"
match="^(\w+) (say\,|tell (\w+)|says|shouts|yells|tells you) \'(.*)\'$"
regexp="y"
script="redirect"
send_to="12"
sequence="100"
>
</trigger>
</triggers>
I think this is the last one you'd need...<triggers>
<trigger
enabled="y"
match="^[\d+] (clan members|people|alliance members) heard you (shout|say\,) \'(.*)\'$"
regexp="y"
script="redirect"
send_to="12"
sequence="100"
>
</trigger>
</triggers>
| Top |
|
Posted by
| LupusFatalis
(154 posts) Bio
|
Date
| Reply #5 on Sun 26 Apr 2009 05:38 AM (UTC) |
Message
| when you edits the triggers etc... you need to make sure that the punctuation is also included...
i.e. you didn't give an example of yells
if it is like so...it will work fine... however if it is like you will have to do some minor tweaking, etc... | 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.
16,275 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top