整理cmd代码,用户代码能访问更多东西并且使用保护模式执行可以返回错误,增加一个解谜要素
This commit is contained in:
@@ -6,245 +6,305 @@ local inputBox=WIDGET.newInputBox{name="input",x=40,y=650,w=1200,h=50}
|
|||||||
local outputBox=WIDGET.newTextBox{name="output",x=40,y=30,w=1200,h=600,font=25,lineH=25,fix=true}
|
local outputBox=WIDGET.newTextBox{name="output",x=40,y=30,w=1200,h=600,font=25,lineH=25,fix=true}
|
||||||
outputBox:push("Techmino Shell")
|
outputBox:push("Techmino Shell")
|
||||||
outputBox:push("©2020 26F Studio some rights reserved")
|
outputBox:push("©2020 26F Studio some rights reserved")
|
||||||
local history,hisPtr={"help"}
|
local history,hisPtr={"?"}
|
||||||
|
|
||||||
local scene={}
|
|
||||||
|
|
||||||
|
local noLog=false
|
||||||
local function log(str)
|
local function log(str)
|
||||||
outputBox:push(str)
|
if noLog then return end
|
||||||
|
outputBox:push(tostring(str))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--Environment for user's function
|
||||||
local userEnv={
|
local userEnv={
|
||||||
print=log,
|
assert=assert,error=error,
|
||||||
math=math,
|
tonumber=tonumber,tostring=tostring,
|
||||||
table=table,
|
select=select,next=next,
|
||||||
string=string,
|
ipairs=ipairs,pairs=pairs,
|
||||||
}
|
print=log,type=type,
|
||||||
|
pcall=pcall,xpcall=xpcall,
|
||||||
|
rawget=rawget,rawset=rawset,rawlen=rawlen,rawequal=rawequal,
|
||||||
|
setfenv=setfenv,setmetatable=setmetatable,
|
||||||
|
-- load=load,loadfile=loadfile,dofile=dofile,
|
||||||
|
-- getfenv=getfenv,getmetatable=getmetatable,
|
||||||
|
-- collectgarbage=collectgarbage,
|
||||||
|
|
||||||
function scene.sceneInit()
|
math={},
|
||||||
TASK.new(function()YIELD()WIDGET.sel=inputBox end)
|
table={},
|
||||||
BG.set("none")
|
string={},
|
||||||
|
coroutine={},
|
||||||
|
bit32={},
|
||||||
|
debug={"No way."},
|
||||||
|
package={"No way."},
|
||||||
|
io={"No way."},
|
||||||
|
os={"No way."},
|
||||||
|
_VERSION=VERSION_CODE,
|
||||||
|
}userEnv._G=userEnv
|
||||||
|
TABLE.complete(math, userEnv.math)
|
||||||
|
TABLE.complete(table, userEnv.table)
|
||||||
|
TABLE.complete(string, userEnv.string)
|
||||||
|
TABLE.complete(coroutine, userEnv.coroutine)
|
||||||
|
TABLE.complete(bit, userEnv.bit)
|
||||||
|
|
||||||
|
--Puzzle box
|
||||||
|
local first_key={}
|
||||||
|
local fleg={
|
||||||
|
pw=(14^2*10)..(2*11),
|
||||||
|
second_box="Coming soon",
|
||||||
|
}setmetatable(fleg,{__tostring=function()return"The fl\97g."end})
|
||||||
|
local function first_box(k,f)
|
||||||
|
if k~=first_key then log"Usage:"log"?"return end
|
||||||
|
if not f then log"Two keys needed"return end
|
||||||
|
if type(f):byte()~=102 then log"Function need"return end
|
||||||
|
noLog=true
|
||||||
|
if not f()then noLog=false log"There are something in the void."return end
|
||||||
|
if f()~=f then noLog=false log"It is itself."return end
|
||||||
|
if f(26)~=math.huge then noLog=false log"26 can create the huge"return end
|
||||||
|
noLog=false
|
||||||
|
log"You lose."
|
||||||
|
return fleg
|
||||||
end
|
end
|
||||||
|
userEnv.the_key=first_key
|
||||||
|
userEnv.the_box=first_box
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- command_help_messages format:
|
|
||||||
-- command_help_messages is a table
|
|
||||||
-- key: the command
|
|
||||||
-- value: a table containing the following two elements:
|
|
||||||
-- description: a string that shows when user types `help` or
|
|
||||||
-- `help [page]`.
|
|
||||||
-- details: an array of strings, each representing a line, that shows
|
|
||||||
-- when user types `help [command]`.
|
|
||||||
local command_help_messages={
|
|
||||||
help={
|
|
||||||
description="Display help messages.",
|
|
||||||
details={
|
|
||||||
"Display help messages.",
|
|
||||||
"",
|
|
||||||
"Usage:",
|
|
||||||
"help",
|
|
||||||
"help [page]",
|
|
||||||
"help [command_name]"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
["#"]={
|
|
||||||
description="Run arbitrary Lua code.",
|
|
||||||
details={
|
|
||||||
"Run arbitrary Lua code.",
|
|
||||||
"",
|
|
||||||
"Usage:",
|
|
||||||
"#<lua_source_code>",
|
|
||||||
"",
|
|
||||||
"print() can be used to print text into this window."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
exit={
|
|
||||||
description="Return to the previous menu.",
|
|
||||||
details={
|
|
||||||
"Return to the previous menu.",
|
|
||||||
"",
|
|
||||||
"Aliases: exit quit bye",
|
|
||||||
"",
|
|
||||||
"Usage:",
|
|
||||||
"exit"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
quit={
|
|
||||||
description="Return to the previous menu.",
|
|
||||||
details={
|
|
||||||
"Return to the previous menu.",
|
|
||||||
"",
|
|
||||||
"Aliases: exit quit bye",
|
|
||||||
"",
|
|
||||||
"Usage:",
|
|
||||||
"exit"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
bye={
|
|
||||||
description="Return to the previous menu.",
|
|
||||||
details={
|
|
||||||
"Return to the previous menu.",
|
|
||||||
"",
|
|
||||||
"Aliases: exit quit bye",
|
|
||||||
"",
|
|
||||||
"Usage:",
|
|
||||||
"exit"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
echo={
|
|
||||||
description="Print a message to this window.",
|
|
||||||
details={
|
|
||||||
"Print a message to this window.",
|
|
||||||
"",
|
|
||||||
"Usage:",
|
|
||||||
"echo <message>"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
cls={
|
|
||||||
description="Clear the log output.",
|
|
||||||
details={
|
|
||||||
"Clear the log output.",
|
|
||||||
"",
|
|
||||||
"Usage:",
|
|
||||||
"cls"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
shutdown={
|
|
||||||
description="(Attempt to) shutdown your machine.",
|
|
||||||
details={
|
|
||||||
"(Attempt to) shutdown your machine. Arguments to this command",
|
|
||||||
"will be passed on to the system shutdown command.",
|
|
||||||
"",
|
|
||||||
"Usage:",
|
|
||||||
"shutdown",
|
|
||||||
"shutdown [args]"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fn={
|
|
||||||
description="Simulates a Function key press.",
|
|
||||||
details={
|
|
||||||
"Acts as if you have pressed a function key (i.e. F1-F12) on a keyboard.",
|
|
||||||
"Useful if you are on a mobile device without access to these keys.",
|
|
||||||
"",
|
|
||||||
"Usage:",
|
|
||||||
"fn <1-12>"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
scrinfo={
|
|
||||||
description="Display information about your screen.",
|
|
||||||
details={
|
|
||||||
"Display information about your screen.",
|
|
||||||
"",
|
|
||||||
"Usage:",
|
|
||||||
"scrinfo"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
wireframe={
|
|
||||||
description="Enable or disable wireframe.",
|
|
||||||
details={
|
|
||||||
"Enable or disable wireframe.",
|
|
||||||
"",
|
|
||||||
"Usage:",
|
|
||||||
"wireframe <true|false>"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
gammacorrect={
|
|
||||||
description="Enable or disable gamma correction.",
|
|
||||||
details={
|
|
||||||
"Enable or disable gamma correction.",
|
|
||||||
"",
|
|
||||||
"Usage:",
|
|
||||||
"gammacorrect <true|false>"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
rmwtm={
|
|
||||||
description="Remove the \"no recording\" watermark.",
|
|
||||||
details={
|
|
||||||
"Remove the \"no recording\" watermark.",
|
|
||||||
"You will need a password to do that.",
|
|
||||||
"",
|
|
||||||
"Usage:",
|
|
||||||
"rmwtm <password>"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
unlockall={
|
|
||||||
description="Unlock all modes on the map.",
|
|
||||||
details={
|
|
||||||
"Unlock all modes on the map.",
|
|
||||||
"",
|
|
||||||
"Usage:",
|
|
||||||
"unlockall"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
play={
|
|
||||||
description="Load a game mode, including those that are not on the map.",
|
|
||||||
details={
|
|
||||||
"Load a game mode, including those that are not on the map.",
|
|
||||||
"",
|
|
||||||
"Usage:",
|
|
||||||
"play <mode_name>"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
festival={
|
|
||||||
description="Load a festival theme.",
|
|
||||||
details={
|
|
||||||
"Load a festival theme.",
|
|
||||||
"",
|
|
||||||
"Usage:",
|
|
||||||
"festival list",
|
|
||||||
"festival <festival_name>"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
-- while I could have used a for loop to get this... the order at which the
|
|
||||||
-- table elements turn up in the loop is not quite ideal. Doing this manually
|
|
||||||
-- so that at least the most basic commands are on page 1.
|
|
||||||
local command_help_list={
|
|
||||||
"help",
|
|
||||||
"#",
|
|
||||||
"exit",
|
|
||||||
"echo",
|
|
||||||
"cls",
|
|
||||||
"shutdown",
|
|
||||||
"fn",
|
|
||||||
"scrinfo",
|
|
||||||
"wireframe",
|
|
||||||
"gammacorrect",
|
|
||||||
"rmwtm",
|
|
||||||
"unlockall",
|
|
||||||
"play",
|
|
||||||
"festival"
|
|
||||||
}
|
|
||||||
|
|
||||||
local command_help_page_size=10
|
|
||||||
|
|
||||||
local commands={}
|
local commands={}
|
||||||
--Basic commands
|
--Basic commands
|
||||||
function commands.help(arg)
|
do--commands.help(arg)
|
||||||
if command_help_messages[arg]then -- help [command]
|
-- command_help_messages format:
|
||||||
for _,v in pairs(command_help_messages[arg].details)do
|
-- command_help_messages is a table
|
||||||
log(v)
|
-- key: the command
|
||||||
|
-- value: a table containing the following two elements:
|
||||||
|
-- description: a string that shows when user types `help` or
|
||||||
|
-- `help [page]`.
|
||||||
|
-- details: an array of strings, each representing a line, that shows
|
||||||
|
-- when user types `help [command]`.
|
||||||
|
local command_help_messages={
|
||||||
|
help={
|
||||||
|
description="Display help messages.",
|
||||||
|
details={
|
||||||
|
"Display help messages.",
|
||||||
|
"",
|
||||||
|
"Aliases: help ?",
|
||||||
|
"",
|
||||||
|
"Usage:",
|
||||||
|
"help",
|
||||||
|
"help [page]",
|
||||||
|
"help [command_name]",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
["?"]={
|
||||||
|
description="Display help messages.",
|
||||||
|
details={
|
||||||
|
"Display help messages.",
|
||||||
|
"",
|
||||||
|
"Aliases: help ?",
|
||||||
|
"",
|
||||||
|
"Usage:",
|
||||||
|
"help",
|
||||||
|
"help [page]",
|
||||||
|
"help [command_name]",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
["#"]={
|
||||||
|
description="Run arbitrary Lua code.",
|
||||||
|
details={
|
||||||
|
"Run arbitrary Lua code.",
|
||||||
|
"",
|
||||||
|
"Usage:",
|
||||||
|
"#[lua_source_code]",
|
||||||
|
"",
|
||||||
|
"print() can be used to print text into this window.",
|
||||||
|
"There is a strange box.",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
exit={
|
||||||
|
description="Return to the previous menu.",
|
||||||
|
details={
|
||||||
|
"Return to the previous menu.",
|
||||||
|
"",
|
||||||
|
"Aliases: exit quit bye",
|
||||||
|
"",
|
||||||
|
"Usage:",
|
||||||
|
"exit",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
quit={
|
||||||
|
description="Return to the previous menu.",
|
||||||
|
details={
|
||||||
|
"Return to the previous menu.",
|
||||||
|
"",
|
||||||
|
"Aliases: exit quit bye",
|
||||||
|
"",
|
||||||
|
"Usage:",
|
||||||
|
"exit",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
bye={
|
||||||
|
description="Return to the previous menu.",
|
||||||
|
details={
|
||||||
|
"Return to the previous menu.",
|
||||||
|
"",
|
||||||
|
"Aliases: exit quit bye",
|
||||||
|
"",
|
||||||
|
"Usage:",
|
||||||
|
"exit",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
echo={
|
||||||
|
description="Print a message to this window.",
|
||||||
|
details={
|
||||||
|
"Print a message to this window.",
|
||||||
|
"",
|
||||||
|
"Usage:",
|
||||||
|
"echo [message]",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
cls={
|
||||||
|
description="Clear the log output.",
|
||||||
|
details={
|
||||||
|
"Clear the log output.",
|
||||||
|
"",
|
||||||
|
"Usage:",
|
||||||
|
"cls",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
shutdown={
|
||||||
|
description="(Attempt to) shutdown your machine.",
|
||||||
|
details={
|
||||||
|
"(Attempt to) shutdown your machine. Arguments to this command",
|
||||||
|
"will be passed on to the system shutdown command.",
|
||||||
|
"",
|
||||||
|
"Usage:",
|
||||||
|
"shutdown",
|
||||||
|
"shutdown [args]",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
fn={
|
||||||
|
description="Simulates a Function key press.",
|
||||||
|
details={
|
||||||
|
"Acts as if you have pressed a function key (i.e. F1-F12) on a keyboard.",
|
||||||
|
"Useful if you are on a mobile device without access to these keys.",
|
||||||
|
"",
|
||||||
|
"Usage:",
|
||||||
|
"fn <1-12>",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
scrinfo={
|
||||||
|
description="Display information about your screen.",
|
||||||
|
details={
|
||||||
|
"Display information about your screen.",
|
||||||
|
"",
|
||||||
|
"Usage:",
|
||||||
|
"scrinfo",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
wireframe={
|
||||||
|
description="Enable or disable wireframe.",
|
||||||
|
details={
|
||||||
|
"Enable or disable wireframe.",
|
||||||
|
"",
|
||||||
|
"Usage:",
|
||||||
|
"wireframe <true|false>",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
gammacorrect={
|
||||||
|
description="Enable or disable gamma correction.",
|
||||||
|
details={
|
||||||
|
"Enable or disable gamma correction.",
|
||||||
|
"",
|
||||||
|
"Usage:",
|
||||||
|
"gammacorrect <true|false>",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rmwtm={
|
||||||
|
description="Remove the \"no recording\" watermark.",
|
||||||
|
details={
|
||||||
|
"Remove the \"no recording\" watermark.",
|
||||||
|
"You will need a password to do that.",
|
||||||
|
"",
|
||||||
|
"Usage:",
|
||||||
|
"rmwtm [password]",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
unlockall={
|
||||||
|
description="Unlock all modes on the map.",
|
||||||
|
details={
|
||||||
|
"Unlock all modes on the map.",
|
||||||
|
"",
|
||||||
|
"Usage:",
|
||||||
|
"unlockall",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
play={
|
||||||
|
description="Load a game mode, including those that are not on the map.",
|
||||||
|
details={
|
||||||
|
"Load a game mode, including those that are not on the map.",
|
||||||
|
"",
|
||||||
|
"Usage:",
|
||||||
|
"play [mode_name]",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
festival={
|
||||||
|
description="Load a festival theme.",
|
||||||
|
details={
|
||||||
|
"Load a festival theme.",
|
||||||
|
"",
|
||||||
|
"Usage:",
|
||||||
|
"festival [festival_name]",
|
||||||
|
"",
|
||||||
|
"Available festivals:",
|
||||||
|
"classic|xmas|sprfes|zday",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- while I could have used a for loop to get this... the order at which the
|
||||||
|
-- table elements turn up in the loop is not quite ideal. Doing this manually
|
||||||
|
-- so that at least the most basic commands are on page 1.
|
||||||
|
local command_help_list={
|
||||||
|
"help",
|
||||||
|
"#",
|
||||||
|
"exit",
|
||||||
|
"echo",
|
||||||
|
"cls",
|
||||||
|
"shutdown",
|
||||||
|
"fn",
|
||||||
|
"scrinfo",
|
||||||
|
"wireframe",
|
||||||
|
"gammacorrect",
|
||||||
|
"rmwtm",
|
||||||
|
"unlockall",
|
||||||
|
"play",
|
||||||
|
"festival"
|
||||||
|
}
|
||||||
|
|
||||||
|
local command_help_page_size=10
|
||||||
|
function commands.help(arg)
|
||||||
|
if command_help_messages[arg]then -- help [command]
|
||||||
|
for _,v in ipairs(command_help_messages[arg].details)do
|
||||||
|
log(v)
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if tonumber(arg)then
|
||||||
|
arg=int(tonumber(arg))
|
||||||
|
else
|
||||||
|
arg=1
|
||||||
|
end -- help or help [page]
|
||||||
|
local total_pages=math.ceil(#command_help_list/command_help_page_size)
|
||||||
|
if arg<=0 or arg>total_pages then
|
||||||
|
log("Invalid page number. Must be between 1 and "..total_pages.." (inclusive).")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
log"Use help [page] to view more commands,"
|
||||||
|
log"or help [command_name] for more info on a command."
|
||||||
|
log""
|
||||||
|
log("Page "..arg.." of "..total_pages)
|
||||||
|
for i=(arg-1)*10+1,math.min(arg*10,#command_help_list)do
|
||||||
|
local _c=command_help_list[i]
|
||||||
|
log("".._c.." - "..command_help_messages[_c].description)
|
||||||
end
|
end
|
||||||
return
|
|
||||||
end
|
|
||||||
if tonumber(arg)then
|
|
||||||
arg=int(tonumber(arg))
|
|
||||||
else
|
|
||||||
arg=1
|
|
||||||
end -- help or help [page]
|
|
||||||
local total_pages=math.ceil(#command_help_list/command_help_page_size)
|
|
||||||
if arg<=0 or arg>total_pages then
|
|
||||||
log("Invalid page number. Must be between 1 and "..total_pages.." (inclusive).")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
log"Use help [page] to view more commands,"
|
|
||||||
log"or help [command_name] for more info on a command."
|
|
||||||
log""
|
|
||||||
log("Page "..arg.." of "..total_pages)
|
|
||||||
for i=(arg-1)*10+1,math.min(arg*10,#command_help_list)do
|
|
||||||
local _c=command_help_list[i]
|
|
||||||
log("".._c.." - "..command_help_messages[_c].description)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function commands.shutdown(arg)os.execute("shutdown "..arg)end
|
function commands.shutdown(arg)os.execute("shutdown "..arg)end
|
||||||
@@ -282,8 +342,8 @@ function commands.gammacorrect(bool)
|
|||||||
log"Usage: gammacorrect [true|false]"
|
log"Usage: gammacorrect [true|false]"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function commands.rmwtm(password)
|
function commands.rmwtm(pw)
|
||||||
if password==(14^2*10)..(2*11)then
|
if pw==fleg.pw then
|
||||||
_G["\100\114\97\119\70\87\77"]=NULL
|
_G["\100\114\97\119\70\87\77"]=NULL
|
||||||
log("\68\69\86\58\87\97\116\101\114\109\97\114\107\32\82\101\109\111\118\101\100")
|
log("\68\69\86\58\87\97\116\101\114\109\97\114\107\32\82\101\109\111\118\101\100")
|
||||||
SFX.play("clear")
|
SFX.play("clear")
|
||||||
@@ -316,10 +376,7 @@ function commands.play(m)--marathon_bfmax can only entered through here
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function commands.festival(name)
|
function commands.festival(name)
|
||||||
if name=="list" then
|
if name=="classic"then
|
||||||
log("Available festivals:")
|
|
||||||
log("classic xmas sprfes zday")
|
|
||||||
elseif name=="classic"then
|
|
||||||
FESTIVAL=false
|
FESTIVAL=false
|
||||||
BG.setDefault("space")
|
BG.setDefault("space")
|
||||||
BGM.setDefault("blank")
|
BGM.setDefault("blank")
|
||||||
@@ -339,29 +396,42 @@ function commands.festival(name)
|
|||||||
BG.setDefault("lanterns")
|
BG.setDefault("lanterns")
|
||||||
BGM.setDefault("overzero")
|
BGM.setDefault("overzero")
|
||||||
BGM.play()
|
BGM.play()
|
||||||
elseif name~="" then
|
|
||||||
log("No festival called "..name)
|
|
||||||
else
|
else
|
||||||
log"Usage: festival [festivalName]"
|
if name~=""then
|
||||||
|
log("No festival called "..name)
|
||||||
|
end
|
||||||
|
log"Usage: festival [fesitivalName]"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
local scene={}
|
||||||
|
|
||||||
|
function scene.sceneInit()
|
||||||
|
TASK.new(function()YIELD()WIDGET.sel=inputBox end)
|
||||||
|
BG.set("none")
|
||||||
|
end
|
||||||
|
|
||||||
function scene.keyDown(k)
|
function scene.keyDown(k)
|
||||||
if k=="return"then
|
if k=="return"then
|
||||||
local input=inputBox.value
|
local input=inputBox.value
|
||||||
|
log""
|
||||||
log("> "..input)
|
log("> "..input)
|
||||||
if input:byte()==35 then
|
if input:byte()==35 then
|
||||||
--Execute code
|
--Execute code
|
||||||
local code=loadstring(input:sub(2))
|
local code,err=loadstring(input:sub(2))
|
||||||
if code then
|
if code then
|
||||||
setfenv(code,userEnv)
|
setfenv(code,userEnv)
|
||||||
ins(history,input)
|
code,err=pcall(code)
|
||||||
code()
|
if not code then
|
||||||
|
log("[ERR] "..err)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
log"Syntax error"
|
log("[SYNTAX ERR] "..err)
|
||||||
end
|
end
|
||||||
|
ins(history,input)
|
||||||
|
hisPtr=nil
|
||||||
elseif input~=""then
|
elseif input~=""then
|
||||||
--Load command
|
--Load command
|
||||||
local p=input:find(" ")
|
local p=input:find(" ")
|
||||||
|
|||||||
Reference in New Issue
Block a user