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

GuestBook Program By Fang

Started by Mr. Fang, 06 December 2012 - 03:05 PM
Mr. Fang #1
Posted 06 December 2012 - 04:05 PM
I made a simplified guestbook for my "factory" in minecraft. Please bare in mind that this is for ADVANCED Computers.
Be sure to set this up as a "startup"
I'm still learning how to incorporate a os.pullEventRaw.

NOTE: To go into maintenance mode use "maintain" as your name
NOTE:For people that need help try:
 pastebin get S5qci2qZ startup 


term.clear()
term.setCursorPos(1,1)
term.setTextColor(256) --change this for customized colors or remove for non-advanced cpu's
textutils.slowPrint("GuestBook")
textutils.slowPrint("Please Type Your Name Below:")
local time = textutils.formatTime(os.clock()) --wasn't very accurate for me
local name = read()
if name == "maintain" then --change "maintain" into any passcode you want
print("Maintainence Mode Activated")
else
term.setCursorPos(1,1)
term.clear()
print("Welcome "..name.." !")
g = fs.open("guestbook", "a")
g.writeLine(" "..name.." logged at "..time.." ") --VERY simple logging, to read book enter maintenance mode and type "edit guestbook"
sleep(5)
os.reboot()
end



HELP! How do I setup a os.pullEventRaw() for this?!?
Dlcruz129 #2
Posted 06 December 2012 - 04:10 PM
What are you trying to attempt with os.pullEventRaw()?
rhyleymaster #3
Posted 06 December 2012 - 05:11 PM
Do you mean:
os.pullEvent = os.pullEventRaw?
Mr. Fang #4
Posted 07 December 2012 - 04:54 AM
What are you trying to attempt with os.pullEventRaw()?
Do you mean:
os.pullEvent = os.pullEventRaw?
Sorry I had no idea they went together. The idea is that all this computer does is log people into the guestbook. Naturally I want there to be a passcode to read the guestbook. So, I need os.pullEvent or whatever to keep people from CTRL + T …that way only I can open that specific file :D/>

(I'm planning to use this on a server and I'd rather not have any wandering coders ruin my guestbook)


SO do you know where and what I should insert to prevent the CTRL + T?
Leo Verto #5
Posted 07 December 2012 - 05:03 AM
At the very top.
TheVarmari #6
Posted 07 December 2012 - 07:07 AM
At the very top, insert this piece of code

os.pullEvent = os.pullEventRaw
Mr. Fang #7
Posted 07 December 2012 - 08:18 AM
At the very top.
At the very top, insert this piece of code

os.pullEvent = os.pullEventRaw

Thanx, Leo gave a good hint, but TheVarmari really helped with the example!

Thank You too rhyley and dlcruz!
rhyleymaster #8
Posted 07 December 2012 - 08:05 PM
No problem.