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

PomTom National Bank

Started by PomTom12, 18 June 2015 - 10:54 AM
PomTom12 #1
Posted 18 June 2015 - 12:54 PM
PomTom National Bank






What is it?

I have created a ComputerCraft Bank which allows players to store and retrieve upto 5 levels of currency.
Each currency level can be set to whatever item you want and has a field to set the worth.
The worth field is how much of the lowest currency each level is. It then calculates the difference between the levels for you the best it can.

For an example on my server the currency is;

Level 1: Shillings
Level 2: Pounds - 1 Pound is worth 50 Shillings
Level 3: Diamonds - 1 Diamond is worth 2,500 Shillings
Level 4: Jewels - 1 Jewel is worth 125,000 Shillings
Level 5: Crowns - 1 Crown is worth 6,250,000 Shillings

This all works out to be a 50 between each level.
You dont have to have the same difference per level. For our server we found it easier.

The Bank is made up of 8 computers;
- 4 Currency Withdraw computers
- 1 Database computer
- 1 Client Computer
- 1 Server and Withdraw in one
- Currency Board (Optional - scrolls through the worth of each level.)

Each player has a username, password and Bank Card (floppy disk).
This card does not hold any balances or passwords but has a unique 5 digit pin which is an added layer of security for player accounts.

Please feel free to make changes to it, I just ask that my Minecraft name PomTom12 be mentioned as the original developer.

I would like to mention the following people because without their tutorials on YouTube and programs such as NPaintPro I would not have gotten
the bank to where it is now, so thanks;

- Nitrogen Fingers
- TheStillRendering
- DireWolf20
- Dan200

What can Everyone do?

All players can do the following once logged in;

- Deposit Funds
- Transfer Funds
- Withdraw Funds
- View Recent Transactions
- Count Funds
- Change Password

What can Admins do?

For players with Admin access;

- Create Account
- Delete Account
- List Current Users
- Reissue a bank card to a player
- View Currency Levels
- Update currency levels
- Update Bank
- Reset Passwords

Screenshots

SpoilerFront of Bank



Inside Bank



Main Screen




Counter Screen




Login Screen




Account Screen




Main FunctionsDeposit Screen




Withdraw Screen




Transfer Screen


Admin FunctionsAdmin Panel




Create Account




List Accounts




List Currency Levels



New Currency Screen


How to Install?

If you would like to download and build one on your server/single player world I have a manual here;

https://www.dropbox.com/s/m8a3rg2w7dw4du3/pomtom%20national%20bank%20manual.docx?dl=0

Requirements:

- Computercraft 1.74
- OpenBlocks-1.7.10-1.4.4.jar
- OpenModsLib-1.7.10-0.8.jar
- OpenPeripheralCore-1.7.10-1.2.jar
- OpenPeripheralIntegration-1.7.10-0.3.jar
- OpenPeripheralAddons-1.7.10-0.4.jar

Updates

Update 14.09.2015:

- The list account screen has been updated to allow for admins to reset passwords. It allows multiple users with pages.
- Create account screen has been updated to have radio like buttons for the account type and the starting balance isn't hard coded so can be whatever the admin wants.
- The account screen has been changed to include a settings button. This allows users to change their password.
- The code has been updated to a newer mod version, they are;
- Computercraft 1.74
- OpenBlocks-1.7.10-1.4.4.jar
- OpenModsLib-1.7.10-0.8.jar
- OpenPeripheralCore-1.7.10-1.2.jar
- OpenPeripheralIntegration-1.7.10-0.3.jar
- OpenPeripheralAddons-1.7.10-0.4.jar

How to update the Bank

Client
  1. Press the update button in the Admin Control Panel on the client computer.
Server
  1. Press and hold Ctl+T until you get to a command line.
  2. type pastebin get eSgrKy6s updateServer and hit enter
  3. type updateServer and hit enter
  4. Reboot by pressing and holding Ctrl+R
Note: future updates you just need to terminate the computer using Ctrl+ t and run the updateServer program already installed

Database
  1. Press and hold Ctl+T until you get to a command line.
  2. type pastebin get Z9viAGE6 updateDatabase and hit enter
  3. type updateDatabase and hit enter
  4. Reboot by pressing and holding Ctrl+R
