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

(Help Needed)Project:Credit Card in Minecraft

Started by tutas01, 15 October 2012 - 04:39 PM
tutas01 #1
Posted 15 October 2012 - 06:39 PM
So i am trying to make some kind of a credit card system but, i don't know how to do it.
My only experince with the mod is just a passcode lock of username and password.
And a Calculator that i am trying to use in this project.

So i know about the apis to change the name and check files of disks.
And i think that if i do something with it maybe be the answer.

But i don't know how make the os check only a part of the name of the file.
Like checks a file called "Client" and if that file exists will ask for a file called "Money=(part to not check)"
Will ask the seller the amout of gold that will be deleted.
Look at money and then subtract the amount and get to another card(in this case the seller(i know about how to do it peripheral.wrap)).
The result will replace the another file to "Money=(New Money)
If dont have the money will warn the seller before he gives the item.

And it shold make the same for add.
Give the gold and get it on card.

I wish that will be not asking to mush.
You must only kinda make the sistem of the check.
The rest i can do.
So please help!!
I will make the credits to anione that helped.

(My english is not perfect i am portuguese)
Ditto8353 #2
Posted 15 October 2012 - 06:57 PM
I believe you are going about this in the wrong way.
It sounds like you are trying to save the account balance as a file name on the disk. You should use a file called "money" or "balance" which is on the disk and store the value for the account inside the file. That should simplify your problem quite a bit.
Doyle3694 #3
Posted 15 October 2012 - 07:01 PM
sounds abit to easy hacked… maybe a account database instead?
Ditto8353 #4
Posted 15 October 2012 - 07:09 PM
sounds abit to easy hacked… maybe a account database instead?

True. I suppose the question at this point then would be what the OP is capable of.
tutas01 #5
Posted 15 October 2012 - 07:22 PM
sounds abit to easy hacked… maybe a account database instead?
That's the thing i realy dont know how to work with those kind of things!
I believe you are going about this in the wrong way.
It sounds like you are trying to save the account balance as a file name on the disk. You should use a file called "money" or "balance" which is on the disk and store the value for the account inside the file. That should simplify your problem quite a bit.
The same as upwords i dont know how to set up things like that i only know about changing files names.
I'm trying to see in computer craft wiki about changing things like that but i dont find anyting!
Ditto8353 #6
Posted 15 October 2012 - 07:29 PM
I dont know how to set up things like that i only know about changing files names.
I'm trying to see in computer craft wiki about changing things like that but i dont find anyting!

It sounds to me like you are very ambitious, perhaps a little too ambitious.
Try doing some reading in the Lua 5.0 Manual
Here is the portion on File I/O
tutas01 #7
Posted 15 October 2012 - 07:39 PM
I dont know how to set up things like that i only know about changing files names.
I'm trying to see in computer craft wiki about changing things like that but i dont find anyting!

It sounds to me like you are very ambitious, perhaps a little too ambitious.
Try doing some reading in the Lua 5.0 Manual
Here is the portion on File I/O
Thank you!
I will try to look.
brett122798 #8
Posted 15 October 2012 - 11:33 PM
Hi, I'd like to inform you that your signature has code that would error out because it's missing an 'end' or you can change the second 'if' to 'elseif'.
Doyle3694 #9
Posted 16 October 2012 - 08:23 AM
it has capital print, is missing a " and stuff like that too. but that's OT. I can surely help you if you try making some code. I can help you debug and maybe help you with some stuff you don't know how to do etc.