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

Turtle ATM

Started by Luiginico, 01 February 2013 - 08:28 AM
Luiginico #1
Posted 01 February 2013 - 09:28 AM
Hi I was working on my BlackJack script, and I made a little turtle ATM, so I tought to share it with the furum.

Features:
  • Up to 4 currency
  • Fully automaded
  • No need for fuel
  • It works with everything
How to setup:

1: The turtle
Spoilerhttp://i49.tinypic.com/359mvt1.jpg
  • Iron = 1 credit
  • Gold = 5 credits
  • Emerald = 10 credits
  • DIamond = 50 credits
You can use all the types of items you want for each currency, even no items at all (but you still need a 1 credit currency).
(The turtle must be a wireless one)

2: The bank
Spoilerhttp://i46.tinypic.com/284cpf.jpg
  • 1 credits = In front
  • 5 credits = Right
  • 10 credits = Back
  • 50 credits = Left
You can use any type of storage device, like a tube or a pipe, even enderchest if you want, you don't need to put the chest for a currency if you don't want to use it.


3: The arrival/departure chest (ADchest)
Spoilerhttp://i45.tinypic.com/13z3dra.jpg
Put a chest on top of the turtle, this is where all the items are going to be put/extract by/from the turtle, you can put tubes or pipes to transport the items in and out from the turtle.
http://i47.tinypic.com/ndnehv.jpg
Or, as I like to do, put an enderchest on top so all items will be instantly tranported, just make sure no one can open the chest when the don't need to.

Commands:
All the commands needs to be sent trought rednet using
rednet.send(<atm id>, <command>)
, and it will return one value at a time trought rednet, the commands are:

"cashConnect" --Use this command the first time you try to connect to the turtle, it will return "cashConnected" if succesful
"cashTake" --Use this command to tell the turtle to pull out ALL the items in the ADchest into the bank. it will return "cashYes" if all the items were currency, "cashNo" if at least 1 item wasn't a currency and an int as the total value of all the items pulled out:
"cashGive" int ammount --Use this command to tell the turtle to give you ammount credits, the turtle will automatically give you as few items possible. The commands are 2 separate and have to be sent one after the other, it will return an int as the missing credits, if the bank didn't have enaught credits to fulfill your request:
After every operation the ATM is going to disconnect you to be able to cumunicate with others computers.

The code can be found here: http://pastebin.com/81E4qRvT
superaxander #2
Posted 07 February 2013 - 08:16 AM
Very easy to hack. So i think it is not the best solution out there.