Note: future updates you just need to terminate the computer using Ctrl+ t and run the updateDatabase program already installed


Previous Updates
SpoilerUpdate 14.07.2015:

- There is now a Counter Application on the main screen to help players determine how much to put in the deposit screen fields
- The Admin Panel has been updated to include a Update button for the client computer

if you have an existing version of the bank you can run the below command to get the update, after you do this you just use the button for future updates;

- pastebin get Yi3qzHk3 tempInstall

Update 27.06.2015:

- You don't have to have resonant strongboxes or diamond chests as shown in the pictures and manual. The diamond chest was because of an original build of the bank and hasn't been changed and the resonant strongboxes allows for a block to be placed on top while still be accessible.
- I have just made an update to stop termination on screens (Ctrl+T) and have applied some validation on a lot of the fields
Edited on 19 September 2015 - 11:38 AM
ebernerd #2
Posted 25 June 2015 - 11:19 PM
This looks very nice. :)/>

Great job!
PomTom12 #3
Posted 26 June 2015 - 03:24 AM
Thanks :)/>
DannySMc #4
Posted 26 June 2015 - 09:07 AM
I have one question, how is this an OS? Like the idea, but it isn't an OS, this needs to be moved to the programs section.

Nice design though.
PomTom12 #5
Posted 26 June 2015 - 09:19 AM
Thanks, yeah I wasn't sure which section in the program's area it should go and figured here. If it needs to be moved I don't mind
DannySMc #6
Posted 26 June 2015 - 09:32 AM
Thanks, yeah I wasn't sure which section in the program's area it should go and figured here. If it needs to be moved I don't mind
Don't worry an admin will probably do that for you!:D/>

Also do you use a database? for your bank because this would be awesome across server?:D/>
PomTom12 #7
Posted 26 June 2015 - 09:36 AM
Thanks, yeah I wasn't sure which section in the program's area it should go and figured here. If it needs to be moved I don't mind
Don't worry an admin will probably do that for you!:D/>/>

Also do you use a database? for your bank because this would be awesome across server?:D/>/>

Okay cool haha :D/>
No I don't have a database I just use tables saved to a file. I think it would be cool to do too, I just have no idea at the moment on how to do it.
Creator #8
Posted 26 June 2015 - 10:03 AM
Why do tou use a table?
Do you imaagine what happens when you have got 1000 users. The table becomes huge and loading times too. I'd rather have a file per user.
PomTom12 #9
Posted 26 June 2015 - 10:10 AM
Why do tou use a table?
Do you imaagine what happens when you have got 1000 users. The table becomes huge and loading times too. I'd rather have a file per user.

I decided to go with tables because I thought it would be easier having everything in the one file. And thought it was a waste creating a file per user. I have one that holds all the transactions and another one that stores the user accounts. Do you think it would be better having separate files? I am always open to better alternatives :D/>
Creator #10
Posted 26 June 2015 - 10:15 AM
Well, yes multiples files is the better alternative, since if you use one file it could be millions of symbols long, and that would take a long time to load!
DannySMc #11
Posted 26 June 2015 - 10:18 AM
Well, yes multiples files is the better alternative, since if you use one file it could be millions of symbols long, and that would take a long time to load!

Errr I wouldn't say a file per person, like on my database for the app store it isn't one app per table… it is a row per app…? So idk, depends what type of table you are using…
PomTom12 #12
Posted 26 June 2015 - 11:08 AM
Well, yes multiples files is the better alternative, since if you use one file it could be millions of symbols long, and that would take a long time to load!

Errr I wouldn't say a file per person, like on my database for the app store it isn't one app per table… it is a row per app…? So idk, depends what type of table you are using…

Well it is an array {} saved to a file and each account is seperated by a comma. An example of the userAccounts file is;

{
UserBalance = 10477523,
UserPin = "40853",
UserPass = "pass",
UserID = "PomTom",
UserType = "Admin",
},

I like the idea of the database option so the data can be accessed across multiple servers and will probably handle more users
Edited on 26 June 2015 - 09:40 AM
DannySMc #13
Posted 26 June 2015 - 11:10 AM
Ahh I see that is not to bad then so like this:


accounts = {
    user1 = {
        -- Stuff here
    },
    user2 = {
        -- Stuff here
    }
}
PomTom12 #14
Posted 26 June 2015 - 11:14 AM
Ahh I see that is not to bad then so like this:


