-> moved conf loading from core to scripts. *New DefScript call: _leaveworld.def *Fixed crash when calling _leaveworld on ~WorldSession() * some updates to internal variable name handling * added new macro: @n : newline (\n) * cleanups * added a bunch of new scripts + examples
19 lines
705 B
Modula-2
19 lines
705 B
Modula-2
#permission=255
|
|
|
|
// EXAMPLE SCRIPT!!!
|
|
// expected args:
|
|
// @def: variable name
|
|
// purpose: multiply a given variable with 3 and add 1
|
|
|
|
// this line is the most important part:
|
|
// get the name of the function calling this script,
|
|
// and modify its variable. note that we treat this variable as global!
|
|
// example: script "foo" has a variable x and calls this script with x as default argument.
|
|
// result: the variable name will be: "#foo::x"
|
|
set,v #${@caller}::${@def}
|
|
// v now stores the variable name of the var we want to change.
|
|
// side note: the # marks the var as global. if we didnt do this, the var name would be "example_3xadd1::foo::x"
|
|
|
|
// do some math
|
|
mul,{${v}} 3
|
|
add,{${v}} 1 |