GameMaster2030 1 Posted February 19, 2019 Share Posted February 19, 2019 I'm trying to get an alarm system to work, but when I try this code I'm getting an error that os_alarm does not exist in /boot/04_component.lua local component = require("component") local sides = require("sides") rs = component.redstone alarm = component.os_alarm yes = true while yes do if rs.getInput(sides.south)>0 then alarm.setAlarm("klaxon2") alarm.setRange(1-60) alarm.activate() else alarm.setAlarm("klaxon2") alarm.setRange(1-60) alarm.deactivate() end end Quote Link to post Share on other sites
1 Solution ben_mkiv 9 Posted February 20, 2019 Solution Share Posted February 20, 2019 please try to change alarm.setRange(1-60) to alarm.setRange(15) and report back if the issue persists Quote Link to post Share on other sites
0 GameMaster2030 1 Posted February 19, 2019 Author Share Posted February 19, 2019 Nevermind, you need to attach it directly. But it doesn't make sound now. I have a redstone card and a lever attached to it. It should work Quote Link to post Share on other sites
0 GameMaster2030 1 Posted February 19, 2019 Author Share Posted February 19, 2019 In the table it also gives one alarm that is atached. This is just weird. Why isn't this working? Quote Link to post Share on other sites
0 GameMaster2030 1 Posted February 20, 2019 Author Share Posted February 20, 2019 13 hours ago, ben_mkiv said: please try to change alarm.setRange(1-60) to alarm.setRange(15) and report back if the issue persists That worked, thanks. Question, is it possible to activate alarms wireless? Quote Link to post Share on other sites
0 ben_mkiv 9 Posted February 20, 2019 Share Posted February 20, 2019 There are none within the mod, but you can do that with OC but it requires knowledge about how things work. you could use network messages to send a command to the computer which the alarm is connected to. Or (which is more complicated) assemble a Microcontroller with the Alarm inside, which does listen for the network message. How to use network messages can be read up here: https://ocdoc.cil.li/component:modem You should start with 2 computers which have a wireless network card, and when you got that running you could look into microcontrollers. Quote Link to post Share on other sites
0 GameMaster2030 1 Posted February 21, 2019 Author Share Posted February 21, 2019 16 hours ago, ben_mkiv said: There are none within the mod, but you can do that with OC but it requires knowledge about how things work. you could use network messages to send a command to the computer which the alarm is connected to. Or (which is more complicated) assemble a Microcontroller with the Alarm inside, which does listen for the network message. How to use network messages can be read up here: https://ocdoc.cil.li/component:modem You should start with 2 computers which have a wireless network card, and when you got that running you could look into microcontrollers. Yeah, I was already thinking about those two things. But thanks for helping me. Quote Link to post Share on other sites
I'm trying to get an alarm system to work, but when I try this code I'm getting an error that os_alarm does not exist in /boot/04_component.lua
Link to post
Share on other sites