Jump to content




Merry Christmas Presents!


  • You cannot reply to this topic
12 replies to this topic

#1 gknova61

  • Members
  • 74 posts

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 Posted Image.

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:
Posted Image
Posted Image
Note: You can setup the redwire, and player detector on any side of the computer as shown here:
Posted Image

Step 2 - Load the program onto the computer and name it 'startup' then restart. Enter the side that your redwire is on:
Posted Image
Step 3 - Have your people interact with the player detector to get their presents! I would suggest a bag of holding or similar.
Posted Image
Posted Image

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 by gknova61, 14 December 2013 - 04:00 AM.


#2 Csstform

  • Members
  • 410 posts
  • LocationU.S.A.

Posted 13 December 2013 - 10:36 PM

Merry Christmas! And coal for you all!
Looks cool, may try it out!

#3 oeed

    Oversimplifier

  • Members
  • 2,095 posts
  • LocationAuckland, New Zealand

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.

#4 Csstform

  • Members
  • 410 posts
  • LocationU.S.A.

Posted 13 December 2013 - 11:55 PM

View Postoeed, on 13 December 2013 - 11:52 PM, said:

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!

#5 gknova61

  • Members
  • 74 posts

Posted 14 December 2013 - 04:01 AM

View PostCastform, on 13 December 2013 - 10:36 PM, said:

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

View Postoeed, on 13 December 2013 - 11:52 PM, said:

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 by gknova61, 14 December 2013 - 04:02 AM.


#6 Zambonie

  • Members
  • 477 posts
  • LocationSpring Hill, Fl

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)

#7 gknova61

  • Members
  • 74 posts

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

#8 Csstform

  • Members
  • 410 posts
  • LocationU.S.A.

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 by Castform, 14 December 2013 - 04:02 PM.


#9 willwac

  • Members
  • 182 posts

Posted 15 December 2013 - 12:41 PM

I get a startup error!

#10 gknova61

  • Members
  • 74 posts

Posted 15 December 2013 - 03:31 PM

View Postwillwac (NewCoolPC), on 15 December 2013 - 12:41 PM, said:

I get a startup error!
Mind providing the error mate? Works fine here.

#11 MineFarms

  • Members
  • 18 posts

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:

#12 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 21 March 2014 - 06:57 PM

View PostMineFarms, on 21 March 2014 - 05:09 AM, said:

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

#13 MineFarms

  • Members
  • 18 posts

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users