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

ArrayIndexOutOfBoundsException in Security Program

Started by Faceboji, 19 August 2012 - 03:37 PM
Faceboji #1
Posted 19 August 2012 - 05:37 PM
Hello, I am having a problem with my Security System Server. It works for a short amount of time, and then gives me this:


bios:38: vm error:
java.lang.ArrayIndexOutOfBoundsException

I don't know that much about ComputerCraft, so for all I know there could be something real obvious causing the problem. Here is the program:


function lock()
term.clear()
term.setCursorPos(1,1)
print("												 ")
print(" ########## ### ########## ########## ########## ")
print(" ########## ### ########## ########## ########## ")
print(" ####	## ### ####	## ####	## ##		 ")
print(" ####	## ### ####	## ####	## ##		 ")
print(" ########   ### ########## ########## ########## ")
print(" ########   ### ########## ########## ########## ")
print(" ####	## ### ####	   ####			   ## ")
print(" ####	## ### ####	   ####			   ## ")
print(" ########## ### ####	   ####	   ########## ")
print(" ########## ### ####	   ####	   ########## ")
print("												 ")
print("   BOJI INDUSTRIES  PASSWORD PROTECTION SYSTEM   ")
print("			 BUSINESS SERVER EDITION			 ")
print("		VERSION 3.8 DEVELOPED BY FACEBOJI		")
print("												 ")
os.pullEvent = os.pullEventRaw
code = "alarmoff"
redstone.getInput ("left")
if redstone.getInput ("left") == true then
redstone.setOutput ("back", true )
print("												 ")
print("  INPUT ALARM SHUTDOWN CODE  TO SHUTDOWN ALARMS  ")
print("												 ")
write "  ALARM SHUTDOWN CODE: "
input = read()
if input == code then
redstone.setOutput ("back", false )
lock()
else
end
else
sleep(1)
lock()
end
end
lock()

I hope someone can help!
sjele #2
Posted 19 August 2012 - 06:01 PM
I belive it is caused by calling lock() inside the function lock()

More info:
http://www.computerc...laying-2/#AIOOB

This might work. (not tested) : http://pastebin.com/8wwbJGzi