Posted 15 April 2016 - 09:15 PM
So i tried doing my program and when i run it, the computer just errors java.lang.ArrayIndexOutOfBoundException
Heres the program:
Heres the program:
monitor = peripheral.wrap("right")
tz = "UTC"
function getTime(tz,format)
time = http.get("http://therockettek.hol.es/API/Time.php? TZ="..textutils.urlEncode(tz).."&FORMAT="..textutils.urlEncode(format)).readAll()
if time == "" then
time = "ERR"
end
return time
end
function drawBox()
hour = getTime(tz,"G")
if hour > 16 and hour < 5 then
print("night")
bx,by = monitor.getSize()
paintutils.drawFilledBox(1,1,bx,by,colors.black)
else
print("day")
bx,by = monitor.getSize()
paintutils.drawFilledBox(1,1,bx,by,colors.yellow)
end
end
drawBox()
Edited on 15 April 2016 - 07:16 PM