Posted 25 September 2013 - 09:46 PM
Here is my code that I'm working with. The functions that it calls aren't important, and they aren't what's messing up. When the time hits one of these alarms, it says "attempt to call number". I'm pretty sure that the number is the local variables I define early in the following code.
Also, is it possible to make the alarm at say 6.15 or so? do you just put os.setAlarm(6.15) ?
I based this code off of one from the CC wiki, but that one only dealt with one alarm. I changed the os.pullEvent("alarm") to just os.pullEvent(). I'm pretty sure it has something to do with that.
[Fixed it. Just use actual spacing. No other formatting works in code blocks anyway. -L]
Also, is it possible to make the alarm at say 6.15 or so? do you just put os.setAlarm(6.15) ?
local morning = os.setAlarm(5)
local noon = os.setAlarm(12)
local preNight = os.setAlarm(18)
local night = os.setAlarm(21)
while true do
local evt, arg = os.pullEvent()
if arg == morning then
morning()
elseif arg == noon then
noon()
elseif arg == preNight then
preNight()
elseif arg == night then
night()
end
end
I based this code off of one from the CC wiki, but that one only dealt with one alarm. I changed the os.pullEvent("alarm") to just os.pullEvent(). I'm pretty sure it has something to do with that.
[Fixed it. Just use actual spacing. No other formatting works in code blocks anyway. -L]