Try it, it does work, with a single string argument, but variations won't:
print "hello" --> hello
print string.upper ("hello") --> error: '=' expected near 'string'
print "hello" .. " world" --> error: unexpected symbol near '..'
print 42 --> '=' expected near '42'
Quote:
I have never seen documentation on LUA where it is not using the parenthesis either ...
See:
http://www.lua.org/manual/5.0/manual.html
Section 2.5.7 - Function calls.
A call of the form f{...} is syntactic sugar for f({...}), that is, the argument list is a single new table. A call of the form f'...' (or f"..." or f[[...]]) is syntactic sugar for f('...'), that is, the argument list is a single literal string.
Well I stated that because every time I would attempt that it would complain to high heaven about missing parenthesis.
So I have never had it work without parenthesis, even on a single string argument that us unambiguous as you have stated.
I have never seen documentation on LUA where it is not using the parenthesis either, so I have ALWAYS used them, well except for my very early days of porting my scripts from VB to LUA. Boy that was a doozy of errors about missing parenthesis.
Quote: well with Nick's latest answer it is somewhat lacking, such as lacking the parenthesis ()
Actually that is a special case in Lua's syntax, left over from its data description days. You may call a function that takes only a single string as an argument without parentheses, as long as it is unambigously a function call (which it is, in this case).
Personally I prefer the parentheses because I'm so used to seeing them, but you don't technically need to use them in this particular case.
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
well with Nick's latest answer it is somewhat lacking, such as lacking the parenthesis ()
Send("kill %1")
Note("Target is %1")
that is the full syntax, and if that does not work then you might need to turn on the scripting (Ctrl+Shift+6)
and check enable script next to the pulldown list.
Amended on Wed 13 Sep 2006 08:40 AM (UTC) by Brianz19
Message
hmm..i tried that it didn't work..let me explain how my alias is set up cause that might be the problem here
so i use the numpad to move and the number 1 on numpad is set to "188"
now there are 2 alias's i have set up for just 1 of these kill alias's -->
alias : j *
send : %1
variable : target
send to : variable
and then the 2nd alias
alias : 188
send : k @target
send to : world
and it has expand variables checked.
does that change anything? i also dont want the note to be sent to the mud cause then it will waste a command ( that's what it deos when i put what you wrote in the 'send' box. also i want the message to be sent when i activate the first alias)
sorry for the trouble =[
edit: was just testing what you wrote and what is happening is when i add the note "Target is %1" it doesn't activate when i type j dog, it activates when i hit the button that actually does the kill alias which is not what i want because then it will do it every time i want to hit that target, and also it's not showing up as a world note it shows up liek this :
Well in the heat of things you can sometimes miss type something and i just want to be sure..i tried both of those things and they didn't work..i think my mushclient is using lua scripting if that helps.
that world.note thing that neofry boy said is exactly what im looking for though perhaps in a different color than white if at all possible. thx in advance
i have a couple alias's set for targets, so i type 'j dog' or whatever it sets one alias to kill dog, etc. but when i type j dog i want a message to show up saying target1 is dog or something to that effect. anyone know?
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.