User Tools

Site Tools



minionlib_lua_api

This is an old revision of the document!


MinionLib Lua

This library is holding the core functionality on which all our bots are running. You can freely use the available functions for your Addon, in order to do that, you just need to open your module.def and set the dependency of your Addon to the lib:

[Module]
Name=YourAddon
Dependencies=minionlib
Version=1
Files=myluacode.lua
Enabled=1

Utility Functions

General
  • d(…)
    • Prints our the passed variable or the result of a function into the console.
  • Now()
    • Returns tickcount from ml_global_information.Now
  • TimeSince(integer previousTime)
    • Returns integer ml_global_information.Now - previousTime
Strings
  • MultiComp(number or stringsearch, criteria)
    • Returns bool, criteria should be (,)-separated for OR's, (+)-separated for AND's
  • IsNullString(string arg)
    • Returns bool
  • ValidString(string arg)
    • Returns bool
Tables
  • deepcompare(tabletable1,tabletable2,boolignore_metatable)
    • Returns bool, compares two tables if they are equal
  • pairsByKeys (tabletable)
    • Returns functioniterator, iterates over a table by keys, usage: for k,v in pairsByKeys(table) do
  • spairs(tabletable, functionsortfunc)
    • Returns functioniterator, iterates over and optionally sorts a table by keys, for k,v in spairs(TP.table,sort_func) do
  • TableContains(tabletable, element)
    • Returns bool
  • table_invert(tabletable)
    • Returns table, flips a table so keys become values
  • table_merge(tabletable1,tabletable2)
    • Returns table
  • TableInsertSort(tabletblSort, integeriInsertPoint, tableitemvInsertValue)
    • Returns tableorderedTable
  • TableRemoveSort(tabletblSort, integeriRemovePoint)
    • Returns tableorderedTable
  • ValidTable(table arg)
    • Returns bool
minionlib_lua_api.1429869903.txt.gz · Last modified: 2015/04/24 10:05 by fxfire