Scripting - Macro "define" and Preprocesor Functions
// TEST PREPREOCESSOR
// MACRO FUNCTIONS LOOK SUPER COOL
#define ME llGetObjectName()+"/"+llGetObjectDesc()
#define BLACK <0,0,0>
// SOME "TOY" preprocessor functions
#define SAY_TO_OWNER(s) llOwnerSay("Owner:"+s)
#define SAY_TO_AVATAR(s) llSay(0,"Avatar:"+s)
list myList = ["one", "two", "three"];
integer i = 2;
default
{
state_entry()
{
llSetText(ME,BLACK,1.0);
}
touch_start(integer x)
// Testing list reference mylist[i]
// Testing macro functions
{
SAY_TO_OWNER ("Hello owner - see this "+(string)myList[2]);
SAY_TO_AVATAR("Hello avatar");
}
}
Comments
Post a Comment