Simple quaff script

Posted by Tetnao on Sat 14 Aug 2010 04:34 PM — 3 posts, 15,491 views.

#0
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!
Amended on Sat 14 Aug 2010 04:37 PM by Tetnao
Australia Forum Administrator #1
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.
Amended on Tue 26 Nov 2013 03:45 AM by Nick Gammon
#2
Thanks! The video was great, explained everything clearly, what I was doing wrong was I didnt expand the variables :P