d303Fix

Description

Patch 3.0.3 added many good things, but also broke many others - addons dependend on Lua's os object. For last few days (from 2010-08-11) I was trying to make all addons work without changes and updates to them (including pbInfo).

Version v0.3 adds additional tool needed to create small lua file containing system time stamp at boot time. Lite versions are without this tool.
Version v0.5 permanently removes executable file.

This addon replaces all os functions, including proper formatting and behavior.

Importatnt

Curse has long delays when it gets to approving new packages, it is common that you see new description but there is no file yet. Please verify version that you download, if it isn't latest then you can visit Polish project page. You might also check repository if you are interested.

There is a rumor that this addon do not work in US. It works, but due to alack of testers it get's a long time to catch all errors and incompatibilities. Please read Change Log.

Before installing any version please read installation instructions.

If you don't like it don't use it, or be helpful and describe your problem.

If you want to include this addon in your addon, please, you can do what you want, but try to load it only when user do not have a separate instance of this addon and hook up to your frame events (OnLoad, OnEvent, OnUpdate). You might brake a few things if you brake that rule.

Befor you post an error read Bug Reports.

Repository

I use my own SVN repository server. You may find current working copy here.

Thanks

I would want to thank some people here for contributing to this project in different ways. First of all I would like to thank anonymous contributor which posted changes and fixes to addon on my website. Next is one of the users of US forum which pointed out one of Item Shop functions which is capable of returning item description including promotion times from which date and time is set.

I would also want to thank authors of FunctionWatch and InGameScripts addons. Without them I would explore Item Shop functions for a week.

Thank you all for testing especially for those which reported problems and described them very well.

Development

Attention

First of all I would like to ask all developers to check for os object existence before overriding it.

Checking

If you want to check if current os object implementation is created by this addon you might try this method:

ifosandd303Fixthen-- This is d303Fixend

Additional Functions

All os functions are available through both os and d303Fix objects. d303Fix object allows you to use few more functions:

IsAnyNil(param) - Check if param or any of element (if param is a table) is nil. If so function will return true and name of key in table (if element has name) or nil if param was not a table. In other case function returns false and nil.

IsLeapYear(year) - Function will return true if year is a leap year and false if not.

print(string) - Function will display passed string in default chat window. This function is a exception and is defined also in os object.

SafeLoadFile(filename) - Will try to load file by first checking if it exist. If not chat message will be displayed and return value will be false, otherwise file will be loaded and terurn value will be true.

SetTime(param) - Allows to set current time by using parameter in one of three types:

number - time in seconds from 1970-01-01

string - Date and time in standard ISO format yyyy-MM-dd HH:mm:ss

table - Date and time in form of standard lua time table.

Reset() - Reset date and time base to 1970-01-01 and clear all variables, this will force probing Item Shop for current date (if this feature is enabled)

/dtss auto - Toggle ability to set time from Screenshot name on login.

/dtss fail - Toggle ability to set time from Screenshot name when ItemShop probing fails.

/dtss - Take a screen shot (regardless of above setting).

Bug Reports

Please do not post comments or send messages telling that it doesn't work. If you want to complain then go get a glass of watter, but if you want to help, post a comment or send a message with as detailed description as you can. It doesn't hurt and can make work much faster. Once again I want to thank all people that were sending their feedback, suggestions and error reports.

Before posting an error check if:

You have latest described version (Change log)

Addon loads first (check chat messages, top one should be fenerated by d303Fix)