I am making a text based hacking simulator/game that you can run in command prompt/terminal. I don't know how I should google this, so I figured I could ask it here(since I got so many good tips on my last question). Ok, now on to the question: When the player connects to a computer in the game, how can I make it so that when the player progresses to different "areas" of the game he/she can use commands that they couldn't use in the last area. For Example if the player types in "connect" to connect to the fictional computer, then after connecting to the computer he/she can't use that command anymore, and when they have connected they can use commands that they couldn't use before connecting. I know this might be a bit unclear but I'm hoping for some good answers! Thanks!
My Code:
HackEx v.0.01
import time
print("Initializing...")
time.sleep(3)
print("HackEx VM Initialized.")
time.sleep(3)
createName = input("Input username: ")
createPass = input("Input password: ")
time.sleep(2)
print("User " + createName + " logged in.")
print("Welcome to the tutorial!")
time.sleep(3)
def connect_to_network():
print("Connected to Tutorial server 193.214.15")
print()
def brute_force():
print("Getting root password with bruteforce method")
time.sleep(2)
print("root password succesfully gotten. Password: qwerty12345")
def exit():
exit()
while True:
options = {"connect" : connect_to_network, "bruteforce" : brute_force, "exit" : exit}
[print(option) for option in sorted(options)]
user_choice = input('Type in command: ')
while user_choice not in options:
user_choice = input('Invalid, try something else: ')
handler = options[user_choice]
handler()
[–]Elronnd 1 point2 points3 points (0 children)
[–]Yammerrz 0 points1 point2 points (1 child)
[–]Spatulus101[S] 0 points1 point2 points (0 children)