OK, I'm trying to learn how to use MUSHCLient after years of using zMUD, and while there are a lot of similarities, there are alos a lot of differences, and I have some questions I would like answered regarding how to work with variables.
1. How can I set the value of multiple *world* variables from a single trigger? I want to fill variables such as currentHP, maxHP, and percentHP with a trigger that matches on my prompt. Example prompt text is (without quotes): "<HP: 3229/3229 | SP: 1235/1235 | AP: 983/1080>". Previous attempts I've made at making such a trigger seems to fail to create world variables, and instead is (I believe) creating local variables only. This isn't what I want, so how can I make it fill the value of existing world variables that I've created using the Variables dialog? This is also what I need to learn for question 3 (below).
2. In the same prompt trigger (above) I want to calculate and fill percentHP based on the values of currentHP and mxHP. I presume that I need to do this using the ToNumber() function to convert the untyped or string variable to a number, then make the calculation, then set the value of the variable equal to the result of the calculation, but I'm not totally sure how to go about that. Assuming that the values of the world variables for currentHP and mxHP have been correctly defined and saved before the calculation, could I use something like the following:
percentHP = ToNumber(@currentHP)/ToNumber(@maxHP)
...Naturally, I would need to change the syntax of the variable assignment to assign to the world variable "percentHP" rather than creating a local variable.
3. I want to be able to use a single alias to both set the value of a variable AND execute a command to the world. Example follows:
<aliases>
<alias
match="bs *"
enabled="y"
echo_alias="y"
expand_variables="y"
variable="target"
send_to="12"
keep_evaluating="y"
sequence="100"
>
<send>target = %1
Execute("tech backstab %1")</send>
</alias>
</aliases>
...In the above alias example, I want to set the variable named "target" to equal the string matched by the wildcard. The execution works, but the variable is not changed. I suspect this is because it is creating a local variable rather than changing the value of the variable that already exists in the world, so how can I direct it to change the existing world variable?
I did some forum searching in all of the MUSHClient sub-sections (like "General" and such), but didn't find any relevant answers, and the help files (documentation) only seems to provide the most basic information, and I didn't notice any information on how to handle the difference (if any) regarding proper syntax for a script file vs. proper syntax for an alias or trigger creation via the dialog window.
Thanks for any help you can give to help me fugure this out,
Drake
P.S. Sorry if this is in the wrong forum, by all means feel free to move it if it isn't.
1. How can I set the value of multiple *world* variables from a single trigger? I want to fill variables such as currentHP, maxHP, and percentHP with a trigger that matches on my prompt. Example prompt text is (without quotes): "<HP: 3229/3229 | SP: 1235/1235 | AP: 983/1080>". Previous attempts I've made at making such a trigger seems to fail to create world variables, and instead is (I believe) creating local variables only. This isn't what I want, so how can I make it fill the value of existing world variables that I've created using the Variables dialog? This is also what I need to learn for question 3 (below).
2. In the same prompt trigger (above) I want to calculate and fill percentHP based on the values of currentHP and mxHP. I presume that I need to do this using the ToNumber() function to convert the untyped or string variable to a number, then make the calculation, then set the value of the variable equal to the result of the calculation, but I'm not totally sure how to go about that. Assuming that the values of the world variables for currentHP and mxHP have been correctly defined and saved before the calculation, could I use something like the following:
percentHP = ToNumber(@currentHP)/ToNumber(@maxHP)
...Naturally, I would need to change the syntax of the variable assignment to assign to the world variable "percentHP" rather than creating a local variable.
3. I want to be able to use a single alias to both set the value of a variable AND execute a command to the world. Example follows:
<aliases>
<alias
match="bs *"
enabled="y"
echo_alias="y"
expand_variables="y"
variable="target"
send_to="12"
keep_evaluating="y"
sequence="100"
>
<send>target = %1
Execute("tech backstab %1")</send>
</alias>
</aliases>
...In the above alias example, I want to set the variable named "target" to equal the string matched by the wildcard. The execution works, but the variable is not changed. I suspect this is because it is creating a local variable rather than changing the value of the variable that already exists in the world, so how can I direct it to change the existing world variable?
I did some forum searching in all of the MUSHClient sub-sections (like "General" and such), but didn't find any relevant answers, and the help files (documentation) only seems to provide the most basic information, and I didn't notice any information on how to handle the difference (if any) regarding proper syntax for a script file vs. proper syntax for an alias or trigger creation via the dialog window.
Thanks for any help you can give to help me fugure this out,
Drake
P.S. Sorry if this is in the wrong forum, by all means feel free to move it if it isn't.