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

Computercraft Credit Card System without colors!

Started by H4X0RZ, 17 April 2013 - 08:54 AM
H4X0RZ #1
Posted 17 April 2013 - 10:54 AM
Hello everyone,
This is my first release of my Credit Card System.
So, not all is finished or it's buggy but I think you can handle it ^_^/>/>

The Programs:

Creator:
SpoilerWhat does it?
SpoilerIt allows you to create a Credit Card

Where's the code?
SpoilerPastebin:
http://pastebin.com/QD2Jc0D0
Thx to superxander

Code:
Spoiler

 term.clear()
 local Data = {}
 --Functions
 function header() 
print(textutils.centerprint("+-------------------+", 1)) print(textutils.centerprint("|Credit Card Creator|", 2)) 
print(textutils.centerprinr("|

print(textutils.centerprint("+-------------------", 4)) end

function no_card() 
while not fs.exists("disk") do 
print(textutils.centerprint("------------------------+", 8)) 
print(textutils.centerprint("|Please insert Credit Card |", 9)) 
print(textutils.centerprint("+-------------------------+", 10)) 
sleep(2) 
end 
end

function card_isPresent_but_not_prepared() function load() 
fs.makeDir("disk/reditcards/") 
sleep(1) 
file = fs.open("disk/creditcards/card1.acc", "w") file.close() 
sleep(1) r
eturn true 
end 
function screen() 
while true do 
print(textutils.centerprint("

print(textutils.centerprint("

print(textutils.centerprint("

print(textutils.centerprint("+--------------------------+", 8)) 
print(textutils.centerprint("|

print(textutils.centerprint("+--------------------------+", 10)) 
sleep(1) 
end 
end 
parallel.waitForAny(load, screen) 
print(textutils.centerprint("

print(textutils.centerprint("

print(textutils.centerprint("

print(textutils.centerprint("+--------------------------+", 8)) 
print(textutils.centerprint("|

print(textutils.centerprint("+--------------------------+", 10)) 
sleep(3)

end

function asking_for_data() 
print(textutils.centerprint("

print(textutils.centerprint("

print(textutils.centerprint("

tem.setCursorPos(20,6) 
print("+-------------------+") 
term.setCursorPos(20,7) 
print("|

term.setCursorPos(20,8) 
print("+-------------------+") 
term.setCursorPos(20,10) 
print("+-------------------+") 
term.setCursorPos(20,11) 
print("|

term.setCursorPos(20,12) 
print("---------------------+") 
term.setCursorPos(10,7) 
write("Username:)
 term.setCursrPos(10,1) 
write("Password:") 
sleep(0.5) 
term.setCursorPos(21,7) 
username = read() 
term.setCursorPos(21,11) 
password = read("*") 
end

function checking()

if not username == nil and not password == nil then 
table.insert("Data", username) 
random_ID = (math.random(1000, 9999) 
table.insert("Data", random_ID) 
table.insert("Data", 0) -- This is the start money end 
end 
function create_file() 
pass_file = fs.open("disk/creditcards/pass1.pass", "w") 
pass_file.writeLine(StrUtils.SHA1(password)) pass_file.close()
 h = fs.open("disk/creditcards/card1.acc", "w") local serialized = (textutils.serialize(Data)) encrypted = StrUtils.encrypt(serialized, password) h.writeLine(encrypted) 
h.close()

--Function Calling 
header() 
if not fs.exists("disk/creditcards/card1.acc") then card_isPresent_but_not_prepared() 
end 
if fs.exists("disk/creditcards/card1.acc") then asking_for_data() 
end 
checking() 
create_file() 

Functions:
Spoiler

-Create a card
-Hashing

Plans for the future:
Spoiler

-Fully mysql service (via http api)
-Login Page
-Service works unbounded to 1 SSP/SMP cuz I have 5 - 10 Databases for servers, all can be used.
For example: On one server you can get money easily and on another server you can pay cool things, so you have one account for some servers :D/>
superaxander #2
Posted 18 April 2013 - 04:24 AM
Pastebin link: http://pastebin.com/QD2Jc0D0
Ingame: pastebin get QD2Jc0D0 card
Dlcruz129 #3
Posted 18 April 2013 - 04:31 AM
Just because you have textutils.centerprint() doesn't mean we all do.
masterdisasterHD #4
Posted 18 April 2013 - 04:50 AM
http://www.pastebin.com/0wurXsFJ

pastebin get 0wurXsFJ ccard
Engineer #5
Posted 18 April 2013 - 05:13 AM
I dont think you have tested this code, even when you have textutils.centerprint:

Error 1 ( Saw this 7 times ):
print(textutils.centerprint("
-> ')' expected blabla

Error 2 ( Saw this 3 times ):
function something()
– code
-> 'end' expected

Error 3:
(some proper coding, insert here) r
eturn
-> attempt to call nil

Conclusion: http://pastebin.com/hZg4fP2z :P/> <- Sorry for the douche move
H4X0RZ #6
Posted 18 April 2013 - 05:17 AM
Just because you have textutils.centerprint() doesn't mean we all do.
Yea, I know ^^
But I saied "buggy", so, I will add an API Section in my program :)/>