Welcome to the PtokaX Wiki!


This wiki is devoted to let users share information on the great hubsoft PtokaX. However, it is not limited to PtokaX, it is destined to share and discuss information on different parts of the LUA programming language, but the site is NOT intended to be a replacement for the primary LUA Board aka the PtokaX Portal, nor the secondary LUA Board or the PtokaX resources.

If you’re not familiar with wikis then in short: they are user-contributed sites: pages can be edited by (almost) anyone. As such, there is always kind of up-to-date and (hopefully) proper content. They are better than forums, since relevant pieces of information are on the same page. Do not hesitate to share your knowledge, and we all hope you can learn and teach a lot here! — bastya_elvtars



Tips on scripting in API v.2


There are a few things to consider when scripting in the new API.

  • Stay In Scope:

Hub calls such as SetMan.GetString(21) or Core.GetPtokaXPath()
are not valid when the script is not running. These calls are out of scope in this situation.
Using the check syntax button would result in a script error yet when started it will not.
Keep such calls within the hub's Global callback functions [OnStartup, ChatArrival etc.]

  • Scripting Timers:

Script timers are vastly different in API2. They are now based on the Windows timer.
You may add or remove a timer. When you add [create] a timer it returns an ID that you may assign to a variable.
You must reference this ID when removing a timer or in the OnTimer function to ensure the appropriate code is processed for the relative ID.
Although you code methods must change the new timer allows for creation of multi-timers with a minimum of code.


Personal Tools