Class PLUGIN.CPR

Cardiopulmonary Resuscitation (CPR) Plugin

Class Overview

Core Methods

PLUGIN.CPR:New(name[, author]) Create a new plugin.
PLUGIN.CPR:CallAsHook(name, ...) Call the hooks of this plugin.
PLUGIN.CPR:Call(name, ...) Call the hooks of this plugin, ignoring any output.
PLUGIN.CPR:Hook(name, func) Adds a hook function to the plugin.
PLUGIN.CPR:AddHook(name, func) Adds a hook function to the plugin, and also registers the hook with hook.Add
PLUGIN.CPR:Enable() Enable the plugin.
PLUGIN.CPR:Disable() Disable the plugin.
PLUGIN.CPR:Enabled() Get if the plugin is enabled.
PLUGIN.CPR:IsValid() Checks if the plugin is valid (currently checks enabled status)
PLUGIN.CPR:Register([name=self.name]) Registers the plugin.

Data Methods

PLUGIN.CPR:CreateFolder(fullPath) Create a folder, along with any intermedate folders.
PLUGIN.CPR:DataFolder() Gets the data folder for this plugin.
PLUGIN.CPR:CreateDataFolder() Creates this plugin's data folder.
PLUGIN.CPR:DataFile(name) Gets the path to a data file for this plugin.
PLUGIN.CPR:MapFolder() Gets the data folder for this plugin on the current map.
PLUGIN.CPR:CreateMapFolder() Creates this plugin's data folder for the current map.
PLUGIN.CPR:MapFile(name) Gets the path to a map file for this plugin.
PLUGIN.CPR:OpenDataFile(name[, mode=r]) Gets the file class for the given file.
PLUGIN.CPR:OpenMapFile(name[, mode=r]) Gets the file class for the given file.

Abstracted Data Methods

PLUGIN.CPR:ReadDataFile(name) Reads a given data file.
PLUGIN.CPR:WriteDataFile(name, contents) Writes a given data file.
PLUGIN.CPR:ReadMapFile(name) Reads a given data file.
PLUGIN.CPR:WriteMapFile(name, contents) Writes a given data file.

Core Methods

PLUGIN.CPR:New(name[, author])
Create a new plugin.

Parameters:

  • name string Plugin Name.
  • author string Authors. (optional)

Returns:

    PLUGIN

Inhereted from:

PLUGIN.CPR:CallAsHook(name, ...)
Call the hooks of this plugin.

Parameters:

  • name string Name of the hook to call.
  • ... vararg Data to pass to the hook function.

Returns:

    vararg Returns from the called functions.

Inhereted from:

PLUGIN.CPR:Call(name, ...)
Call the hooks of this plugin, ignoring any output.

Parameters:

  • name string Name of the hook
  • ... vararg Data to pass to the hook function.

Returns:

    vararg Returns from the called functions.

Inhereted from:

See also:

PLUGIN.CPR:Hook(name, func)
Adds a hook function to the plugin.

Parameters:

  • name string Hook name.
  • func func Function to add.

Returns:

    PLUGIN

Inhereted from:

PLUGIN.CPR:AddHook(name, func)
Adds a hook function to the plugin, and also registers the hook with hook.Add

Parameters:

  • name string Hook name.
  • func func Function to add.

Returns:

    PLUGIN

Inhereted from:

PLUGIN.CPR:Enable()
Enable the plugin.

Returns:

    PLUGIN

Inhereted from:

PLUGIN.CPR:Disable()
Disable the plugin.

Returns:

    PLUGIN

Inhereted from:

PLUGIN.CPR:Enabled()
Get if the plugin is enabled.

Returns:

    bool

Inhereted from:

PLUGIN.CPR:IsValid()
Checks if the plugin is valid (currently checks enabled status)

Returns:

    bool

Inhereted from:

See also:

PLUGIN.CPR:Register([name=self.name])
Registers the plugin.

Parameters:

  • name string Name to register the plugin with, if not already defined. (default self.name)

Inhereted from:

Data Methods

PLUGIN.CPR:CreateFolder(fullPath)
Create a folder, along with any intermedate folders.

Parameters:

  • fullPath string Folder path.

Returns:

    PLUGIN

Inhereted from:

PLUGIN.CPR:DataFolder()
Gets the data folder for this plugin.

Returns:

    string

Inhereted from:

PLUGIN.CPR:CreateDataFolder()
Creates this plugin's data folder.

Returns:

    PLUGIN

Inhereted from:

PLUGIN.CPR:DataFile(name)
Gets the path to a data file for this plugin.

Parameters:

Returns:

    string Full path.

Inhereted from:

PLUGIN.CPR:MapFolder()
Gets the data folder for this plugin on the current map.

Returns:

    string

Inhereted from:

PLUGIN.CPR:CreateMapFolder()
Creates this plugin's data folder for the current map.

Returns:

    PLUGIN

Inhereted from:

PLUGIN.CPR:MapFile(name)
Gets the path to a map file for this plugin.

Parameters:

Returns:

    string Full path.

Inhereted from:

PLUGIN.CPR:OpenDataFile(name[, mode=r])
Gets the file class for the given file.

Parameters:

Returns:

    file_class

Inhereted from:

See also:

PLUGIN.CPR:OpenMapFile(name[, mode=r])
Gets the file class for the given file.

Parameters:

Returns:

    file_class

Inhereted from:

See also:

Abstracted Data Methods

PLUGIN.CPR:ReadDataFile(name)
Reads a given data file.

Parameters:

Returns:

    string File contents.

Inhereted from:

PLUGIN.CPR:WriteDataFile(name, contents)
Writes a given data file.

Parameters:

Returns:

    PLUGIN

Inhereted from:

PLUGIN.CPR:ReadMapFile(name)
Reads a given data file.

Parameters:

Returns:

    string File contents.

Inhereted from:

PLUGIN.CPR:WriteMapFile(name, contents)
Writes a given data file.

Parameters:

Returns:

    PLUGIN

Inhereted from: