ID:1861176
 
(See the best response by Lummox JR.)
Code:
macro
SHIFT+Click(StoneFloor) return usr << "you pressed Shift + Click";
SHIFT+u return usr << "you pressed Shift + u";
u return usr << "you pressed u";


Ilumination system(v1).dm:2:error: return: expected end of statement
Ilumination system(v1).dm:3:error: return: expected end of statement


Hi everyone, i just want to know why i get these two errors?
I mean why i get them when i use the "SHIFT"

You can't use output operators in macros. All you should have is return followed by the verb.
Umm.. i dont know what you mean, i know that after the "return", you could return a verb, but i have been testing it and i get other error...
macro
//SHIFT+Click(StoneFloor) return usr << "you pressed Shift + Click";
//SHIFT+u return usr << "you pressed Shift + u";
u return "Examine()"; // im returning a verb
obj
verb
Examine()
var
txt as text
txt = "You stare at the wall.";

Error:
Ilumination system(v1).dm:10:warning: txt: variable defined but not used
Ilumination system(v1).dm:5:error: return"Examine()": instruction not allowed here
Macro instructions belong in .dms files which have been phased out for the new interface macro editor.

If you absolutely want to, you'll need to create a .dms (Script) file in Dream Maker. Set your macro instructions in that, and your verbs to follow in your regular .dm files.

Because of the error "Ilumination system(v1).dm" I see you're not putting the macro instruction in a .dms file, and instead are putting it in a .dm file.

DMS FILE:
macro
u return "outputMacro u"
SHIFT+u return "outputMacro SHIFT+u"


DM FILE:
mob
verb
outputMacro(var/macro as text)
if(macro == "u")
src << "You pressed u"
if(macro == "SHIFT+u")
src << "You pressed SHIFT and u!"


I believe if you have an interface file, this will make your macro script null and inoperable.
Best response
.dms files are still relevant to the webclient. The correct syntax for returning a macro, however, would be this:

macro
u return "Examine"

It has to be the same way you'd type it on the input line.

A macro block does not go in a .dm file; it goes in a .dms file. Or, you can just define macros in your skin and then you don't need to use a .dms file. That's why the error on line 5 is appearing.

The reason you have a warning on line 10 is that you're not doing anything with that var. You're assigning it a value that isn't actually being used, and the compiler is smart enough to notice.
Yes, it works, but i have a problem when i add a SHIFT+Click() macro, what should i do in that case?
...
also, maximus, when i put your code in dm and i compile it, it says there is an error in the line 5 in the dm code file.
In response to Stroop
You'll want to use MouseDown (client) and pass that as probably a client variable through a verb like the others.

Basically, when you use Shift set a variable client.shift_down to true. Then under client Click() check if client.shift_down is true and proceed. So, Shift could be a macro of it's own. Then just alter Click() to handle accordingly.