java.lang.ArrayIndexOutOfBoundsException
I don't know why this happens or what the fix is. I think it may be because it constantly sends data, but I'm not sure. Here's the code:
rednet.open("left")
data = "0"
test = 0
function main()
if redstone.getInput("front") == true then
data = "1"
test = test + 1
end
if data == "1" then
rednet.send(15, data)
end
term.clear()
term.setCursorPos(1, 1)
print(test)
data = "0"
sleep(1)
main()
end
main()
Please remember, this code is very sloppy because I put it together in a few minutes.












