Jump to content




1XX When terminating.

lua help

4 replies to this topic

#1 xcrafter_40

  • Members
  • 50 posts
  • LocationIn a room with a computer, duh.

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 by xcrafter_40, 08 January 2017 - 08:00 PM.


#2 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 08 January 2017 - 10:41 PM

The so called "error codes" are just line numbers.

#3 supernicejohn

  • Members
  • 98 posts
  • LocationSweden

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.

#4 xcrafter_40

  • Members
  • 50 posts
  • LocationIn a room with a computer, duh.

Posted 09 January 2017 - 01:41 AM

View PostKingofGamesYami, on 08 January 2017 - 10:41 PM, said:

The so called "error codes" are just line numbers.
Then why is it always random?

#5 xcrafter_40

  • Members
  • 50 posts
  • LocationIn a room with a computer, duh.

Posted 09 January 2017 - 01:47 AM

View Postsupernicejohn, on 08 January 2017 - 10:45 PM, said:

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!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users