Skip to content

mwse.stack⚓︎

The stack library provides functions to interact with the mwse mwscript stack, for dealing with custom mwscript extensions.

Functions⚓︎

mwse.stack.clear⚓︎

Purges all elements from the stack.

mwse.stack.clear()

mwse.stack.dump⚓︎

Prints all values on the stack in hex format to the log file.

mwse.stack.dump()

mwse.stack.empty⚓︎

Determines if the stack is empty.

local result = mwse.stack.empty()

Returns:

  • result (boolean)

mwse.stack.popFloat⚓︎

Pops a value of mwscript type "float" off of the stack.

local unnamed1 = mwse.stack.popFloat()

Returns:

  • unnamed (number): Optional.

mwse.stack.popLong⚓︎

Pops a value of mwscript type "long" off of the stack.

local unnamed1 = mwse.stack.popLong()

Returns:

  • unnamed (number): Optional.

mwse.stack.popObject⚓︎

Pops a value of mwscript type "long" off of the stack, and tries to reinterpret as a game object.

local unnamed1 = mwse.stack.popObject()

Returns:


mwse.stack.popShort⚓︎

Pops a value of mwscript type "short" off of the stack.

local unnamed1 = mwse.stack.popShort()

Returns:

  • unnamed (number): Optional.

mwse.stack.popString⚓︎

Pops a value of mwscript type "long" off of the stack, and tries to reinterpret as a string.

local unnamed1 = mwse.stack.popString()

Returns:

  • unnamed (string): Optional.

mwse.stack.pushFloat⚓︎

Pushes a value of mwscript type "float" onto the stack.

local result = mwse.stack.pushFloat(value)

Parameters:

  • value (number)

Returns:

  • result (nil)

mwse.stack.pushLong⚓︎

Pushes a value of mwscript type "long" onto the stack.

local result = mwse.stack.pushLong(value)

Parameters:

  • value (number)

Returns:

  • result (nil)

mwse.stack.pushObject⚓︎

Pushes a value of mwscript type "long" onto the stack, which matches the address of a given game object.

local result = mwse.stack.pushObject(value)

Parameters:

Returns:

  • result (nil)

mwse.stack.pushShort⚓︎

Pushes a value of mwscript type "short" onto the stack.

local result = mwse.stack.pushShort(value)

Parameters:

  • value (number)

Returns:

  • result (nil)

mwse.stack.pushString⚓︎

Adds a string to mwse's string storage, and pushes a value of mwscript type "long" onto the stack that represents the string.

local result = mwse.stack.pushString(value)

Parameters:

  • value (string)

Returns:

  • result (nil)

mwse.stack.size⚓︎

Returns the number of elements currently on the stack.

local result = mwse.stack.size()

Returns:

  • result (number)