This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
MudkipTheEpic's profile picture

[Error] Sandboxing utility acts weirdly, then reboots.

Started by MudkipTheEpic, 10 March 2013 - 11:05 AM
MudkipTheEpic #1
Posted 10 March 2013 - 12:05 PM
Hi! My sandboxing utility I am making, OSRunner, or VirtualCC, is acting unexpectedly. First, it freezes for about 2 seconds, then shuts down. I am thinking this may be because of an infinite loop, or too much processing, but I am not sure.

Code: vUJeMXR4

Help would be greatly appreciated. I will be back tomorrow to look at answers.

(I know this is a semi-hard problem, so don't feel bad if you can't figure it out.)

Thanks,
–Mudkip
remiX #2
Posted 10 March 2013 - 12:12 PM
It's because of this while loop:
while true do
    if not string.sub(dir,#dir,#dir) == ("/" or "\\") then break end
    dir=string.sub(dir,1,#dir-1)..""
end

What is it supposed to do?
I put a print( dir ) and a sleep( 1 ) and the output was like this:

argument was test
test
tes
te
t




Yeah, it also spammed blanks and still is after 1 minute… it isn't breaking.