Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

SavageNoob

Members
  • Content Count

    3
  • Joined

  • Last visited

  1. My apologies in advance for being so bad, basically i want a simple script that when me or a friend are around a door, it opens the door, but when no one is around that is authorized, close the door. I guess I do not know how to manipulate a table correctly in lua. When you run a scan() with an RFID reader in opensecurity, it returns a table with 4 values, name, range, data (password), locked, and UUID of the rfid reader. I do not know how to pin point specifically to the name of the table, such as if scan[name] == savagenoob then open the door, if none exist close the door. As this code sits, it doesnt work, and if the scan does not find anyone it throws an error in pairs table. Some guidance would be appreciated. https://pastebin.com/embed_js/rZPbYy4z door = require("component").os_door rfid = require("component").os_rfidreader scan = rfid.scan() for k, v in pairs(scan[1]) do print(tostring(k)..": "..tostring(v)) if k[1] == "savagenoob" then print "You are Allowed" door.open() print "Door Open" else door.close() print "You are not allowed" end end
  2. SavageNoob

    OpenSecurity

    Hello, I was wondering if anyone could point me in the direction of a sample code to interact with these machines, the card writer most importantly. I attempted and failed miserably, do not know how to copy and paste code from within the minecraft opencomputer system. I am a complete noob so bear with me. I tried to use and edit this (I know its the wrong mod, i need a reference point as there is none for this mod besides the wiki) and get an attempt to call nil. I would also like to know how to program the other machines such as the keypad, i see the example code but how and where do i put it? Do i have to connect it to a computer first? So confused. Thank you in advance,
  3. Hello, I was wondering if anyone could point me in the direction of a sample code to interact with these machines, the card writer most importantly. I attempted and failed miserably, do not know how to copy and paste code from within the minecraft opencomputer system. I am a complete noob so bear with me.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.