Posted 21 May 2012 - 03:31 AM
Hello,
i have a few questions about LUA:
1. Is it possible to jump to different positions in the code?
2. Is there a way in CC to run two or more programms at once?
For Example:
Programm "a" that has a menu that i access directly at the terminal.
Programm "b" that runs in the background of "a" and refreshes the monitoroutput all the time.
So is there a way to let programm "a" run "b" in the background?
3. If i have a table through something like that:
I only manage to get things like asd5as5d as output, whereas eustorage.tier gives 3 for example.
i have a few questions about LUA:
1. Is it possible to jump to different positions in the code?
Spoiler
E.g. from where i call the JUMPTOTOPBUTHOW function to where it is defined
function JUMPTOTOPBUTHOW()
end
print("test")
function otherspam()
print("dsfsdfg")
sleep(1)
print("dsfsdfg")
sleep(1)
print("dsfsdfg")
sleep(1)
print("dsfsdfg")
sleep(1)
end
while true do
os.startTimer(0.5)
event, param1 = os.pullEvent()
if event=="char" and param1=="b" then
otherspam()
elseif event=="char" and param1=="v" then
JUMPTOTOPBUTHOW()
elseif event=="timer" then
print("b for different spam")
print(" and v for test")
print("asdf")
end
end
2. Is there a way in CC to run two or more programms at once?
For Example:
Programm "a" that has a menu that i access directly at the terminal.
Programm "b" that runs in the background of "a" and refreshes the monitoroutput all the time.
So is there a way to let programm "a" run "b" in the background?
3. If i have a table through something like that:
eustorage = sensors.getSensorReadingAsDict(side,sensor,[b][b]targets[1],"EUStorage")
i can access thing inside with
enr=eustorage[r.storage.val]
t=eustorage.tier
rm=eustorage.redstoneMode
write("1 EU="..enr.." Tier="..t.." RMode="..rm) print("")
but how do i output the whole table as it is?I only manage to get things like asd5as5d as output, whereas eustorage.tier gives 3 for example.