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

[not printing... crashlog] Help

Started by Goof, 17 February 2013 - 01:28 AM
Goof #1
Posted 17 February 2013 - 02:28 AM
Hey =D

im making a crasher program, which prints a BSOD when an error appears in a function. but
when im trying to save the log when the log should be: "crashlogs/cLog2" then the screen just turns black, and returns back to the command prompt.

Why?

(no errors. its just not working as suspected)

(full code at pastebin) – no comments :(/> ( i dont have the time to do that. )

(part of the code, which i think is the problem)

Spoiler

count = 0 -- This code just checks if there exists previous crashlogs. but right now it only works when the crashlogs folder is empty.
	while run do
		fLNum = ("crashlogs/cLog" .. count)-- locate the folder
							
		if not fs.exists(fLNum) then -- checks if there doesnt exist a previous file in that name.
			fLNum = ("crashlogs/cLog" .. count) -- if true then it should return back to the rest of the program, but doesnt.
			run = false -- stop the loop.
		else -- if the file exists.
			count = count + 1 -- tell the count variable to be added 1.
			fLNum = ("crashlogs/cLog" .. count) -- the folder path is now "crashlogs/cLog2"
			run = true -- but it seems like it doesnt do this*: run = true :* but i dont know why.
		end
		sleep(0)
	end
						





Thanks in advance!
theoriginalbit #2
Posted 17 February 2013 - 02:36 AM
BSoD from my tutorial by any chance? :P/>
this should work

local count = 0
local run = true
while run do
  run = fs.exists("crashlogs/cLog"..count)
  count = count + 1
  sleep(0)
end

EDIT: Just added sleep, incase its a large folder, forgot to add it until i looked at OP again :P/>
Edited on 17 February 2013 - 01:37 AM
Goof #3
Posted 17 February 2013 - 02:44 AM
from your tutorial?
Yes :D/> its a really good tutorial xD ( but i did know that there exists a BSOD before i read your tutorial xD )

Thanks for the help, but still not doing anything, just black screen with the shell… :(/>

code: http://pastebin.com/9kUNccqF
edit lawl… i forgot to add the path to the rest of the code xD no problem.. Thanks :D/>