| 1 |
/* |
| 2 |
Testing syntax highlighting |
| 3 |
of Ace Editor |
| 4 |
for the Linden Scripting Language |
| 5 |
*/ |
| 6 |
|
| 7 |
integer someIntNormal = 3672; |
| 8 |
integer someIntHex = 0x00000000; |
| 9 |
integer someIntMath = PI_BY_TWO; |
| 10 |
|
| 11 |
integer event = 5673; // invalid.illegal |
| 12 |
|
| 13 |
key someKeyTexture = TEXTURE_DEFAULT; |
| 14 |
string someStringSpecial = EOF; |
| 15 |
|
| 16 |
some_user_defined_function_without_return_type(string inputAsString) |
| 17 |
{ |
| 18 |
llSay(PUBLIC_CHANNEL, inputAsString); |
| 19 |
} |
| 20 |
|
| 21 |
string user_defined_function_returning_a_string(key inputAsKey) |
| 22 |
{ |
| 23 |
return (string)inputAsKey; |
| 24 |
} |
| 25 |
|
| 26 |
default |
| 27 |
{ |
| 28 |
state_entry() |
| 29 |
{ |
| 30 |
key someKey = NULL_KEY; |
| 31 |
someKey = llGetOwner(); |
| 32 |
|
| 33 |
string someString = user_defined_function_returning_a_string(someKey); |
| 34 |
|
| 35 |
some_user_defined_function_without_return_type(someString); |
| 36 |
} |
| 37 |
|
| 38 |
touch_start(integer num_detected) |
| 39 |
{ |
| 40 |
list agentsInRegion = llGetAgentList(AGENT_LIST_REGION, []); |
| 41 |
integer numOfAgents = llGetListLength(agentsInRegion); |
| 42 |
|
| 43 |
integer index; // defaults to 0 |
| 44 |
for (; index <= numOfAgents - 1; index++) // for each agent in region |
| 45 |
{ |
| 46 |
llRegionSayTo(llList2Key(agentsInRegion, index), PUBLIC_CHANNEL, "Hello, Avatar!"); |
| 47 |
} |
| 48 |
} |
| 49 |
|
| 50 |
touch_end(integer num_detected) |
| 51 |
{ |
| 52 |
someIntNormal = 3672; |
| 53 |
someIntHex = 0x00000000; |
| 54 |
someIntMath = PI_BY_TWO; |
| 55 |
|
| 56 |
event = 5673; // invalid.illegal |
| 57 |
|
| 58 |
someKeyTexture = TEXTURE_DEFAULT; |
| 59 |
someStringSpecial = EOF; |
| 60 |
|
| 61 |
llSetInventoryPermMask("some item", MASK_NEXT, PERM_ALL); // reserved.godmode |
| 62 |
|
| 63 |
llWhisper(PUBLIC_CHANNEL, "Leaving \"default\" now..."); |
| 64 |
state other; |
| 65 |
} |
| 66 |
} |
| 67 |
|
| 68 |
state other |
| 69 |
{ |
| 70 |
state_entry() |
| 71 |
{ |
| 72 |
llWhisper(PUBLIC_CHANNEL, "Entered \"state other\", returning to \"default\" again..."); |
| 73 |
state default; |
| 74 |
} |
| 75 |
} |