Hello, I have just began making a simple Operating System in ComputerCraft, with a sign in system. I want it to feel like you are free to do what you like with the OS and add some flexibility, but I also need restrictions to make it harder to cheat. I have made the username system terminatable with a variable of Mode, since I have an admin user and a guest, both with different passwords, but if you terminate it, it will have a value of 'nil'. I want to have an anti-cheat loop running in the background to detect whether your mode is set to nil, and if it is then it will end the loop but lock you out of everything on the computer until you restart. How do you make the loop run forever in the background, without stopping you from typing? If you do not understand what I mean, then leave a comment and I will try to explain more clearly. Thanks!
0
Background Loop; Computer Still Usable
Started by RPMGamer, Feb 11 2018 06:37 PM
command lua computer
5 replies to this topic
#1
Posted 11 February 2018 - 06:37 PM
#2
Posted 11 February 2018 - 11:33 PM
Why not just catch the terminate event? And when it's terminated lock everything out.
#3
Posted 12 February 2018 - 06:15 PM
What is the code to detect when it is terminated? Is there a way to read key presses or something so that it knows when you Ctrl+T?
#5
Posted 13 February 2018 - 10:30 AM
It works, and it catches the terminate event, but I cannot type while it is in a loop (but I want it to be in a loop forever). Thanks for that code, as it will be useful for future programs, but is there a way to create a background loop that lets you type?
#6
Posted 13 February 2018 - 10:24 PM
Nevermind, it works with a variablehere = read(). Thanks!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users