BasicUtils is a collection of functions that you can use in many situations. It is divided in several parts.
TableUtils
Spoiler
In tableutils there are some functions about tables.
tableutils.same(table1, table2) --checks if the two tables contain the same
tableutils.copy(source, destination) --copies the content of one table to another(destination must be a empty table)
Spoiler
In systemutils are some general usefull functions.
systemutils.yield(yieldtime, maxwait) --use this instead of sleeping to make your program faster without too long without yielding messages.
systemutils.startThread(func1, func2,...) --will make the coroutines and resume them(returns table with coroutines)
Spoiler
In graphic utils are gui based functions.
graphicutils.drawImage(image, xPos, yPos, maxX, maxY, minX, minY) --basically paintutils.drawImage but you can draw a part of a image(optional)
graphicutils.drawImage(path, xPos, yPos, maxX, maxY, minX, minY) --the same but you don't have to load the image.
graphicutils.setBackgroundColor(color) --clears the screen and fills it with the specified color
Spoiler
I need help with that oneSpoiler
Some misc. stuff
assert(condition, errormessage, errorlevel) --thanks to TheOrginalBIT with a optional errorlevel parameter
isString(var)
isThread(var)
isCoroutine(var)
isNumber(var)
isTable(var)
isNil(var)
isFunction(var)
isDead(var)
isAlive(var)
Usage:
First run the file using shell.run and you're ready.
Download:
pastebin get DQ7JUHxT utils
Changelog
Spoiler
V1.5:-Added tableutils.deepcopy functions thanks to TheOriginalBIT
V1.4:
-Changed is functions thanks to TheOriginalBIT
-Changed tableutils.same thanks to TheOriginalBIT
-Changed tableutils.copy thanks to TheOriginalBIT
-Fixed bugs thanks to TheOriginalBIT
V1.3:
-Added isFunction
-Added graphicutils.setBackgroundColor(color)
-Added systemutils.startThread(func1,func2,…)
V1.2:
-Added type checking
V1.1:
-Added tableutils.same
-Added graphicutils.drawImage
-Added graphicutils.drawImagePath
V1.0:
-Intial release
Cheers