This game is going to be a hacking simulator. Kind of like uplink, or BS Hacker Zero. I'm almost finished with the engine,but I don't have any graphics yet. It's all words. So far, I have only made three other computers to hack for testing, but I am about to start adding levels. Right now I am working on the password cracker. It works, but I can't figure out how to tell when it's done. I need to check that a varying number of conditions are all true.
The two things you need to know to get started are, the help command. Just type help, and it will list all the commands in the game. And, the server www.searchstuff.com has a list of all the server names.
REM Created By 2122
if check display mode (1024,768,16) = 1 then set display mode 1024,768,16
money = 3000
global L as integer
L = 1
dim alpha$(36)
alpha$(1) = "a"
alpha$(2) = "b"
alpha$(3) = "c"
alpha$(4) = "d"
alpha$(5) = "e"
alpha$(6) = "f"
alpha$(7) = "g"
alpha$(8) = "h"
alpha$(9) = "i"
alpha$(10) = "j"
alpha$(11) = "k"
alpha$(12) = "l"
alpha$(13) = "m"
alpha$(14) = "n"
alpha$(15) = "o"
alpha$(16) = "p"
alpha$(17) = "q"
alpha$(18) = "r"
alpha$(19) = "s"
alpha$(20) = "t"
alpha$(21) = "u"
alpha$(22) = "v"
alpha$(23) = "w"
alpha$(24) = "x"
alpha$(25) = "y"
alpha$(26) = "z"
alpha$(27) = "0"
alpha$(28) = "1"
alpha$(29) = "2"
alpha$(30) = "3"
alpha$(31) = "4"
alpha$(32) = "5"
alpha$(33) = "6"
alpha$(34) = "7"
alpha$(35) = "8"
alpha$(36) = "9"
dim l(100,1)
dim commands$(20)
commands$(1) = "help"
commands$(2) = "dir"
commands$(3) = "cd"
commands$(4) = "connect"
commands$(5) = "disconnect"
commands$(6) = "d"
commands$(7) = "exit"
commands$(8) = "cls"
commands$(9) = "open"
commands$(10) = "delete"
commands$(11) = "edit"
commands$(12) = "new"
commands$(13) = "deleteall"
commands$(14) = "login"
commands$(15) = "logout"
commands$(16) = "crack"
commands$(17) = "withdraw"
commands$(18) = "deposit"
type hosts
hname as string
ip as string
dname as string
fname as string
fcontent as string
ln as string
pw as string
smoney as integer
endtype
dim yourcomp(1,0,10,50,50) as hosts
` Your computer
yourcomp(1,0).dname = "Root"
yourcomp(1,0,1).dname = "System"
yourcomp(1,0,1,1).fname = "Windows 98"
yourcomp(1,0,2).dname = "Data"
yourcomp(1,0,2,1).fname = "Password Cracker"
yourcomp(1,0,2,2).fname = "Net Scape"
dim hosts(10,10,10,50,50) as hosts
` searchstuff.com
hosts(1,1).ln = "admin"
hosts(1,1).pw = "opensaysme"
hosts(1,2).ln = "readonly"
hosts(1,2).pw = "library"
hosts(1).hname = "www.searchstuff.com"
hosts(1).ip = "64.668.351.99"
hosts(1,0).dname = "Root"
hosts(1,0,1).dname = "Logs"
hosts(1,0,1,1).fname = "There Are Currently No Logs"
hosts(1,0,2).dname = "Data"
hosts(1,0,2,1).fname = "Server List.Txt"
hosts(1,0,2,1,1).fcontent = "www.firstserve.com"
hosts(1,0,2,1,1).fcontent = "www.tempserver.lan"
hosts(1,0,3).dname = "System"
hosts(1,0,3,1).fname = "Windows XP"
hosts(1).smoney = 0
` firstserve.com
hosts(2,1).ln = "admin"
hosts(2,1).pw = "final"
hosts(2,2).ln = "readonly"
hosts(2,2).pw = "public"
hosts(2).hname = "www.firstserve.com"
hosts(2).ip = "265.359.2.47"
hosts(2,0).dname = "Root"
hosts(2,0,1).dname = "Logs"
hosts(2,0,1,1).fname = "There Are Currently No Logs"
hosts(2,0,2).dname = "Data"
hosts(2,0,2,1).fname = "Dark Basic.doc"
hosts(2,0,2,1,1).fcontent = "This file is called Dark Basic.Txt"
hosts(2,0,2,1,2).fcontent = "In this file we will discuss the advantages of DBP over DBC ..."
hosts(2,0,3).dname = "System"
hosts(2,0,3,1).fname = "Windows 98"
hosts(2).smoney = 0
` tempserver.lan
hosts(3).hname = "www.tempserver.lan"
hosts(3).ip = "465.97.235.67"
hosts(3,1).ln = "admin"
hosts(3,1).pw = "money$$$"
hosts(3,0).dname = "Root"
hosts(3,0,1).dname = "Logs"
hosts(3,0,1,1).fname = "There Are Currently No Logs"
hosts(3,0,2).dname = "Data"
hosts(3,0,2,1).fname = "accountinfo.doc"
hosts(3,0,2,1,1).fcontent = "Withdraw money with the withdraw command"
hosts(3,0,2,1,2).fcontent = "Deposit money with the deposit command"
hosts(3,0,3).dname = "System"
hosts(3,0,3,1).fname = "Unknow"
hosts(3,0,3,2).fname = "LAN temp settings"
hosts(3).smoney = 3000
gosub login
txth# = text height("fish")
Do
if connected = 1
ink rgb(0,0,0), rgb(0,0,0)
box 750,0,screen width(),3*txth#
ink rgb(255,255,255),rgb(0,0,0)
set cursor 750,0
print "Connected to: ", curhostn$
set cursor 750,0+txth#
print "IP: ", curhostip$
set cursor 750,0+2*txth#
print "Money: ", money
set cursor 0,txth#*(L-1)
endif
if connected = 0
ink rgb(0,0,0), rgb(0,0,0)
box 750,0,screen width(),3*txth#
ink rgb(255,255,255),rgb(0,0,0)
set cursor 750,0
print "Not Connected"
set cursor 750,0+txth#
print "Money: ", money
set cursor 0,txth#*(L-1)
endif
if cmnd$ = "" then gosub CLI
Loop
login:
input "What is your hacker alias? ", usname$ : inc L : gosub L46
return
L46:
if L >= 46
print "The screen will be cleared when you press a key."
wait key
cls
L = 1
endif
Return
CLI:
input "[\ ", usname$, " /]: ", command$ : Inc L : gosub l46
length = len(command$)
if left$(command$,7) = "connect" or left$(command$,2) = "c " then cmnd$ = command$
if left$(command$,3) = "cd " then cmnd$ = command$
if left$(command$,5) = "open " then cmnd$ = command$
if left$(command$,7) = "delete " then cmnd$ = command$
if left$(command$,5) = "edit " then cmnd$ = command$
if left$(command$,4) = "new " then cmnd$ = command$
if command$ = "deleteall" then cmnd$ = command$
if command$ = "disconnect" then cmnd$ = command$
if command$ = "d" then cmnd$ = command$
if command$ = "login" then cmnd$ = command$
if command$ = "logout" then cmnd$ = command$
if command$ = "dir" then cmnd$ = command$
if command$ = "help" then cmnd$ = command$
if command$ = "cls" then cmnd$ = command$
if command$ = "exit" then cmnd$ = command$
if left$(command$,9) = "withdraw " then cmnd$ = command$
if left$(command$,8) = "deposit " then cmnd$ = command$
if command$ = "crack" then cmnd$ = command$
if cmnd$ = "exit" then gosub eexit
if cmnd$ = "help" then gosub help
if cmnd$ = "dir" then gosub ddir
if left$(cmnd$,3) = "cd " then gosub ccd
if cmnd$ = "disconnect" then gosub disconnect
if cmnd$ = "d" then gosub disconnect
if cmnd$ = "exit" then gosub eexit
if left$(cmnd$,7) = "connect" or left$(cmnd$,2) = "c " then gosub connect
if cmnd$ = "cls" then gosub ccls
if left$(cmnd$,5) = "open " then gosub open
if left$(cmnd$,7) = "delete " then gosub delete
if left$(cmnd$,5) = "edit " then gosub edit
if left$(cmnd$,4) = "new " then gosub new
if cmnd$ = "deleteall" then gosub deleteall
if cmnd$ = "login" then gosub llogin
if cmnd$ = "logout" then gosub llogout
if cmnd$ = "crack" then gosub crack
if left$(cmnd$,9) = "withdraw " then gosub withdraw
if left$(cmnd$,8) = "deposit " then gosub deposit
if cmnd$ <> "" then cmnd$ = ""
return
help:
cmnd$ = ""
p("Here is a list of commmands and what they do:")
p("")
p("dir")
p("lists the files and directorys of the computer you are currently logged into,")
p("if you aren't logged into any computers it will show your files")
p("")
p("cd")
p("allows you to move between directorys, ex: cd main will move you into the main folder")
p("cd .. will move you back a step")
p("")
p("connect (IP or server name) or c (IP or server name)")
p("you type connect, then the IP or server name withought the (), to connect to other computers")
p("")
p("disconnect or d")
p("type disconnect to disconnect from other computers, will only work if you are currently connected")
p("")
p("exit")
p("Will ask you if you want to quit")
p("")
p("cls")
p("")
p("Cls clears the screen")
p("Open (file that you wish to open)")
p("")
p("Displays text in the file opened")
p("Edit (file that you wish to edit)")
p("")
p("Allows you to edit .txt, and .doc files, you can buy upgrades if you wish to edit other file types")
p("new (file that you wish to create)")
p("")
p("Creates .txt and .dox files, it is also upgraded when you buy new file types")
p("Delete (file that you wish to delete)")
p("")
p("Deletes the selected file. The file can be of any type")
p("login")
p("")
p("Allows you to log on to a server")
p("logout")
p("")
p("logs out of the curent username, but doesn't disconnect from the server")
p("Deleteall")
p("")
p("Deletes every file on the server")
p("crack")
p("")
p("Finds the password for the chosen username")
return
ddir:
if li = 1
cmnd$ = ""
print "Current directory: ", curdirec$ : inc L : gosub L46
print "" : inc L : gosub L46
print "Directories:" : inc L : gosub L46
print "" : inc L : gosub L46
if curdirec = 0
for I = 1 to 10
If array index valid(hosts(curhost,curdirec,I))
if hosts(curhost,curdirec,I).dname <> ""
print hosts(curhost,curdirec,I).dname : inc L : gosub L46
endif
endif
next I
print "" : inc L : gosub L46
print "Files:" : inc L : gosub L46
print "" : inc L : gosub L46
for I = 1 to 10
If array index valid(hosts(curhost,curdirec,I))
if hosts(curhost,0,curdirec,I).fname <> ""
print hosts(curhost,0,curdirec,I).fname : inc L : gosub L46
endif
endif
next I
endif
if curdirec <> 0
for I = 1 to 10
If array index valid(hosts(curhost,curdirec,I))
if hosts(curhost,0,curdirec,I).dname <> ""
print hosts(curhost,0,curdirec,I).dname : inc L : gosub L46
endif
endif
next I
print "" : inc L : gosub L46
print "Files:" : inc L : gosub L46
print "" : inc L : gosub L46
for I = 1 to 50
If array index valid(hosts(curhost,0,curdirec,I))
if hosts(curhost,0,curdirec,I).fname <> ""
print hosts(curhost,0,curdirec,I).fname : inc L : gosub L46
endif
endif
next I
endif
else
p("You are not logged in")
endif
return
ccd:
if li = 1
oldd = curdirec
length = len(cmnd$)
directto$ = right$(cmnd$,length - 3)
cmnd$ = ""
for I = 1 to 10
if array index valid(hosts(curhost,curdirec,I))
if directto$ = lower$(hosts(curhost,curdirec,I).dname) then curdirec = I : curdirec$ = hosts(curhost,0,I).dname
endif
next I
if directto$ = ".." then curdirec = prevdirec : curdirec$ = hosts(curhost,0,prevdirec).dname
if curdirec = oldd then p("Directory not found")
if curdirec <> oldd then prevdirec = oldd
else
p("You are not logged in")
endif
return
connect:
li = 0
if connected = 1
p("You are already connected")
cmnd$ = ""
return
endif
length = len(cmnd$)
if left$(cmnd$,7) = "connect"
hostto$ = right$(cmnd$,length - 8)
endif
if left$(cmnd$,2) = "c "
hostto$ = right$(cmnd$,length - 2)
endif
for I = 1 to 10
if array index valid(hosts(I))
if hostto$ = hosts(I).hname then ip$ = hosts(I).ip
endif
next I
cmnd$ = ""
for I = 1 to 10
if array index valid(hosts(I))
if hostto$ = hosts(I).hname then currenthost$ = hostto$ : connected = 1 : curdirec$ = "root" : curhost = I : prevdirec = 0
if hostto$ = hosts(I).ip then hostto$ = hosts(I).hname : currenthost$ = hostto$ : connected = 1 : curdirec$ = "root" : curhost = I : prevdirec = 0
endif
next I
if connected = 0 then p("Host not found try again.")
inc L
gosub L46
print "Connecting to: ", hostto$, " IP: ", ip$
inc L
wait 50
curhostn$ = hostto$
curhostip$ = ip$
return
disconnect:
cmnd$ = ""
if connected = 0
p("You aren't connected")
endif
if connected = 1
print "Disconnecting from: ", currenthost$ : inc L :gosub L46
connected = 0
li = 0
curdirec = 0
wait 50
p("Disconnected")
p("")
endif
return
eexit:
cmnd$ = ""
input "Are you sure you want to quit? y/n ", sure$
inc L
gosub L46
if sure$ = "y" then end
return
ccls:
cmnd$ = ""
L = 46
gosub L46
return
open:
if li = 1
length = len(cmnd$)
filen$ = right$(cmnd$,length-5)
cmnd$ = ""
for I = 1 to 50
if array index valid(hosts(curhost,0,curdirec,I))
if lower$(filen$) = lower$(hosts(curhost,0,curdirec,I).fname)
curfile$ = filen$
curfile = I
for I = 1 to 50
if hosts(curhost,0,curdirec,curfile,I).fcontent <> ""
print hosts(curhost,0,curdirec,curfile,I).fcontent : inc L : gosub L46
endif
next I
endif
endif
next I
else
p("You are not logged in")
endif
return
delete:
if li = 1
if lower$(ln$) <> "readonly"
deleted = 0
length = len(cmnd$)
filen$ = right$(cmnd$,length-7)
cmnd$ = ""
for I = 1 to 50
if array index valid(hosts(curhost,0,curdirec,I))
if lower$(filen$) = lower$(hosts(curhost,0,curdirec,I).fname)
hosts(curhost,0,curdirec,I).fname = ""
deleted = 1
endif
endif
next I
if deleted = 1 then p("File deleted succsefuly")
if deleted = 0 then p("File not found")
endif
else
p("You are not logged in")
endif
return
edit:
if li = 1
if lower$(ln$) <> "readonly"
un = 1
if lower$(right$(cmnd$,4)) = ".doc" then un = 0
if lower$(right$(cmnd$,4)) = ".txt" then un = 0
if un = 1 then goto un
filetoed$ = ""
length = len(cmnd$)
filen$ = right$(cmnd$,length-5)
cmnd$ = ""
for I = 1 to 50
if array index valid(hosts(curhost,0,curdirec,I))
if lower$(filen$) = lower$(hosts(curhost,0,curdirec,I).fname)
filetoed = I : goto skip
else
filetoed = 51
endif
endif
next I
skip:
if filetoed <> 51
input "Wich line (1-50): ", el : inc L : gosub l46
input "Change to: ", el$ : inc L : gosub l46
hosts(curhost,0,curdirec,filetoed,el).fcontent = el$
input "Are you done editing? ", done$ : inc L : gosub l46
if done$ = "no" then goto skip
if done$ = "n" then goto skip
endif
un:
filetoed$ = ""
endif
else
p("You are not logged in")
endif
return
new:
if li = 1
if lower$(ln$) <> "readonly"
length = len(cmnd$)
filen$ = right$(cmnd$,length-4)
cmnd$ = ""
un = 1
if lower$(right$(filen$,4)) = ".txt" then un = 0
if lower$(right$(filen$,4)) = ".doc" then un = 0
if un = 0
for I = 1 to 50
if array index valid(hosts(curhost,0,curdirec,I))
if hosts(curhost,0,curdirec,I).fname = "" then hosts(curhost,0,curdirec,I).fname = filen$ : p("File made sucessfuly") : goto nbreak
endif
next I
endif
nbreak:
endif
else
p("You are not logged in")
endif
return
deleteall:
if li = 1
if lower$(ln$) <> "readonly"
input "This will delete all files on this server. Are you sure? ", sure$ : inc L : gosub L46
if lower$(sure$) = "yes" or lower$(sure$) = "y"
for d = 1 to 10
for f = 1 to 50
hosts(curhost,0,d,f).fname = ""
next f
next d
endif
endif
return
llogin:
cmnd$ = ""
pc = 0
rlni:
input "Login Name: ", ln$ : inc L : gosub L46 : gosub namecheck
pwi:
if pc <> 1 then input "Password: ", pw$ : inc L : gosub L46 : gosub passwordcheck
li = 1 : goto cli
else
p("You are not logged in")
endif
return
namecheck:
for I = 1 to 10
if ln$ = hosts(curhost,I).ln then goto pwi
next I
goto rlni
return
passwordcheck:
for I = 1 to 10
if pw$ = hosts(curhost,I).pw then pc = 1
next I
return
llogout:
cmnd$ = ""
li = 0
return
crack:
cmnd$ = ""
fpw$ = ""
input "Find the password for what username? ", fun$ : inc L : gosub l46
for I = 1 to 10
if fun$ = hosts(curhost,I).ln then pw$ = hosts(curhost,I).pw : gosub runpwc
next I
return
runpwc:
length = len(pw$)
l = 46
gosub l46
do
if inkey$()= "q" then return
for I = 1 to length
if l(I,1) = 0 then l(I) = rnd(35)+1
next I
set cursor 0,0
print "Cracking Password:"
print ">"
for I = 1 to length
print alpha$(l(I))
if alpha$(l(I)) = mid$(pw$,I) then l(I,1) = 1
next I
print "<"
wait 75
cls
for I = 1 to length
next I
loop
return
deposit:
if li = 1
length = len(cmnd$)
amnt$ = right$(cmnd$,length-9)
amnt = val(amnt$)
cmnd$ = ""
if money - amnt > -1 then hosts(curhost).smoney = amnt : money = money - amnt : p("Money deposited successfuly")
if money - amnt < 0 then p("You don't have enough money")
endif
return
withdraw:
if li = 1
length = len(cmnd$)
amnt$ = right$(cmnd$,length-8)
amnt = val(amnt$)
cmnd$ = ""
if hosts(curhost).smoney - amnt >= 0 then hosts(curhost).smoney = hosts(curhost).smoney - amnt : money = money + amnt : p("Money withdrawn successfuly")
if money - amnt < 0 then p("The server doesn't have enough money")
endif
return
function p(p$)
print p$
inc L
gosub L46
endfunction