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
➜ Is there is newbie guide to scripting?
Is there is newbie guide to scripting?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
Posted by
| Junkiee24
(24 posts) Bio
|
Date
| Reply #15 on Mon 19 Dec 2011 08:15 AM (UTC) |
Message
| i tried to copy and paste it but it was too long.. didnt let me save..
my triggers are random ones that i made for me mudding..
eg. i get a king endorsement from head; rem cd; put cd head; wear king
here is a link good for a week..
https://www.yousendit.com/download/T2dkVWRwMGsyWGUwYjhUQw | Top |
|
Posted by
| Nick Gammon
Australia (23,162 posts) Bio
Forum Administrator |
Date
| Reply #16 on Tue 20 Dec 2011 02:57 AM (UTC) |
Message
|
Junkiee24 said:
i will type <mend *> with * being the obj.
and the mud returns <You buff and polish * a bit.>
i want to keep sending <mend *> till it doesnt return the msg.
Ah, if you want it to send mend something (that would be "mend %1" to mend the first wildcard) that is easy enough.
<aliases>
<alias
match="mend *"
enabled="y"
sequence="100"
>
<send>mend %1</send>
</alias>
</aliases>
 |
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.
|
But to send this until you *don't* get a message? You are you planning for doing that? Not getting a message can't trigger anything.
Do you mean, if you don't get the message "You buff and polish (whatever) a bit." within 5 seconds? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Junkiee24
(24 posts) Bio
|
Date
| Reply #17 on Tue 20 Dec 2011 06:51 AM (UTC) |
Message
| well , by typing "mend suit" will prompt one of these responses
(not in any particular order):
"You bend suit WAY out of shape while trying to mend it!!"
"You brutally mangle suit in your attempt to mend it!!"
"You cringe at the condition of suit and you wish you had an anvil."
"You get out a huge hammer to repair suit."
"You get out a large hammer to repair suit."
"You get out a small hammer to repair suit."
"You work long and hard to make suit useable once again."
so for each of those (7) responses i made a trigger to send out "mend suit" again.
mending will either end in:
FIX IT:You look at an suit in amazement!!! It is obvious you have created a masterpiece!!
BREAK IT: The suit in your attempt to mend it and it is TOTALLY DESTROYED!!
so my problem is that for each item i mend i have to make a whole new set of these
eg;suit, sword, axe..
can i do it a simpler way?
thanks Nick. | Top |
|
Posted by
| Nick Gammon
Australia (23,162 posts) Bio
Forum Administrator |
Date
| Reply #18 on Tue 20 Dec 2011 08:24 PM (UTC) |
Message
| All you have to do is capture the line which tells you that you had problems mending <item> and mend it again, like this:
<triggers>
<trigger
enabled="y"
match="You bend * WAY out of shape while trying to mend it!!"
sequence="100"
>
<send>mend %1</send>
</trigger>
</triggers>
Now make one of those for each message. Since it matches on a wildcard, it will apply to suits, swords etc. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Junkiee24
(24 posts) Bio
|
Date
| Reply #19 on Wed 21 Dec 2011 04:00 AM (UTC) |
Message
| okay made a trig as shown for each but it doesnt work. the return after i enter mend bag comes up but doesnt trigger anything.
<triggers>
<trigger
custom_colour="2"
enabled="y"
match="You bend * WAY out of shape while trying to mend it!!"
regexp="y"
sequence="100"
>
<send>mend %1</send>
</trigger>
<trigger
custom_colour="2"
enabled="y"
match="You brutally mangle * in your attempt to mend it!!"
regexp="y"
sequence="100"
>
<send>mend %1</send>
</trigger>
<trigger
custom_colour="2"
enabled="y"
match="You buff and polish * a bit."
regexp="y"
sequence="100"
>
<send>mend %1</send>
</trigger>
<trigger
custom_colour="2"
enabled="y"
match="You cringe at the condition of * and you wish you had an anvil."
regexp="y"
sequence="100"
>
<send>mend %1</send>
</trigger>
<trigger
custom_colour="2"
enabled="y"
match="You get out a huge hammer to repair *."
regexp="y"
sequence="100"
>
<send>mend %1</send>
</trigger>
<trigger
custom_colour="2"
enabled="y"
match="You work long and hard to make * useable once again."
regexp="y"
sequence="100"
>
<send>mend %1</send>
</trigger>
<trigger
custom_colour="2"
enabled="y"
match="You get out a large hammer to repair *."
regexp="y"
sequence="100"
>
<send>mend %1</send>
</trigger>
<trigger
custom_colour="2"
enabled="y"
match="You get out a small hammer to repair *."
regexp="y"
sequence="100"
>
<send>mend %1</send>
</trigger>
</triggers>
| Top |
|
Posted by
| Nick Gammon
Australia (23,162 posts) Bio
Forum Administrator |
Date
| Reply #20 on Wed 21 Dec 2011 04:38 AM (UTC) |
Message
| Well, not exactly as shown. I did not have "regular expression" checked, and you do have. Try doing without checking regular expressions.
Why did you change that, when it worked without it? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Junkiee24
(24 posts) Bio
|
Date
| Reply #21 on Thu 22 Dec 2011 08:27 AM (UTC) |
Message
| okay changing to regular expression puts the item as "a bag"
so when it triggers the return to be "mend a bag", which doesnt work. | Top |
|
Posted by
| Junkiee24
(24 posts) Bio
|
Date
| Reply #22 on Sun 25 Dec 2011 06:29 AM (UTC) |
Message
| Nick,
NM i got it going.. thanks a bunch!
Merry xmas! | 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.
67,534 views.
This is page 2, subject is 2 pages long:
1
2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top