Updated to version 1.5.0
randomcolor
--[[ options:
hue = 0-360 or "colorName" (valid string colors: red, yellow, blue, green, orange, cyan, purple, pink, monochrome)
saturation = 0-100 (distance from gray)
brightness = 0-100 "dark", "medium", "light" (balance between black and white)
transparency = 0-100 (transparency duh)
gradient = true/false (returns colors to use with 'addgradcolors')
amount = 0-3000 (amount of colors returned)
]]--
init start
local colorOptions = {
gradient = true,
amount = 100,
hue = 'purple'
}
setposition(0, 0)
setfillstyle('gradient', 'linear', 1, 0, 0, 50, 50)
init end
addgradcolors(randomcolor(colorOptions))
drawshape('rect', 0, 0, 100, 100)
This will draw a box in your screen with 100 random blue colors filling the shape.
table.search
-- enables advanced searching method (extends table.find functionality)
table.search(tbl, "example", true, true)
Searches for "example" string in the table tbl, the first true determines if you want to disconsider case sensitive, the second if you want to search partially in another string that doesn't have the exact value, it could return the position for "exampleee" as it contains the string "example" as requested.
Alternate Invocations
table.search(tbl, 100, 150, 50)
Searches for 100 in the table 'tbl' or the first number between 150 and 50.
Alternate Invocations
table.search(tbl, true, true)
Searches for the boolean true in the table 'tbl', you can pass another bool parameter to determine wheter to convert table values to bool to check if they are equal to the one given to search, this doesn't change the table values to boolean.
Optionally all invocations can be used with an argument for key-value tables.
botversion
print(botversion())
Prints the version of bot as a number like 300 for "3.0.0", basically it parses the variable $botversion, converting into a number. You can pass the parameter to be converted.
drawvector
drawvector(50, 50, 25, 25)
Draws a line in your screen starting from 50:50 going to 25:25, it's just a helper to draw lines.