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 ➜ Simple quaff script

Simple quaff script

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


Posted by Tetnao   (8 posts)  Bio
Date Sat 14 Aug 2010 04:34 PM (UTC)

Amended on Sat 14 Aug 2010 04:37 PM (UTC) by Tetnao

Message
Hi,

I'm totally new to scripting, looking at making a very simple script to get started, really appreciate any help that I can get :)

1. I want to have a variable called healpot.
2. I need an alias which can take in a variable and store it, something like 'healpot <the name of the pot here>' so I can change the type of pot I will be using as I progress in levels.
3. Finally I need an alias 'heal' which will send 'quaff <the current healing pot I've assigned to the healpot variable>'

I saw some examples on the forums but I'm finding difficulty in understanding how things work..

Here is what I did:
1. I created a variable in MUSH called healpot, and set its value to "critical healing potion".
2. Then I go to aliases and make an alias called 'heal' I typed in 'quaff @healpot' in the big 'Send' textbox.

So what happened was it didnt recognise @healpot as a variable. When I typed 'heal', it thinks I want to quaff a potion called @healpot.

Again, any help is very much appreciated, or if anyone could just direct me to read up on something similar, would be great!

Thank you!
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 14 Aug 2010 09:18 PM (UTC)

Amended on Tue 26 Nov 2013 03:45 AM (UTC) by Nick Gammon

Message
Sounds like you are on the right track. It helps to answer why a variable wasn't expanded to see the actual aliases.

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.


My video describing a targeting alias describes something very similar (you set up a target with one alias, and use it in another):

Template:post=9616 Please see the forum thread: http://gammon.com.au/forum/?id=9616.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Tetnao   (8 posts)  Bio
Date Reply #2 on Tue 17 Aug 2010 06:58 AM (UTC)
Message
Thanks! The video was great, explained everything clearly, what I was doing wrong was I didnt expand the variables :P
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,094 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.