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

Diskdrive Utilities Menu [I might add Colors]

Started by Entropy, 19 April 2013 - 10:51 PM
Entropy #1
Posted 20 April 2013 - 12:51 AM
This is my first program so please don't rage or say "no pix no clix" Cause it has no colors so I think you can imagine what it looks like… >.>

To get this program type

pastebin get V23sAsjA disk/startup

Its best on a disk but you don't have to.

Here is the code


function clearScreen()
term.clear()
term.setCursorPos(1,1)
end
key1 = "1"
key2 = "2"
key3 = "3"
key4 = "4"
key5 = "5"
key6 = "6"
key7 = "7"
textutils.slowPrint("Utils Menu Loading...")
sleep(1)
textutils.slowPrint("Utils menu has loaded.")
sleep(1)
clearScreen()
print("Diskdrive Utils Menu V1.2 Made by: Motoredge2")
print("1. Bypass ")
print("2. Computer ID")
print("3. Force Redstone Output")
print("4. Games/Utilities")
print("5. Exit")
print("6. Rednet Broadcast/PM")
print("7. Redstone Output Timer")
print(os.time)
print("Before selecting an option please type in your side your diskdrive is on and the side your wireless modem is on.")
write("Modem side: ")
modem = read()
write("Drive side: ")
drive = read()
print("Enter your choice. From 1 - 7.")
write("Choice: ")
input = read()
if input == key1 then
clearScreen()
textutils.slowPrint("Loading Bypass...")
sleep(2)
textutils.slowPrint("Bypass Successfully completed")
sleep(2)
clearScreen()
elseif input == key2 then
clearScreen()
textutils.slowPrint("Searching computer")
sleep(2)
textutils.slowPrint("Located computer ID. ID: "..os.getComputerID())
sleep(2)
os.reboot()
elseif input == key3 then
clearScreen()
print("Enter the direction of the redstone output below.")
sleep(1)
write("Direction: ")
local input1 = read()
sleep(1)
rs.setOutput(input1, true)
elseif input == key4 then
clearScreen()
Game1 = "1"
Game2 = "2"
Game3 = "3"
turtle = "test"
print("Select your game below. (WIP)")
print("1. Guess That Number")
print("2. Worm")
print("3. Calculator")
print("Possibly more to come.")
write("Choice: ")
input5 = read()
if input5 == Game1 then
  clearScreen()
  numb = math.random(1,10)
  print("Welcome to... Guess That Number!")
  sleep(1)
  print("To play this game you need to enter a number below between 1 and 10.")
  sleep(1)
  write("Number: ")
  local input2 = read()
  if input2 == numb then
   clearScreen()
   print("That number is correct! Congratulations!")
   sleep(1)
  else
   print("You have either guessed to high/low or you have guess wrong.")
   sleep(2)
  end
elseif input5 == Game2 then
  print("You are playing Worm. You will be redirected to it in 3 seconds.")
  sleep(3)
  shell.run("worm")
elseif input5 == Game3 then
  print("Edge Calculator")
  textutils.slowPrint("You are using the EdgeCalculator")
  sleep(2)
  print("Please select your first and second number.")
  write("First Number: ")
  number1 = read()
  write("Second Number: ")
  number2 = read()
  print("You have selected the numbers, "..number1.." and "..number2)
  sleep(2)
  print("Now select your operator using these characters (+, -, /, *, %,>,<")
  write("Operator: ")
  operator = read()
  if operator == "+" then
   print(number1.." + "..number2.." = "..number1+number2)
   sleep(2)
   os.reboot()
  elseif operator == "-" then
   print(number1.." - "..number2.." = "..number1-number2)
   sleep(2)
   os.reboot()
  elseif operator == "/" then
   print(number1.." / "..number2.." = "..number1/number2)
   sleep(2)
   os.reboot()
  elseif operator == "*" then
   print(number1.." * "..number2.." = "..number1 * number2)
   sleep(2)
   os.reboot()
  elseif operator == "%" then
   print(number1.." % "..number2.." = "..number1 % number2)
   sleep(2)
   os.reboot()
  elseif operator == ">" then
   if number1 > number2 then
	print(number1.." is bigger than "..number2)
	sleep(2)
	os.reboot()
   elseif number2 > number1 then
	print(number2.." is bigger than "..number1)
	sleep(2)
	os.reboot()
   end
  elseif operator == "<" then
   if number1 < number2 then
	print(number1.." is smaller then "..number2)
	sleep(2)
	os.reboot()
   elseif number2 < number1 then
	print(number2.." is smaller then "..number1)
	sleep(2)
	os.reboot()
   end
  end
end
elseif input == key5 then
print("Exiting in 6 seconds.")
sleep(3)
disk.eject(drive)
sleep(1)
os.reboot()
elseif input == key6 then
rednet.open(modem)
local PM = "PM"
local B = "B"
print("Type whether you are doing a PM or broadcast below.")
write("PM/B: ")
local input3 = read()
if input3 == PM then
  print("You have selected, PM. Type the message below.")
  sleep(1)
  write("ID: ")
  local input4 = read()
  write("Message: ")
  local input5 = read()
  sleep(1)
  rednet.send(input4, input5)
  sleep(2)
elseif input3 == B then
  print("You have selected, Broadcast. Type the message below.")
  write("Message: ")
  local input6 = read()
  sleep(1)
  rednet.broadcast(input6)
  sleep(2)
  os.reboot()
end
elseif input == key7 then
clearScreen()
print("This is a timed redstone output for timed bombs and such.")
sleep(2)
clearScreen()
print("Specify the time for the timer and the redstone output direction below.")
write("Time: ")
local time = read()
write("Direction: ")
local output = read()
clearScreen()
sleep(1)
print("You are setting a timer of "..time.."seconds and a redstone output in the direction of "..output..". Starting the timer now.")
sleep(time)
rs.setOutput(output, true)
else
print("That is not a valid choice, please try again.")
sleep(2)
os.reboot()
end
superaxander #2
Posted 20 April 2013 - 12:52 AM
Good for a first program!
oeed #3
Posted 20 April 2013 - 12:53 AM
So uh… What does this actually do?
Entropy #4
Posted 20 April 2013 - 12:57 AM
So uh… What does this actually do?
:/ Well, Its my first program so I just threw something together. I was just testing myself on what I could do.