Amended on Sun 12 Dec 2004 09:52 PM (UTC) by Nick Gammon
Message
I really really need a stat roller for realms of kaos, if anyone could possibly help me out I would appreciate it tons!!!! My email is just_a_chic@hotmail.com and I have msn. Thank you a lot.
I am experiencing this error message:
============================
There was a problem in script file "G:\Vault\Documents\Misc\OnStats.vbs":
==========================
just a thought.. I guess you'll need to make the label the default (for send to variable) if the new variable field is blank, to allow for existing people's scripts..
Amended on Tue 18 Feb 2003 10:29 PM (UTC) by Demonsurfer
Message
Quote: I think Demonsurfer is hanging out for that one. :)
hehe yup :)
..oh, and a new field for variable name instead of using label so 2 triggers/aliases can send to the same variable without having to add a script for one of them. :)
The ability to set variables directly from an alias is something that is planned for the next version, I think Demonsurfer is hanging out for that one. :)
I think I considered doing what you said, but gave up because of the complexity and possible bugs.
I am looking into setting variables directly from an alias in the next day or so.
Hmm. I wasn't aware that internal commands did that. But again, as I said having a command that did that 'in' scripting makes no sense anyway. The only practical use is to directly execute an alias inside another alias or a trigger. If you are coding scripting anyway, then it is quite silly to not just use the commands you need directly. It is much easier to do 'world.note blah' than 'world.interpret "/world.note blah"'. Imho anyone dumb enough to try such deserves bugs. ;) lol
The only case anyone is really worried about is like:
alias: at *
send: attack %1
alias: fl *
send: flag %1
/setvariable "Mob", %1
at %1
The idea being to avoid what would require using a script, but frankly shouldn't. Some people think it is a bit nuts to 'require' scripting or multiple aliases/triggers just to set more than one variable as and example, or just to set one in the first place. This is the only instance where it is an issue.
Though.. Didn't you add direct setting using variable names of some sort into the actual trigger text? I seem to remember that you did or where going to, but if so then it certainly isn't in the normal help file ;) and I don't remember seeing it anyplace else in examples. If it does exist it is definitely an undocumented feature. lol
main {
__if (Schrodinger_Cat is Alive or version >= "XP"){
____if version = "Vista" then Performance /= Number_of_Cores;
____call Functional_Code();}
__else
____call Crash_Windows();}
Hmmm - and if the thing being interpreted was something that called another script, even something like this?
world.Interpret "/world.note blah"
This would require another instance of the script engine to be created. I'm not saying it couldn't be done, but I think there would be places where you would get unexpected behaviour. Already MUSHclient defers things like executing scripts on an alias or trigger by queing them. I can imagine a case where if there was a world.Interpret function, a week later I would get forum posts showing how things were being executed out of sequence.
Amended on Sun 16 Feb 2003 07:35 PM (UTC) by Shadowfyr
Message
Hmm.. Well that is a potential issue, but this is a programming language we are dealing with and last I checked it was up to the coder to avoid those things. It is no different than someone accidentally creating an infinite loop in a for next statement in a sub. Both will cause a problem. After all, these are all similar issues:
1. a regexp that you forget to escape [ and ] in.
2. loops in scripts that have invalid exit code.
3. Ctrl-Enter treating (at least in one case I know of) the seperate lines not as explicit data to go to the mud, but rather as though you used a command seperator.
Using a world.interpret command 'could' present a problem and I would tend to agree that it would be a bad thing. However, as something that is processed in the 'send' field of the actual alias and can be turned off, safeguards could also be set in place to prevent it calling itself. In theory..
You could even track such inline events so that each alias called got added to a list and if at any point the same alias name came up a dialog would appear to the effect that 'a recursive call was detected and processing of the alias {name here} was terminated.', along with an error window listing the names in the list and thus how the recursion happened. Since such internal calling would be disabled unless explicitly asked for, the overhead for normal aliases and triggers that didn't use the feature should be no more than the execution time of a single 'if then'.
Actually.. The same thing could be done through world.interpret, but unless it checked to see if each command was an alias before placing it in the list, you would have to track every command. However, since the point was to avoid having to duplicate the function of an alias by calling a scipt to handle the command, such a script side method is a bit silly.
main {
__if (Schrodinger_Cat is Alive or version >= "XP"){
____if version = "Vista" then Performance /= Number_of_Cores;
____call Functional_Code();}
__else
____call Crash_Windows();}
It probably wouldn't hurt if aliases in mushclient accepted /{command} syntax and processed through the normal command interpreter (or at least the part that handles inline commands)
I'm worried about indefinite loops when you do that. eg.
Alias: X
Script: DoX
sub DoX (line, output, wildcards)
world.Interpret "X"
end sub
In this case the player types X which calls a script, the script does the (currently non-existent) Interpret function to pass the command X to the command interpreter, this calls the script, which then does X again, and so on, until the stack runs out.
Well Nosferat. Being able to do what you want is on the list and the next version 'may' include it. It is quite likely that mushclient will eventually include such, even if not in the very next version. Have some patients. ;)
Oh. And most clients that allow inline variable setting don't use syntax like $var TARGET %1. It also looks to me like an inline 'script', which means like it or not you are a scripter. ;) lol Clients that use such inlined stuff btw, are by definition slower, because they essentially process all aliases through scripting to look for commands, before actually sending any text to the mud.
It probably wouldn't hurt if aliases in mushclient accepted /{command} syntax and processed through the normal command interpreter (or at least the part that handles inline commands), but if it did, to avoid slowing the client, there would likely need to be an 'Process inline scripts' option for them that you could turn on as needed. Otherwise, the result of adding such a thing would slow down all aliased commands. Whether Nick thinks an option to enable such functionality is reasonable though... ;)
main {
__if (Schrodinger_Cat is Alive or version >= "XP"){
____if version = "Vista" then Performance /= Number_of_Cores;
____call Functional_Code();}
__else
____call Crash_Windows();}
My point is...the client should allow me to easily manipulate my variables...Thankyou for your help everyone...I have found another client...I'm not sure if it's as fast as MUSH client but in my new client I can change my variables from aliases like this
b dragon
$var TARGET %1
backstab %1
Quick and easy...the $var command works in triggers also...if I find this new client to be as fast as MUSH client I won't need to come back and learn how to script to make up for an incomplete mud client...I can see scripting for more complex things...but I won't learn to script to control variables...I'm a MUDder not a programmer Jim!
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.