Nyell said: I understand the 0 as false and 1 as true, but I don't know how to make an alias out of that, or what script to use for a trigger to use that information.
At a low level, 0 and 1 are just binary states. It could be off/on, in/out, or up/down - 'true' and 'false' are just meanings you apply to these bits. But high-level computer-languages* - like MUSHclient's primary scripting language, Lua - abstract the bits away, showing you only discrete types of data. 0 and 1 in Lua are just numbers, and are considered "true" in all contexts. 'true' and 'false' are their own data-type in Lua, called a boolean. The only values considered false are 'false' and 'nil'. Nil just means there basically is no value.
Now as for balance-tracking, you probably want something like this:
Trigger: You have regained balance.
Send: balance = true
Send to: Script
Trigger: <something that makes you lose balance>
Send: balance = false
Send to: Script
Alias: myattack
Send: if balance then
Send("cast foo at bar")
else
Note("Wait for your balance to come back!")
end
Send to: Script
That's the basic idea. Combat systems can be pretty tricky on some MUDs, so you might want to start with something else so you can get used to how scripting works in MUSHclient. You may also want to read the excellent "Programming in Lua" online book, which you can find here: http://www.lua.org/pil/
* "high-level" means how for away you are from the "bare metal". High-level languages, as a rule of thumb, let you do complex things in a smaller amount of code. Low-level languages, like assembly language and C, require you to spell out every single step. (These days, it's hard to believe that C was once considered fairly high-level.) |