|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Wed Jan 03, 2007 8:34 am
[1.24] {} expansion in an alias/trig/etc |
Can anyone else confirm this? say is not an alias but say2 is
Code: |
#TRIGGER "test" {test (%w)} {
say {This is a %1 example}
say2 {This is a %1 example2}
}
#ALIAS say2 {say %1} |
#ECHO test someword
outputs:
say 28 //incorrect the 28 refers to the location of STR 'This is a ' in the compiled code tab
say This is a someword example2 //Works correctly if it is an alias calling it. |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Wed Jan 03, 2007 12:48 pm |
Confirmed.
Interestingly, if you change the pattern to test ($asd) and output to 'say $asd' then it works. |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Thu Jan 04, 2007 11:08 am |
Presumably changing to a local variable works since you have no braces with the say, removing the braces from the say in nexela's code has the same result, it works. I think this would be the correct syntax too as there is no need for grouping things into one string since say has no internal meaning to CMUD and the whole lot just needs sending to the mud. The same could be done with the say2 line if the alias was modified to use %-1 or the newer %params.
|
|
_________________ Taz :) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Jan 17, 2007 8:52 pm |
Yes, it's a problem with using {} when you are not using an alias. I've added this to the bug list.
|
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Wed Jan 17, 2007 11:14 pm |
I'm not altogether certain I'd call it a bug. If all those words are meant to be sent to the mud the brackets are superfluous.
|
|
_________________ Taz :) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Jan 17, 2007 11:34 pm |
Well, I think that if I type
say {hello}
on the command line, that I expect "say {hello}" to be sent to the MUD and not "say 28". That's the bug. |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Wed Jan 17, 2007 11:49 pm |
Ah yes of course, apologies.
|
|
_________________ Taz :) |
|
|
|
|
|