This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
_OrangeJuice_'s profile picture

Preventing termination before login, but not after?

Started by _OrangeJuice_, 07 June 2013 - 10:03 AM
_OrangeJuice_ #1
Posted 07 June 2013 - 12:03 PM
Hey so i'm making a login program for startup that first writes a welcome message and asks for a input
the input is then compared to preset inputs.

Explanation this program should give acces to a game or all programs or shutdown if a i'm not logging in and nobody wants to play.
Question : I want to prevent people from using Ctrl+t but instead only unable the ctrl+T command when i'm logged in
Where should i put
os.pullEvent = os.pullEventRaw
and do i need to put some other codes?



	textutils.slowPrint("Welcome Player")
	textutils.slowPrint("Type start to Play")
	write("Do You wanna play: ")
	answer = read()
	if answer == "password" then
	shell.run("clear")
	sleep(1)
	textutils.slowPrint("CraftOS 1.3")
	textutils.slowPrint("Welcome _OJ_")
	os.run("w","rom")
	if answer == "start" then
	shell.run("game")
	if answer ~= "start" then
	textutils.slowPrint("Have a Nice Day!")
	textutils.slowPrint("Shutting down computer")
	sleep(0.1)
	os.shutdown()
	end
	end
	end

Lyqyd #2
Posted 07 June 2013 - 12:33 PM
Split into new topic. You should have used the designated sticky in this section to post your question.
_OrangeJuice_ #3
Posted 07 June 2013 - 12:38 PM
What's a Designated Sticky?
theoriginalbit #4
Posted 07 June 2013 - 12:41 PM
What's a Designated Sticky?
It is a sticky that is there for the exact purpose you needed it. This is the sticky he meant, link.
diegodan1893 #5
Posted 07 June 2013 - 01:05 PM

--Disable Ctrl + T
local backupEvent = os.pullEvent
os.pullEvent = os.pullEventRaw

--Enable Ctrl + T
os.pullEvent = backupEvent
_OrangeJuice_ #6
Posted 07 June 2013 - 01:59 PM
Thanks Diegodan1893 that solved one problem.:D/>