Jump to content




[Java&Lua][Error] Very mouch errors please help


  • You cannot reply to this topic
2 replies to this topic

#1 mibac138

  • Members
  • 132 posts
  • LocationPoland

Posted 20 November 2012 - 06:53 AM

Can you help me with this? look

code1(startup):
while true do
   if rs.getInput("left") == true then
	shell.run("st")
   end
   sleep(0)
end

code2(the problem-monitor menu):
rs.setOutput("top", true)
mon = peripheral.wrap("back")
mon.setTextScale(2)
while true do
  if rs.getInput("left") == true then
	  rs.setOutput("top", false)
	  mon.clear()
	  shell.run("startup")
   end
   rin = rs.getBundledInput( "front" )
  if colors.test( rin, colors.lime) == true then
	  mon.setCursorPos(1,1)
	  mon.clearLine()
	  mon.write("Zasilanie: 100%")
	 elseif colors.test( rin, colors.yellow) == true then
	  mon.setCursorPos(1,1)
	  mon.clearLine()
	  mon.write("Zasilanie: 75%")
	 elseif colors.test( rin, colors.lightBlue) == true then
	  mon.setCursorPos(1,1)
	  mon.clearLine()
	  mon.write("Zasilanie: 50%")
	 elseif colors.test( rin, colors.magenta) == true then
	  mon.setCursorPos(1,1)
	  mon.clearLine()
	  mon.write("Zasilanie: 25%")
	else
	  mon.setCursorPos(1,1)
	  mon.clearLine()
	  mon.write("Zasilanie: 0%")
   end
  if colors.test( rin, colors.white) == true then
	 mon.setCursorPos(1,2)
	 mon.clearLine()
	 mon.write("Quarry: Wlaczone")
	else
	 mon.setCursorPos(1,2)
	 mon.clearLine()
	 mon.write("Quarry: Wylaczone")
   end
  if colors.test( rin, colors.pink) == true then
	 mon.setCursorPos(1,3)
	 mon.clearLine()
	 mon.write("Rafineria: Wlaczona")
	else
	 mon.setCursorPos(1,3)
	 mon.clearLine()
	 mon.write("Rafineria: Wylaczona")
   end
end

Errors(after changing things in monitor menu):
Posted Image

THIS CODE IS IN POLISH LANGUAGE


WORKING I'M FIXED THIS :(/>



#2 Doyle3694

  • Members
  • 815 posts

Posted 20 November 2012 - 07:12 AM

I think of stack overflow, since your programs are refering to each other. note that if the redstone is on to the left, it will in a couple of seconds get a stackoverflow because this happends fast. your last error, is because your while true loop is missing a sleep(0) at the end, so it wont yield

#3 billysback

  • Members
  • 569 posts

Posted 20 November 2012 - 07:47 AM

I've never seen this kind of error however, are you spamming new variables?
If so then that may explain the index-out-of-bounds as Java may be struggling to keep up, trying to look for values in arrays which are not yet there.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users