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

SavageNoob

Members
  • Content Count

    8
  • Joined

  • Last visited

  1. Dude, that is the most helpful response i could have expected. Gonna dive into this now, see if i can get it working, and thank you for having patience with such a nub like me. The fact you didnt just correct my crap code but actually explained it to me is awesome. I am trying to learn not just be shoveled code so I have to ask dumb questions on the next program. People should take note, I am sure this will help alot out, not just me. One more dumb question. Could this be easily modified to add multiple people to the allowed list? Like if I team with someone. I play on a very aggressive guns/heli server and we need quick in/out sometimes.
  2. So I am trying to make a program where if i am in the vicinity the doors will open, and if im not, the doors will close and the alarm will sound. The problem I am having is that if no one is around, it throws an error message that says trying to access a nil field. Here is my code : local component = require("component") local colors = require "colors" gpu = require("component").gpu alarm = require("component").os_alarm door = require("component").os_door entity = require("component").os_entdetector local w, h = gpu.getResolution() local delay -- sleep time local player -- list of players while true do os.sleep(2) if entity.scanPlayers(64) == true then scan = entity.scanPlayers(64) name = scan[1].name if name ~= "sav" then door.close() alarm.activate() print("Hello " .. scan[1].name) os.sleep(2) alarm.deactivate() elseif name == "sav" then door.open() alarm.deactivate() print("Welcome Home Sav") os.sleep(2) end os.sleep(4) end end This obviously doesnt work and just freezes the computer, any guidance on how to do something like, if someone is around then either open the door or close it based on who it is, if no one is around, than keep repeating the program until someone is. Any help would be appreciated, Thank you
  3. Whats the best way to scale text vertically and have the text scroll horizontally?
  4. 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
  5. 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,
  6. 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.