Text Console v2 
5 comments Okay, Text Console v2 now come. Added normal console support
Hooks:
second
Note: it need 1 seconds before the code is executed. I don't want create lags.
Note2: It's 100% rewritten less than 10 minutes, now console_lua.txt and console_norm.txt(default at servercontrol_config.cfg) being cleared(no more "e" words)
Note3: Configuration file is a servercontrol_config.cfg
Note4: It just normal LUA ERROR message and not called by "error" function

Hooks:





edited 5×, last 04.06.13 12:17:34 pm

Comments
5 comments



Log in!
You need to log in to be able to write comments!Log in

I agree with @
Avo:
it's a nice idea
also i like this part :

it's a nice idea
also i like this part :
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("second","TextCMDLine")
function TextCMDLine()
-- LUA check
local f=io.open(luatxt,"r")
if f then
local tmp=f:read("*a")
if #tmp>0 then
local functmp,errorcode=loadstring(tmp)
if functmp then
functmp()
else
print("©255000000LUA ERROR: "..errorcode)
end
end
end
function TextCMDLine()
-- LUA check
local f=io.open(luatxt,"r")
if f then
local tmp=f:read("*a")
if #tmp>0 then
local functmp,errorcode=loadstring(tmp)
if functmp then
functmp()
else
print("©255000000LUA ERROR: "..errorcode)
end
end
end

Idea nice, I will maybe make better one later
Edit: I see it's edited, hmm. Instead of "reserving global variables", you can use unique table with your name or something.

Edit: I see it's edited, hmm. Instead of "reserving global variables", you can use unique table with your name or something.
Code:
Just saying. 1
2
2
iluminati = {}
iluminat.loop = 10
iluminat.loop = 10
edited 1×, last 04.06.13 05:29:54 pm
Ah but this has 32 lines and returns error in the console and the text file if it fails:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
addhook("second","_second")
parsepath="sys/lua/parse.lua"
parsesuccess="Lua Successfully Ran"
data=""
function readfile(file)
local file=io.open(file,"r")
local data=file:read("*all")
file:close()
return data
end
function writefile(file,data)
local file=io.open(file,"w")
file:write(data)
file:close()
end
function _second()
local current=readfile(parsepath)
local rtn={}
if current~=data and current~=parsesuccess then
bool,err=pcall(dofile,parsepath)
if bool==false then
writefile(parsepath,err)
data=err
rtn={"255000000",err}
else
writefile(parsepath,parsesuccess)
data=readfile(parsepath)
rtn={"000255000",readfile(parsepath)}
end
print(string.char(169)..rtn[1].."Lua: "..rtn[2])
end
end
parsepath="sys/lua/parse.lua"
parsesuccess="Lua Successfully Ran"
data=""
function readfile(file)
local file=io.open(file,"r")
local data=file:read("*all")
file:close()
return data
end
function writefile(file,data)
local file=io.open(file,"w")
file:write(data)
file:close()
end
function _second()
local current=readfile(parsepath)
local rtn={}
if current~=data and current~=parsesuccess then
bool,err=pcall(dofile,parsepath)
if bool==false then
writefile(parsepath,err)
data=err
rtn={"255000000",err}
else
writefile(parsepath,parsesuccess)
data=readfile(parsepath)
rtn={"000255000",readfile(parsepath)}
end
print(string.char(169)..rtn[1].."Lua: "..rtn[2])
end
end



