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

Merry Christmas Presents!

Started by gknova61, 13 December 2013 - 09:21 PM
gknova61 #1
Posted 13 December 2013 - 10:21 PM
Originally released on the SKCraft server by sk89q (best to use on a server with players or you'd just gift yourself once :P/>) but decided to release this to the public!

Who needs a ChristmasCraft tree when we have ComputerCraft! This program is made for those out there feeling a little generous this holiday .

Using a computer, a player detector, some redwire, and a dispenser, you can easily setup your own Christmas gift-giving stand where players just need to right click
on a player detector to get their present! Once they interact with the detector, their name is logged into a database (including a human-readable 'Christmas List' file) so
they cannot get multiple gifts.

Tutorial:
Step 1 - Setup your computer (usually want this hidden), player detector, and your dispenser. You can do this anyway you want as long as the player detector is touching
the computer, and the redwire is like so:


Note: You can setup the redwire, and player detector on any side of the computer as shown here:


Step 2 - Load the program onto the computer and name it 'startup' then restart. Enter the side that your redwire is on:

Step 3 - Have your people interact with the player detector to get their presents! I would suggest a bag of holding or similar.



Question: Would there be any interest for a naughty/nice list where you can specify who doesn't get a present or where you specify
the only people who can?

Download: pastebin get 2W9BXSKb startup
gist get 7955418
http://hastebin.com/beyigagiwe.js


Credits: Config API by ben657

Happy Holidays, everyone!
Edited on 14 December 2013 - 03:00 AM
Csstform #2
Posted 13 December 2013 - 10:36 PM
Merry Christmas! And coal for you all!
Looks cool, may try it out!
oeed #3
Posted 13 December 2013 - 11:52 PM
Nice idea, it is possible to put leaves on those trees right?

I suppose, for most people it's winter at christmas and many trees loose their leaves. In Australia, however, sometimes we get 40˚C christmases… hot hot hot.
Csstform #4
Posted 13 December 2013 - 11:55 PM
Nice idea, it is possible to put leaves on those trees right?

I suppose, for most people it's winter at christmas and many trees loose their leaves. In Australia, however, sometimes we get 40˚C christmases… hot hot hot.
That would be nice. Here in Ohio, we are at 40 degrees farhenheit. Practically freezing!
gknova61 #5
Posted 14 December 2013 - 04:01 AM
Merry Christmas! And coal for you all!
Looks cool, may try it out!
Thanks! Let me know how you like it and what I can change! Remember that this works best on a server :D/>
Nice idea, it is possible to put leaves on those trees right?

I suppose, for most people it's winter at christmas and many trees loose their leaves. In Australia, however, sometimes we get 40˚C christmases… hot hot hot.
Yes, sir it is possible.
Edited on 14 December 2013 - 03:02 AM
Zambonie #6
Posted 14 December 2013 - 08:37 AM
Looks Nice, Merry christmas :D/> Will try out.
Ha, I live in florida and its… Around now 65 Deg F . 2 Days ago we had 80 Deg F XD (Its winter here)
gknova61 #7
Posted 14 December 2013 - 02:52 PM
Haha, here in Hawaii it's a 80F sunny day. We're not affected by seasons nor do we get snow :D/>
Csstform #8
Posted 14 December 2013 - 04:01 PM
And I'm stuck in Ohio. :P/>

Today we are getting 4-6 inches of snow. Yay.
Edited on 14 December 2013 - 03:02 PM
willwac #9
Posted 15 December 2013 - 12:41 PM
I get a startup error!
gknova61 #10
Posted 15 December 2013 - 03:31 PM
I get a startup error!
Mind providing the error mate? Works fine here.
MineFarms #11
Posted 21 March 2014 - 05:09 AM
Yeah I Can Here:
startup:15: attempt to index ? (a nil value)

function create()
file = fs.open(path,"a")
file.close()
end
:huh:/>
TheOddByte #12
Posted 21 March 2014 - 06:57 PM
Yeah I Can Here:
startup:15: attempt to index ? (a nil value)

function create()
file = fs.open(path,"a")
file.close()
end
:huh:/>
If I'm correct it may be because the file that the variable path is equal to doesn't exist, Since it opens append mode.
Or it's because path haven't been set to anything, Try doing this at the top of the program

local path = "test_file"
and see if that fixes anything
MineFarms #13
Posted 23 March 2014 - 01:18 AM
Nope
Here My Setup:

http://imgur.com/a/ShXOz#0

Im Making it so when people join my server they will get a
free pair of terminal glasses. And Im making it so they cant get another pair.

The cable goes to the player detector
and the white wire goes to the dropper.