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

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Is there is newbie guide to scripting?

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Is there is newbie guide to scripting?
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1  2 

Posted by Junkiee24   (23 posts)  [Biography] bio
Date Sun 25 Dec 2011 06:29 AM (UTC)  quote  ]
Message
Nick,

NM i got it going.. thanks a bunch!
Merry xmas!
[Go to top] top

Posted by Junkiee24   (23 posts)  [Biography] bio
Date Thu 22 Dec 2011 08:27 AM (UTC)  quote  ]
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.
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Wed 21 Dec 2011 04:38 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Junkiee24   (23 posts)  [Biography] bio
Date Wed 21 Dec 2011 04:00 AM (UTC)  quote  ]
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>
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Tue 20 Dec 2011 08:24 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Junkiee24   (23 posts)  [Biography] bio
Date Tue 20 Dec 2011 06:51 AM (UTC)  quote  ]
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.
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Tue 20 Dec 2011 02:57 AM (UTC)  quote  ]
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>


Template:pasting 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
[Go to top] top

Posted by Junkiee24   (23 posts)  [Biography] bio
Date Mon 19 Dec 2011 08:15 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Sun 18 Dec 2011 06:56 PM (UTC)  quote  ]

Amended on Sun 18 Dec 2011 06:57 PM (UTC) by Nick Gammon

Message
I will ask you again, please show us your trigger:

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.

- Nick Gammon

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

Posted by Junkiee24   (23 posts)  [Biography] bio
Date Sun 18 Dec 2011 11:08 AM (UTC)  quote  ]
Message
k i still dont get how to write a script..
how do you input a wildcard as a trigger..
say mending equipment..
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.
[Go to top] top

Posted by Junkiee24   (23 posts)  [Biography] bio
Date Tue 13 Dec 2011 04:18 AM (UTC)  quote  ]
Message
that link is very useful.. i dont think i got that far.
the only items i have in my world is triggers and aliases..
eg
Alias (rune) (cast 'rune')
Trigger (You get a heal from your bag) triggers (quaf heal)

i havent got to the steps on the link.. will check it out and report back.. thanks NICK!
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Mon 12 Dec 2011 05:48 AM (UTC)  quote  ]
Message
Did you look at all the "Getting Started" stuff? How about this?

http://www.gammon.com.au/forum/?id=8411

Quote:

triggers work fine.. but i cant get the script and varibles to work.. triggers and alias work fine..
i dont think i can get the wild card to work also.. is that possible?


They work but they don't work? Of course you can get wildcards to work. They are used extensively by many people.

This is all very vague without showing what you are doing, and what you are expecting to match.

Can you please copy and paste the trigger you are working on ...

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.


If it calls a script, copy and paste the script. I presume it isn't very long.

- Nick Gammon

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

Posted by Junkiee24   (23 posts)  [Biography] bio
Date Sun 11 Dec 2011 08:34 PM (UTC)  quote  ]
Message
also i dont know how to turn on the script.. in the script config page, under script prefixes its says (not active) how do i turn it on?
i tried to make a simple script comment to see it actually do something like get heal bag but it doesnt even run that..
been stuck for a while.
do you have a simple short script that works on a particular mud so i can compare and see what i am doing wrong?
[Go to top] top

Posted by Junkiee24   (23 posts)  [Biography] bio
Date Sun 11 Dec 2011 07:53 PM (UTC)  quote  ]
Message
hmm i am trying to figure out how to implement a script.
and how to run it
how can i show you what i have? email you the world i created?
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Sun 11 Dec 2011 07:43 PM (UTC)  quote  ]
Message
It would help to see what you are doing, and then we can suggest improvements:

Template:bug Please help us by advising:
  • The version of MUSHclient you are using. Use the Help menu -> About MUSHclient.
  • A copy of the trigger, alias or timer you were using (see Copying XML)
  • The output from the MUD that caused the problem
  • The error message, if any, that you got (or other relevant output)


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[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.


3,544 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]