Jump to: navigation, search

Difference between revisions of "Tools"

(Created page with "====Tools==== =====Tools.FirstToUpper(value As String) As String===== *Description=''Uppercase the first character in a string.'' ;'''Values''' :* value=''The string to conv...")
 
Line 38: Line 38:
 
:* logHeader=''The header of the line. Must be used when staff log is defined.''
 
:* logHeader=''The header of the line. Must be used when staff log is defined.''
 
*Example=''Tools.Log(1, "Killed an NPC!", "NiteHawk")''
 
*Example=''Tools.Log(1, "Killed an NPC!", "NiteHawk")''
 +
 +
 +
=====Tools.GetStringFromFile(type As Integer, name As String, section As String, key As String) As String=====
 +
*Description=''Returns a string value in a file.''
 +
;'''Values'''
 +
:* type=''0 for npc file, 1 for room file, 2 for item file.''
 +
:* name =''Name of the file without extension to find.''
 +
:* section=''Section in the file.''
 +
:* key=''Key in the file.''
 +
*Returns=''The value, blank for not found or no data.''
 +
*Example=''Tools.GetStringFromFile(0, "Goblin", "Vars", "Race")''
 +
 +
 +
=====Tools.GetNumberFromFile(type As Integer, name As String, section As String, key As String) As String=====
 +
*Description=''Returns a number value in a file.''
 +
;'''Values'''
 +
:* type=''0 for npc file, 1 for room file, 2 for item file.''
 +
:* name =''Name of the file without extension to find.''
 +
:* section=''Section in the file.''
 +
:* key=''Key in the file.''
 +
*Returns=''The value, 0 for not found or no data.''
 +
*Example=''Tools.GetNumberFromFile(0, "Goblin", "Values", "MoneyMinimum")''
 +
 +
 +
=====Tools.GetBoolFromFile(type As Integer, name As String, section As String, key As String) As String=====
 +
*Description=''Returns a boolean value in a file.''
 +
;'''Values'''
 +
:* type=''0 for npc file, 1 for room file, 2 for item file.''
 +
:* name =''Name of the file without extension to find.''
 +
:* section=''Section in the file.''
 +
:* key=''Key in the file.''
 +
*Returns=''The value, false for not found or no data.''
 +
*Example=''Tools.GetBoolFromFile(0, "Goblin", "Special", "Despawn")''

Revision as of 20:40, 16 May 2017

Tools

Tools.FirstToUpper(value As String) As String
  • Description=Uppercase the first character in a string.
Values
  • value=The string to convert.
  • Returns=The string with the first character uppercased.
  • Example=Tools.FirstToUpper("banana!")


Tools.SetPMIndex(ByVal name As String)
  • Description=Debugging function only. Will set the name of whom to output the errors too. Must be defined in each script.
Values
  • name=The player name.
  • Example=Tools.SetPMIndex("NiteHawk")


Tools.Debug(ByVal message As String)
  • Description=Output a custom error to the player or the log file. This can output to the player defined above.
Values
  • message=The message to output.
  • Example=Tools.Debug("This is an error message to output!")


Tools.UnixTimestamp() As Double
  • Description=Returns the unix timestamp (based on total seconds). This should be used when handling time differences and time checks for scripts.
Values
  • Returns=Current server unix timestamp.
  • Example=Tools.UnixTimestamp()


Tools.Log(logNumber As Integer, logWrite As String, Optional logHeader As String = "")
  • Description=Write data to a log. This will send data to be written to a specific log.
Values
  • logNumber=The log ID to write too. 1 for the staff log, 2 for the PP log, and 3 for the error log.
  • logWrite=The string to write to the log.
  • logHeader=The header of the line. Must be used when staff log is defined.
  • Example=Tools.Log(1, "Killed an NPC!", "NiteHawk")


Tools.GetStringFromFile(type As Integer, name As String, section As String, key As String) As String
  • Description=Returns a string value in a file.
Values
  • type=0 for npc file, 1 for room file, 2 for item file.
  • name =Name of the file without extension to find.
  • section=Section in the file.
  • key=Key in the file.
  • Returns=The value, blank for not found or no data.
  • Example=Tools.GetStringFromFile(0, "Goblin", "Vars", "Race")


Tools.GetNumberFromFile(type As Integer, name As String, section As String, key As String) As String
  • Description=Returns a number value in a file.
Values
  • type=0 for npc file, 1 for room file, 2 for item file.
  • name =Name of the file without extension to find.
  • section=Section in the file.
  • key=Key in the file.
  • Returns=The value, 0 for not found or no data.
  • Example=Tools.GetNumberFromFile(0, "Goblin", "Values", "MoneyMinimum")


Tools.GetBoolFromFile(type As Integer, name As String, section As String, key As String) As String
  • Description=Returns a boolean value in a file.
Values
  • type=0 for npc file, 1 for room file, 2 for item file.
  • name =Name of the file without extension to find.
  • section=Section in the file.
  • key=Key in the file.
  • Returns=The value, false for not found or no data.
  • Example=Tools.GetBoolFromFile(0, "Goblin", "Special", "Despawn")