supported parameters are registered in the Console.
No support for structure with autocomplete (currently)
Check if console is open in any mode
Return: true|false
Check if console is open in one line mode
Return: true|false
Check if console is open in full opened mode
return: true|false
Check if shift is pressed in opened console
return: true|false
Check if ctrl is pressed in opened console
return: true|false
Return state of console mode
Return: -1|0|1|2, None|None|Typing|Open
Set state of console display
state
-1 None
0 closed
1 line mode
2 full open
Clear output console
Clear history of executed commands console
Clear any data of console
insert line in history by index
insert line in history to last index
Get history of execution in console
Return: array
Set history of execution in console
Return: array
Check if history is empty
Return: true|false
insert line in output by index
insert line in output to last index
Set new array to output
Check if output is empty
Return: true|false
Set padding in output view
Get padding in output view
Return: number
Set string in input line
Set string in input line
Return: string
Set autofill string in input line
Get auto string in input line
Return: string
Set cursor position
Get cursor position
Return: number
local CUtil = require("ConsoleUtility")
local function init()
if not CUtil:IsOpen()
then
CUtil:SetState(2)
end
CUtil:clear()
CUtil:SetOutputBuffer(
{
"# hello from supa script",
"# hello from supa",
"# hello from",
"# hello",
"# "
}
)
CUtil:SetString("any thing what you want")
CUtil:SetAutoCompleteText(" and any text what you know")
CUtil:inserHistoryBuffer("You can call any of what is index is")
end
init()local CUtil = require("ConsoleUtility")
LoopAsync(500,function ()
if not ModAlive then
return true
end
if not CUtil:IsDisplayed() then return false end
if string.find("",CUtil:GetString(),0,true) then
CUtil:SetAutoCompleteText("")
CUtil:InsertHistoryBuffer(51,ConsoleUtil:GetString() .. "")
elseif string.find("load",CUtil:GetString(),0,true) then
CUtil:SetAutoCompleteText("load <mapname>")
CUtil:InsertHistoryBuffer(51,"load ")
elseif string.find("impulse",CUtil:GetString(),0,true) then
CUtil:SetAutoCompleteText("impulse <integer>")
CUtil:InsertHistoryBuffer(51,"impulse ")
elseif string.find("test",CUtil:GetString(),0,true) then
CUtil:SetAutoCompleteText("test is testing")
CUtil:InsertHistoryBuffer(51,"test ")
else
CUtil:SetAutoCompleteText(" Nothing Found")
CUtil:InsertHistoryBuffer(51,ConsoleUtil:GetString() .. "")
end
return false
end)