Overview

Namespaces

  • aliuly
    • common
      • selectors
    • loader
  • xPaw

Classes

  • ArmorItems
  • BasicCli
  • BasicHelp
  • BasicPlugin
  • ChatSession
  • Cmd
  • CmdSelector
  • ExpandVars
  • FastTransfer
  • FileUtils
  • FreezeSession
  • GetMotd
  • GetMotdAsyncTask
  • InvisibleSession
  • InvUtils
  • ItemName
  • mc
  • mc2
  • MoneyAPI
  • MPMU
  • Npc
  • PermUtils
  • PluginAsyncTask
  • PluginCallbackTask
  • PMScript
  • QueryAsyncTask
  • Rcon
  • RconTask
  • Session
  • ShieldSession
  • ShoppingCart
  • SignUtils
  • SkinUtils
  • SpySession
  • SubCommandMap
  • TPUtils
  • Overview
  • Namespace
  • Class

Class PMScript

Class that implements a PocketMine-MP scripting engine

Namespace: aliuly\common
Located at aliuly/common/PMScript.php
Methods summary
public
# __construct( pocketmine\plugin\Plugin $owner, boolean|aliuly\common\ExpandVars $vars = true, boolean $perms = true, integer $selector = 100 )

Parameters

$owner
  • plugin that owns this interpreter
$vars
  • allow for standard variable expansion
$perms
  • allow the use of Cmd::opexec
$selector
  • if 0, command selctors are not used, otherwise max commands
public
# exec( pocketmine\command\CommandSender $ctx, str $cmdline, array $vars )

Execute a command

Execute a command

Parameters

$ctx
  • Command context
$cmdline
  • Command to execute
$vars
  • Variables table for variable expansion
public static
# getCommonInterp( pocketmine\plugin\Plugin $owner )

If GrabBag is available, try to get a single shared instance of PMScript

If GrabBag is available, try to get a single shared instance of PMScript

public
# define( str $str, mixed $value )

Define additional constants on the fly...

Define additional constants on the fly...

Parameters

$str
$name
$value
public
# getOwner( )

Return plugin owner

Return plugin owner

public
# getServer( )

Return server

Return server

public mixed
# getGlob( str $label, mixed $default )

Parameters

$label
  • global variable to get
$default
  • default value to return is no global found

Returns

mixed
public mixed
# setGlob( str $label, mixed $val )

Set global variable

Set global variable

Parameters

$label
  • state variable to set
$val
  • value to set

Returns

mixed
public
# unsetGlob( str $label )

Clears a global variable

Clears a global variable

Parameters

$label
  • state variable to clear
public
# runScriptFile( pocketmine\command\CommandSender $ctx, callable $path, array & $args, array & $opts )

Run a script file

Run a script file

Parameters

$ctx
  • Command context
$path
$php - Loaded PMScript
$args
  • Command args
$opts
  • Some environemnt variables
public
# loadScriptFile( str $path, boolean $cache = false )

load a script from file (May implement a cache in the future...)

load a script from file (May implement a cache in the future...)

Parameters

$path
  • path to file to load
$cache
  • enable/disable caching
public
# runScriptCode( pocketmine\command\CommandSender $ctx, callable $pmscode, array & $args, array & $opts )

Execute a PMScript

Execute a PMScript

Parameters

$ctx
  • Command context
$pmscode
$php - Loaded PMScript
$args
  • Command args
$opts
  • Some environemnt variables
public
# executeScript( pocketmine\command\CommandSender $ctx, callable $php, array & $args, array & $opts )

Execute preloaded PHP code

Execute preloaded PHP code

Parameters

$ctx
  • Command context
$php
  • Loaded PMScript
$args
  • Command args
$opts
public
# loadScriptCode( str $pmscript )

Prepare PMScript and convert into a PHP callable

Prepare PMScript and convert into a PHP callable

Parameters

$pmscript
  • text script
Properties summary
protected $owner
#
protected $selector
#
protected $perms
#
protected $vars
#
protected $globs
#
API documentation generated by ApiGen