accounts = {
	user1 = {
		-- Stuff here
	},
	user2 = {
		-- Stuff here
	}
}

yeah its the transaction file that would get too big really quickly. When a user is transferring funds to another player it creates a record for the sender and one for the receiver like this;

SpoilerSender
{
TranDesc = "Debt",
PayeeID = "PomTom",
UserID = "Tom",
TranAmount = 3,
TranID = 3,
TranType = "Transfer",
TranTotal = 247,
TranCRDR = "MINUS",
},

receiver
{
TranDesc = "Debt",
PayeeID = "Tom",
UserID = "PomTom",
TranAmount = 3,
TranID = 2,
TranType = "Transfer",
TranTotal = 253,
TranCRDR = "ADD",
},
Edited on 26 June 2015 - 09:22 AM
DannySMc #15
Posted 26 June 2015 - 11:55 AM
Hmm I see
PokeAcer #16
Posted 26 June 2015 - 04:22 PM
-snip-
Edited on 26 June 2015 - 07:24 PM
PokeAcer #17
Posted 26 June 2015 - 09:28 PM
BTW,
If you dont wanna use Diamond Chest, YOU NEED TO USE REGULAR CHESTS!!!
Strongboxes do not get the item from creative ones, and I couldn't withdraw any funds from my bank in SSP when using resonant strongboxes next to the creative ones.

Also, PomTom12,
Deposit funds aren't working when I try. I place my item into the left and try but it fails. Maybe because I can't set the item (When I hit REF it skips to the make user page, no level 2/3/4/5 adding) so I've been manually using the programs. Also, you need to fix terminating…
Can you fix the REF error, or is it because I'm using a regular chest and not a strongbox on outside and a regular chest inside for levels (which is fine because I can withdraw perfectly)
PomTom12 #18
Posted 27 June 2015 - 12:00 AM
BTW,
If you dont wanna use Diamond Chest, YOU NEED TO USE REGULAR CHESTS!!!
Strongboxes do not get the item from creative ones, and I couldn't withdraw any funds from my bank in SSP when using resonant strongboxes next to the creative ones.

Also, PomTom12,
Deposit funds aren't working when I try. I place my item into the left and try but it fails. Maybe because I can't set the item (When I hit REF it skips to the make user page, no level 2/3/4/5 adding) so I've been manually using the programs. Also, you need to fix terminating…
Can you fix the REF error, or is it because I'm using a regular chest and not a strongbox on outside and a regular chest inside for levels (which is fine because I can withdraw perfectly)

Yeah thats correct you can use any chest for the withdraw computers. Thats strange it didn't work for you with the resonant strongbox, it seems to work fine with the withdraw computers.
The reason why I have diamond is when I was first creating the bank I wasn't going to have the creative strongboxes and needed a chest big enough to store the currency.
Once I changed the plan I couldn't be bothered changing it, I will mention that in the original post and manual that any chest can be used for that bit thanks :)/>

Okay I will have a look at that now to see whats happening. It shouldn't be to do with the chests at the front, the only reason why I have the resonant strongboxes there is that they can have a block above them and still be opened.
yeah I am working on making it so you can't terminate the programs, pretty insecure at the moment haha.
Edited on 27 June 2015 - 03:36 AM
PomTom12 #19
Posted 14 July 2015 - 10:22 AM
I have now made an update to make the client updatable without having to mess around with the files behind the scenes.
when I post an update on here you just need to click the 'Update' button on the Admin Panel (see Screen Shots).

I have also included on the main screen a counter application to help those with lots of currency find out what they need to put in the deposit fields

I apologise for those who have already installed the bank, I will post the pastebins for the Counter and new Admin Screen update :)/>

Thanks to all those that have had an interest in the Bank I really appreciate it :)/>
PomTom12 #20
Posted 14 September 2015 - 01:16 PM
I have finally gotten around to updating the bank, there are new password changing features and a nice way to list user accounts.
The create account screen now allows admins to set the starting balance and select the account type using buttons.

The code has now been updated to a newer version of computer craft and open peripherals and so for those with old versions it may not work.
Some of the screen shots have been changed and the manual has finally been updated too.

Thanks to all those that have had an interest in the Bank, I really appreciate it :)/>