|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.planet_ink.coffee_mud.Behaviors.StdBehavior
com.planet_ink.coffee_mud.Behaviors.Scriptable
public class Scriptable
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Common.interfaces.ScriptingEngine |
|---|
ScriptingEngine.ScriptableResponse |
| Field Summary | |
|---|---|
protected ScriptingEngine |
engine
|
| Fields inherited from class com.planet_ink.coffee_mud.Behaviors.StdBehavior |
|---|
CODES, isSavableBehavior, parms |
| Fields inherited from interface com.planet_ink.coffee_mud.Common.interfaces.ScriptingEngine |
|---|
CONNECTOR_AND, CONNECTOR_ANDNOT, CONNECTOR_MAP, CONNECTOR_NOT, CONNECTOR_OR, CONNECTOR_ORNOT, CONNECTORS, DATETIME_ARGS, funcs, GSTATADD_CLAN, GSTATADD_CLANROLE, GSTATADD_DEITY, GSTATCODES_ADDITIONAL, methods, progs, SIGN_EQGT, SIGN_EQLT, SIGN_EQUL, SIGN_GRAT, SIGN_GTEQ, SIGN_LEST, SIGN_LTEQ, SIGN_NTEQ, SIGNS, SPECIAL_NUM_OBJECTS, SPECIAL_RANDANYONE, SPECIAL_RANDPC |
| Fields inherited from interface com.planet_ink.coffee_mud.Behaviors.interfaces.Behavior |
|---|
CAN_AREAS, CAN_EXITS, CAN_ITEMS, CAN_MOBS, CAN_ROOMS, FLAG_LEGALBEHAVIOR, FLAG_MOBILITY, FLAG_POTENTIALLYAGGRESSIVE, FLAG_TROUBLEMAKING |
| Constructor Summary | |
|---|---|
Scriptable()
|
|
| Method Summary | |
|---|---|
protected int |
canImproveCode()
|
java.lang.String |
defaultQuestName()
If this script is associated with a particular quest, this method is called to return that quest name. |
void |
dequeResponses()
Forces any queued event responses to be immediately executed. |
boolean |
endQuest(Environmental hostObj,
MOB mob,
java.lang.String quest)
Calling this method forces this script to look for a trigger dealing with the end of a quest (QUEST_TIME_PROG -1). |
protected ScriptingEngine |
engine()
|
boolean |
eval(Environmental scripted,
MOB source,
Environmental target,
MOB monster,
Item primaryItem,
Item secondaryItem,
java.lang.String msg,
java.lang.Object[] tmp,
java.lang.String[][] eval,
int startEval)
Evaluates a scripting function. |
java.lang.String |
execute(Environmental scripted,
MOB source,
Environmental target,
MOB monster,
Item primaryItem,
Item secondaryItem,
DVector script,
java.lang.String msg,
java.lang.Object[] tmp)
Executes a script in response to an event The scripts are formatted as a 2 dimensional DVector with the first row being the trigger information. |
void |
executeMsg(Environmental affecting,
CMMsg msg)
The general message event handler for the object. |
java.util.Vector |
externalFiles()
Returns a string list of any external files which may be required to make this ability work. |
java.lang.String |
getLocalVarXML()
If the variable scope of this script is local, this will return all the variables and values defined as an xml document for easy storage. |
java.lang.String |
getParms()
Returns the raw parameter string for this behavior. |
java.lang.String |
getScript()
Returns the script or load command(s). |
long |
getTickStatus()
A coded status for this object during the period where its tick method is being called. |
java.lang.String |
getVar(java.lang.String context,
java.lang.String variable)
Returns the value of one of the internal variables, determined by the scope of the script, the context of the variable, and the name of the variable. |
java.lang.String |
getVarScope()
Returns the scope of any variables defined within the script. |
java.lang.String |
ID()
The CoffeeMud Java Class ID shared by all instances of this object. |
boolean |
isVar(java.lang.String context,
java.lang.String variable)
Returns whether an internal variables, determined by the scope of the script, the context of the variable, and the name of the variable, is defined. |
boolean |
okMessage(Environmental affecting,
CMMsg msg)
The general message event previewer for the object. |
void |
registerDefaultQuest(java.lang.String questName)
Called after a behavior is added to an Environmental object. |
void |
setLocalVarXML(java.lang.String xml)
If the variable scope of this script is local, this will set all the variables and values defined from a passed in xml document. |
void |
setParms(java.lang.String newParms)
Sets the raw parameter string for this behavior. |
void |
setScript(java.lang.String newParms)
Sets the script or load command(s). |
void |
setVar(java.lang.String context,
java.lang.String variable,
java.lang.String value)
Sets the value of one of the internal variables, determined by the scope of the script, the context of the variable, and the name of the variable. |
void |
setVarScope(java.lang.String scope)
Sets the scope of any variables defined within the script. |
boolean |
tick(Tickable ticking,
int tickID)
this is the method which is called periodically by the threading engine. |
| Methods inherited from class com.planet_ink.coffee_mud.Behaviors.StdBehavior |
|---|
canActAtAll, canFreelyBehaveNormal, canImprove, canImprove, compareTo, copyOf, finalize, flags, getBehaversMOB, getBehaversRoom, getCodeNum, getSaveStatIndex, getStat, getStatCodes, grantsAggressivenessTo, initializeClass, isSavable, isStat, modifyBehavior, name, newInstance, parmsFormat, sameAs, setSavable, setStat, startBehavior |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.planet_ink.coffee_mud.Common.interfaces.ScriptingEngine |
|---|
isSavable, setSavable |
| Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject |
|---|
copyOf, initializeClass, newInstance |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable |
|---|
name |
| Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject |
|---|
copyOf, initializeClass, newInstance |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Field Detail |
|---|
protected ScriptingEngine engine
| Constructor Detail |
|---|
public Scriptable()
| Method Detail |
|---|
public java.lang.String ID()
CMObject
ID in interface CMObjectID in class StdBehaviorprotected int canImproveCode()
canImproveCode in class StdBehaviorprotected ScriptingEngine engine()
public long getTickStatus()
Tickable
getTickStatus in interface TickablegetTickStatus in class StdBehaviorTickable.tick(Tickable, int)public void registerDefaultQuest(java.lang.String questName)
Behavior
registerDefaultQuest in interface BehaviorregisterDefaultQuest in interface ScriptingEngineregisterDefaultQuest in class StdBehaviorquestName - the Quest nameQuest
public boolean endQuest(Environmental hostObj,
MOB mob,
java.lang.String quest)
ScriptingEngine
endQuest in interface ScriptingEnginehostObj - the scripted objectmob - a mob representation of the host objectquest - the name of the quest being ended
public java.util.Vector externalFiles()
Behavior
externalFiles in interface BehaviorexternalFiles in interface ScriptingEngineexternalFiles in class StdBehaviorBehavior.setParms(String)public java.lang.String getParms()
Behavior
getParms in interface BehaviorgetParms in class StdBehaviorBehavior.setParms(String)public void setParms(java.lang.String newParms)
Behavior
setParms in interface BehaviorsetParms in class StdBehaviornewParms - the parameter string for this behaviorBehavior.getParms()
public java.lang.String getVar(java.lang.String context,
java.lang.String variable)
ScriptingEngine
getVar in interface ScriptingEnginecontext - the context of the variable, usually a mob or object namevariable - the name of the variable
ScriptingEngine.setVarScope(String),
ScriptingEngine.getVarScope(),
ScriptingEngine.setVar(String, String, String),
ScriptingEngine.isVar(String, String),
ScriptingEngine.getLocalVarXML(),
ScriptingEngine.setLocalVarXML(String)
public boolean isVar(java.lang.String context,
java.lang.String variable)
ScriptingEngine
isVar in interface ScriptingEnginecontext - the context of the variable, usually a mob or object namevariable - the name of the variable
ScriptingEngine.setVarScope(String),
ScriptingEngine.getVarScope(),
ScriptingEngine.getVar(String, String),
ScriptingEngine.setVar(String, String, String),
ScriptingEngine.getLocalVarXML(),
ScriptingEngine.setLocalVarXML(String)
public void setVar(java.lang.String context,
java.lang.String variable,
java.lang.String value)
ScriptingEngine
setVar in interface ScriptingEnginecontext - the context of the variable, usually a mob or object namevariable - the name of the variablevalue - the value of the variableScriptingEngine.setVarScope(String),
ScriptingEngine.getVarScope(),
ScriptingEngine.getVar(String, String),
ScriptingEngine.isVar(String, String),
ScriptingEngine.getLocalVarXML(),
ScriptingEngine.setLocalVarXML(String)public java.lang.String defaultQuestName()
ScriptingEngine
defaultQuestName in interface ScriptingEngineScriptingEngine.registerDefaultQuest(String)public void setVarScope(java.lang.String scope)
ScriptingEngine
setVarScope in interface ScriptingEnginescope - the scope of variablesScriptingEngine.getVarScope(),
ScriptingEngine.getVar(String, String),
ScriptingEngine.getLocalVarXML()public java.lang.String getVarScope()
ScriptingEngine
getVarScope in interface ScriptingEngineScriptingEngine.setVarScope(String),
ScriptingEngine.setVar(String, String, String),
ScriptingEngine.setLocalVarXML(String)public java.lang.String getLocalVarXML()
ScriptingEngine
getLocalVarXML in interface ScriptingEngineScriptingEngine.setVarScope(String),
ScriptingEngine.setVar(String, String, String),
ScriptingEngine.setLocalVarXML(String)public void setLocalVarXML(java.lang.String xml)
ScriptingEngine
setLocalVarXML in interface ScriptingEnginexml - the local variable values as xmlScriptingEngine.getVarScope(),
ScriptingEngine.getVar(String, String),
ScriptingEngine.getLocalVarXML()
public boolean eval(Environmental scripted,
MOB source,
Environmental target,
MOB monster,
Item primaryItem,
Item secondaryItem,
java.lang.String msg,
java.lang.Object[] tmp,
java.lang.String[][] eval,
int startEval)
ScriptingEngine
eval in interface ScriptingEnginescripted - the object that is scriptedsource - the source of the eventtarget - the target of the eventmonster - a mob representation of the scripted objectprimaryItem - an item involved in the eventsecondaryItem - a second item involved in the eventmsg - a string message associated with the eventtmp - miscellaneous local variableseval - the pre-parsed expressionstartEval - while line to start evaluating on.
public java.lang.String getScript()
ScriptingEngine
getScript in interface ScriptingEngineScriptingEngine.setScript(String),
ScriptingEngine.externalFiles()public void setScript(java.lang.String newParms)
ScriptingEngine
setScript in interface ScriptingEnginenewParms - the script or load command(s)ScriptingEngine.getScript(),
ScriptingEngine.externalFiles()
public java.lang.String execute(Environmental scripted,
MOB source,
Environmental target,
MOB monster,
Item primaryItem,
Item secondaryItem,
DVector script,
java.lang.String msg,
java.lang.Object[] tmp)
ScriptingEngine
execute in interface ScriptingEnginescripted - the object that is scriptedsource - the source of the eventtarget - the target of the eventmonster - a mob representation of the scripted objectprimaryItem - an item involved in the eventsecondaryItem - a second item involved in the eventscript - 2 dimensional DVector, the script to executemsg - a string message associated with the eventtmp - miscellaneous local variables
ScriptingEngine.ScriptableResponse
public void executeMsg(Environmental affecting,
CMMsg msg)
MsgListener
executeMsg in interface MsgListenerexecuteMsg in class StdBehavioraffecting - either the initiator of the event, or the host of this objectmsg - the CMMsg that needs to be executedCMMsg
public boolean okMessage(Environmental affecting,
CMMsg msg)
MsgListener
okMessage in interface MsgListenerokMessage in class StdBehavioraffecting - either the initiator of the event, or the host of this objectmsg - the CMMsg that wants to be executed
CMMsg,
CMMsg.source()
public boolean tick(Tickable ticking,
int tickID)
Tickable
tick in interface Tickabletick in class StdBehaviorticking - a reference to this Tickable objecttickID - the TICKID_ constant describing this periodic call, as defined in Tickable
Tickable,
ServiceEngine,
TickableGrouppublic void dequeResponses()
ScriptingEngine
dequeResponses in interface ScriptingEngine
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||