File Constants:
// LogToFile constants
const LOG_DATETIME := 1; // log Core-Style DateTimeStr in front of log entry
//BinaryFile constants
const OPENMODE_IN := 0x01; // (input) Allow input operations on the stream
const OPENMODE_OUT := 0x02; // (output) Allow output operations on the stream
const OPENMODE_ATE := 0x04; // (at end) Set the stream's position indicator to the end of the stream on opening
const OPENMODE_APP := 0x08; // (append) Set the stream's position indicator to the end of the stream before each output operation
const OPENMODE_TRUNC := 0x10; // (truncate) Any current content is discarded, assuming a length of zero on opening
const SEEKDIR_BEG := 0x00; // beginning of sequence
const SEEKDIR_CUR := 0x01; // current position within sequence
const SEEKDIR_END := 0x02; // end of sequence
const LITTLE_ENDIAN := 0x00;
const BIG_ENDIAN := 0x01;
// ListDirectory constants
const LISTDIR_LIST_DIRS := 0x1;
const LISTDIR_DONT_LIST_DIRS := 0x0;
const LISTDIR_NO_FILES := "";
const LISTDIR_ALL_FILES := "*";
Functions:
Modules:
-
[+] Attribute
- AlterAttributeTemporaryMod
- BaseSkillToRawSkill
- CheckSkill
- GetAttribute
- GetAttributeBaseValue
- GetAttributeCap
- GetAttributeDefaultCap
- GetAttributeIntrinsicMod
- GetAttributeLock
- GetAttributeName
- GetAttributeTemporaryMod
- RawSkillToBaseSkill
- SetAttributeBaseValue
- SetAttributeCap
- SetAttributeLock
- SetAttributeTemporaryMod
- [+] Basic
- [+] BasicIO
- [+] Boat
- [+] CfgFile
- [+] CliLoc
- [+] DataFile
- [+] File
- [+] Guild
- [+] Http
- [+] Math
-
[+] Npc
- CanMove
- Face
- GetProperty
- IsLegalMove
- MakeBoundingBox
- Move
- RunAwayFrom
- RunAwayFromLocation
- RunToward
- RunTowardLocation
- Say
- SayUC
- Self
- SetAnchor
- SetOpponent
- SetProperty
- SetWarMode
- TurnAwayFrom
- TurnAwayFromLocation
- TurnToward
- TurnTowardLocation
- WalkAwayFrom
- WalkAwayFromLocation
- WalkToward
- WalkTowardLocation
- Wander
-
[+] OS
- Clear_Event_Queue
- Create_Debug_Context
- Debugger
- Events_Waiting
- GetPid
- GetProcess
- HTTPRequest
- Is_Critical
- OpenConnection
- OpenURL
- PerformanceMeasure
- Run_Script
- Run_Script_To_Completion
- Set_Critical
- Set_Debug
- Set_Event_Queue_Size
- Set_Priority
- Set_Script_Option
- Sleep
- Sleepms
- Start_Script
- Start_Skill_Script
- SysLog
- System_RPM
- Unload_Scripts
- Wait_For_Event
- [+] Party
- [+] PolSys
- [+] Storage
- [+] MySQL
- [+] Unicode
-
[+] UO
- Accessible
- AddAmount
- AddMenuItem
- ApplyConstraint
- AssignRectToWeatherRegion
- Attach
- Broadcast
- CanWalk
- CancelTarget
- CheckLineOfSight
- CheckLosAt
- CheckLosBetween
- CloseGump
- CloseTradeWindow
- CloseWindow
- ConsumeReagents
- ConsumeSubstance
- CoordinateDistance
- CoordinateDistanceEuclidean
- CreateAccount
- CreateItemAtLocation
- CreateItemCopyAtLocation
- CreateItemInBackpack
- CreateItemInContainer
- CreateItemInInventory
- CreateMenu
- CreateMultiAtLocation
- CreateNpcFromTemplate
- DestroyItem
- DestroyMulti
- Detach
- DisableEvents
- DisconnectClient
- Distance
- DistanceEuclidean
- EnableEvents
- EnumerateItemsInContainer
- EnumerateOnlineCharacters
- EquipFromTemplate
- EquipItem
- EraseGlobalProperty
- EraseObjProperty
- FindAccount
- FindObjtypeInContainer
- FindPath
- FindSubstance
- GetAmount
- GetCommandHelp
- GetCoordsInLine
- GetEquipmentByLayer
- GetFacing
- GetGlobalProperty
- GetGlobalPropertyNames
- GetHarvestDifficulty
- GetMapInfo
- GetMenuObjTypes
- GetMidpointCircleCoords
- GetMultiDimensions
- GetObjProperty
- GetObjPropertyNames
- GetObjType
- GetObjTypeByName
- GetRegionLightLevelAtLocation
- GetRegionName
- GetRegionNameAtLocation
- GetRegionString
- GetSpellDifficulty
- GetStandingHeight
- GetStandingLayers
- GetWorldHeight
- GrantPrivilege
- HarvestResource
- IsStackable
- ListAccounts
- ListEquippedItems
- ListGhostsNearLocation
- ListHostiles
- ListItemsAtLocation
- ListItemsNearLocation
- ListItemsNearLocationOfType
- ListItemsNearLocationWithFlag
- ListMobilesInBox
- ListMobilesInLineOfSight
- ListMobilesNearLocation
- ListMobilesNearLocationEx
- ListMultisInBox
- ListObjectsInBox
- ListOfflineMobilesInRealm
- ListStaticsAtLocation
- ListStaticsInBox
- ListStaticsNearLocation
- MoveItemToContainer
- MoveItemToSecureTradeWin
- MoveObjectToLocation
- OpenPaperdoll
- POLCore
- PerformAction
- PlayLightningBoltEffect
- PlayMovingEffect
- PlayMovingEffectEx
- PlayMovingEffectXYZ
- PlayMovingEffectXYZEx
- PlayMusic
- PlayObjectCenteredEffect
- PlayObjectCenteredEffectEx
- PlaySoundEffect
- PlaySoundEffectPrivate
- PlaySoundEffectXYZ
- PlayStationaryEffect
- PlayStationaryEffectEx
- PrintTextAbove
- PrintTextAbovePrivate
- ReadGameClock
- RegisterForSpeechEvents
- ReleaseItem
- RequestInput
- ReserveItem
- RestartScript
- Resurrect
- RevokePrivilege
- SaveWorldState
- SecureTradeWin
- SelectColor
- SelectMenuItem2
- SendBuyWindow
- SendCharProfile
- SendCharacterRaceChanger
- SendDialogGump
- SendEvent
- SendHousingTool
- SendInstaResDialog
- SendOpenBook
- SendOpenSpecialContainer
- SendOverallSeason
- SendPacket
- SendPopUpMenu
- SendQuestArrow
- SendSellWindow
- SendSkillWindow
- SendStatus
- SendStringAsTipWindow
- SendSysMessage
- SendTextEntryGump
- SendViewContainer
- SetGlobalProperty
- SetName
- SetObjProperty
- SetRegionLightLevel
- SetRegionWeatherLevel
- SetScriptController
- Shutdown
- SingleClick
- SpeakPowerWords
- StartSpellEffect
- SubtractAmount
- SystemFindObjectBySerial
- Target
- TargetCoordinates
- TargetMultiPlacement
- UpdateItem
- UpdateMobile
- UseItem
- [+] Util
- [+] Vitals
AppendToFile( filename, textlines ) | |
---|---|
Parameters: | |
Name | Type |
filename | string |
textlines | array of strings |
Explanation | |
Appends to a text file, adding newlines. Creates file if it does not exist. | |
By default, no package has any file access rights. To grant access, see config/fileaccess.cfg | |
Return values | |
1 or error | |
Errors | |
"Invalid parameter type" | |
"Error in filename descriptor" | |
"No parent path traversal please." | |
"Access denied" | |
"Unable to open file: X" | |
"Error during write." | |
Related Configs | |
fileaccess.cfg |
CreateDirectory( dirname ) | |
---|---|
Parameters: | |
Name | Type |
dirname | string |
Explanation | |
Creates directory | |
Return values | |
1 or error | |
Errors | |
"Invalid parameter type" | |
"Error in dirname descriptor" | |
"No parent path traversal please." | |
"Directory already exists." | |
"Could not create directory." |
CreateXMLFile() | |
---|---|
Explanation | |
TinyXML based xml reading/writing. | |
creates an empty XMLFile object | |
Return values | |
XMLFile object or error |
FileExists( filename ) | |
---|---|
Parameters: | |
Name | Type |
filename | string |
Explanation | |
Checks for the existence of a file based on Filename parameter. | |
Return values | |
1 on success | |
Errors | |
"Invalid parameter type" | |
"Error in filename descriptor" | |
"No parent path traversal please." | |
Related Configs | |
fileaccess.cfg |
ListDirectory( dirname, extension := LISTDIR_ALL_FILES, listdirs := LISTDIR_DONT_LIST_DIRS ) | |
---|---|
Parameters: | |
Name | Type |
dirname | string |
extension | string |
listdirs | Integer |
Explanation | |
List directory content | |
extension param can be extension without "." or file.em constant: | |
const LISTDIR_NO_FILES := ""; const LISTDIR_ALL_FILES := "*"; | |
file.em constants for listdirs: | |
const LISTDIR_LIST_DIRS := 0x1; const LISTDIR_DONT_LIST_DIRS := 0x0; | |
Return values | |
array of strings or error | |
Errors | |
"Invalid parameter type" | |
"Error in dirname descriptor" | |
"No parent path traversal please." | |
"Directory not found." |
LogToFile( filename, line, flags := 0 ) | |
---|---|
Parameters: | |
Name | Type |
filename | String |
line | String |
flags | Integer |
Explanation | |
Appends a single line to a text file, adds newlines, creates file if it does not exist. | |
By default, no package has any file access rights. To grant access, see config/fileaccess.cfg | |
file.em constants for flags: | |
const LOG_DATETIME := 1; // log Core-Style DateTimeStr in front of log entry | |
Return values | |
1 or error | |
Errors | |
"Invalid parameter type" | |
"Error in filename descriptor" | |
"No parent path traversal please." | |
"Access denied" | |
"Unable to open file: X" | |
"Error during write." | |
Related Configs | |
fileaccess.cfg |
OpenBinaryFile( filename, mode := OPENMODE_IN, endian := LITTLE_ENDIAN ) | |
---|---|
Parameters: | |
Name | Type |
filename | string |
mode | Integer |
endian | Integer |
Explanation | |
Opens BinaryFile stream | |
By default, no package has any file access rights. To grant access, see config/fileaccess.cfg | |
file.em constants for mode: | |
const OPENMODE_IN := 0x01; // (input) Allow input operations on the stream const OPENMODE_OUT := 0x02; // (output) Allow output operations on the stream const OPENMODE_ATE := 0x04; // (at end) Set the stream's position indicator to the end of the stream on opening const OPENMODE_APP := 0x08; // (append) Set the stream's position indicator to the end of the stream before each output operation const OPENMODE_TRUNC := 0x10; // (truncate) Any current content is discarded, assuming a length of zero on opening | |
file.em constants for endian: | |
const LITTLE_ENDIAN := 0x00; const BIG_ENDIAN := 0x01; | |
Return values | |
BinaryFile or error | |
Errors | |
"Invalid parameter type" | |
"Error in filename descriptor" | |
"No parent path traversal please." | |
"Access denied" | |
Related | |
BinaryFile | |
Related Configs | |
fileaccess.cfg |
OpenXMLFile( filename ) | |
---|---|
Parameters: | |
Name | Type |
filename | string |
Explanation | |
TinyXML based xml reading/writing. | |
opens given filename and returns XMLFile object, fileaccess.cfg is checked | |
Return values | |
XMLFile object or error | |
Related Configs | |
fileaccess.cfg |
ReadFile( filename ) | |
---|---|
Parameters: | |
Name | Type |
filename | string |
Explanation | |
Reads a text file, returning the contents as an array of strings, removing newlines. | |
By default, no package has any file access rights. To grant access, see config/fileaccess.cfg | |
Return values | |
returns array of strings | |
Errors | |
"Invalid parameter type" | |
"Error in filename descriptor" | |
"No parent path traversal please." | |
"Access denied" | |
"File not found: X" | |
Related Configs | |
fileaccess.cfg |
WriteFile( filename, textcontents ) | |
---|---|
Parameters: | |
Name | Type |
filename | string |
textcontents | array of strings |
Explanation | |
Writes a new file to disk, appends newlines, creates file if it does not exist, renames existing file to filename.bak | |
By default, no package has any file access rights. To grant access, see config/fileaccess.cfg | |
Return values | |
1 or error | |
Errors | |
"Invalid parameter type" | |
"Error in filename descriptor" | |
"No parent path traversal please." | |
"Access denied" | |
"File not found: X" | |
"Error during write." | |
"Unable to remove filenameX: reasonY | |
"Unable to rename filenameX: to filenameZ: reasonY | |
Related Configs | |
fileaccess.cfg |