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

Bit of help would be appreciated thanks! :)

Started by ryarsh, 07 November 2012 - 11:25 PM
ryarsh #1
Posted 08 November 2012 - 12:25 AM
So, ive been working on a bit of programming and ive hit a speed bump :/

For example…

DIRECTORY NAME = Test

term.clear()
print("Loading…")
sleep(3)
term.clear()

print("OptionOne")
print("OptionTwo")

x = "OptionOne"
y = "OptionTwo

input = read()
if input == x then
rs.setBundledOutput( "right", colors.red)

okay so there is a example, now this is the bit i cant seem to figure out or even if its possible, i want the program to go back to the directory after a option has been selected. E.g test. Loading… then the options would appear, i woudld then type option one or two then i would get my action from the option, then after the action i want it to go back to the directory so i can select option 2 for instance instantly without typing…. cd disk/Test, apoligies if i haven't explained very well but ive been try to do it for a while, and just cant figure it out, and reply would be appreciated - Ryarsh
remiX #2
Posted 08 November 2012 - 01:24 AM
Like this?

DIRECTORY NAME = "Test"

while true do   -- will loop this forever..
    print("Loading...")
    sleep(3)    
    print("OptionOnenOptionTwo")
    term.clear()
    term.setCursorPos(1,1)
    input = read()
    if input == "OptionOne" then
        rs.setBundledOutput( "right", colors.red)
    elseif input == "OptionTwo" then
        rs.setBundledOutput( "left", colors.red)
    end
end