Guest
May 20, 2012, 4:04 pm UTCHome arrow Commands arrow Wolfscript arrow Logfile
header image
Logfile
Written by Dream Dancer   
Apr 16, 2008 at 07:49 AM

The logfile functions in Wolfscript are serious attempts to duplicate the similiar functions in Botscript, and it is now possible to read back information from them as well.

TX Notes
No Parameters
For the most part, the LOG commands presented here duplicate the functionality of the $LOG commands from the Commands.
TXADDRECORD FileName Record
0 Filename Of $LOG
1 Record To Add
Adds Record to the file named FileName.
: Register (add) record { Record } to file { FileName }
Same as $LOG: Register (add) record {#0} to file {#1}
TXAPPEND Filename Record Entry
0 Filename Of $LOG
1 Record To Add
2 Entry To Add
Oddball Logfile function, this creates an "Append" log where each entry is added to the end of the file in the format "Record","Entry". This was created specifically because:
  1. It"s possible to overload the $LOG system to where records were being written to the wrong file.
  2. It's also possible that you really don't need the structure of a normal $LOG system but want some form of record keeping from the bot.
At this time, the $LOG is prefaced with the word "AppendLog", attempting to access an AppendLog with the normal $LOG access functions will cause it to fail without an error message, will look into making this work later. Also, currently, because of this lack of an error from the $LOG loader, it's possible to completely destroy the contents of an AppendLog with a normal $LOG action. Will put in coding to prevent this from happening later on.
TXCLEARLOG FileName Record
0 Filename Of $LOG
1 Record To Remove
Removes all entries of Record in file FileName.
: Remove all entries from record { Record } in file { FileName }
TXGETENTRY(FileName RecordName EntryIndex)
0 FileName
1 RecordName
2 EntryIndex
Wolfscript equivalent to $LOG: Store entry {EntryIndex} from record {RecordName} in file {FileName} to variable {Variable} only operating as a function, it returns the value as a string.
TXRMALL FileName
0 Filename To Be Cleared
Effectively erase the file named FileName.
: Remove all logs and all records from file { FileName }
TXRMLOG FileName Record Entry
0 Filename Of $LOG
1 Record To Affect
2 Entry Index To Remove
Removes item Entry (numeric based) from record named Record from FileName. Entries are base 1 indexed.
: Remove log entry { Entry } from record { Record } in file { FileName }.
TXRMRECORD FileName Record
0 Filename Of $LOG
1 Record To Remove
Removes Record from FileName.
: Remove record { Record } from file { FileName }.
TXSAVELOG FileName Record Entry
0 Filename Of $LOG
1 Record To Affect
2 Entry To Add
Add item Entry to the record named Record in FileName. If Record does not exist, creates the record.
: Save entry { Entry } to file { FileName } under record { Record }.
TXSAVELOGENTRY FileName RecordName EntryData
0 FileName
1 RecordName
2 EntryData
Saves EntryData in FileName under RecordName
TXSAVEONELOG Filename Record Entry
0 Filename Of $LOG
1 Record To Affect
2 Entry To Add
Add item Entry to the record named Record in FileName only if Record exists.
: Save entry { Entry } to file { FileName } under record { Record } only if record exists.
TXSAVEONEREC Filename Record Entry
0 Filename Of $LOG
1 Record To Affect
2 Entry To Add
Add item Entry to the record named Record in FileName only if there are no other entries. Will create Record if it does not exist.
: Save entry { Entry } to file { FileName } under record { Record } only if no entries exist.
Last Updated ( Jan 25, 2011 at 09:49 PM )
<Previous   Next>
header image