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

1XX When terminating.

Started by xcrafter_40, 08 January 2017 - 06:57 PM
xcrafter_40 #1
Posted 08 January 2017 - 07:57 PM
Hi,
I had problems with my code. (Called CPOS (Compact OS) )

pastebin get CUAnzstR
Whenever I terminate, it prints something like:

104
And whenever I terminate it in LuaIDE it prints:

LuaIDE Has Crashed D:
113
Please report this error to Gravityscore!
Click to exit...

The known error codes are:
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115

What does this mean! I need help!
Edited on 08 January 2017 - 07:00 PM
KingofGamesYami #2
Posted 08 January 2017 - 10:41 PM
The so called "error codes" are just line numbers.
supernicejohn #3
Posted 08 January 2017 - 10:45 PM

local function unpack(str,file)
unpack() is a default function, nothing specifically breaks since it's local, but it seems weird to use the same name.

The actual problem is that screen is set to "menu":

while run do
  if os.pullEventRaw == "terminate" then
    steel.clear()
    run = false
  elseif screen == "desktop" then
    if steel.clickedAt(1,1,1,1) then
	  menu()         --- here!
    end
  end
end
Thus that will loop forever, and " os.pullEventRaw == "terminate" " will never be true since it compares a function with a string.
You would probably want to add a condition in the loop for what to do "if screen == "menu" then"
Other than that you would probably want to localize some variables.
xcrafter_40 #4
Posted 09 January 2017 - 01:41 AM
The so called "error codes" are just line numbers.
Then why is it always random?
xcrafter_40 #5
Posted 09 January 2017 - 01:47 AM

local function unpack(str,file)
unpack() is a default function, nothing specifically breaks since it's local, but it seems weird to use the same name.

The actual problem is that screen is set to "menu":

while run do
  if os.pullEventRaw == "terminate" then
	steel.clear()
	run = false
  elseif screen == "desktop" then
	if steel.clickedAt(1,1,1,1) then
	  menu()		 --- here!
	end
  end
end
Thus that will loop forever, and " os.pullEventRaw == "terminate" " will never be true since it compares a function with a string.
You would probably want to add a condition in the loop for what to do "if screen == "menu" then"
Other than that you would probably want to localize some variables.
Thanks! Now I can actually use that!