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

[lua] [code]Cant get program to run with title page correctly

Started by jamesscape2, 12 May 2012 - 09:48 AM
jamesscape2 #1
Posted 12 May 2012 - 11:48 AM
HI what i am trying to do is have my title page print over the whole screen and then have my program run in the middle of that screen

This is my code so far. this does work but i think it can be easier that this to do

Spoiler– Computer ID 10

function Title()

term.clear()
term.setCursorPos(1,1)
print(" Welcome ")
print(" ################################################ ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" ################################################ ")

end


function StartUp()

term.setCursorPos(15,6)
print(" This bit working ") – just lets me that the progrma is in the correct spot
x,y,z=rednet.receive()
if y == "Activate" then
term.setCursorPos(15,9)
print("Hello, it is working") – lets me it receive the code and working
else
print("Hello, No not working ") – lets me code received is not correct and not working
end
end

rednet.open("back")
Title()

StartUp()

sleep(10)
rednet.close("back")
os.reboot()

[\spoiler]



hope some one can help

this is where i get my idea from but i cant figure out how to do it.


http://www.youtube.com/watch?v=BR0JRF19j-c

time to watch 3:35 - 3:55

the status page is what i am trying to do but a very basic version at the moment

Thanks
Teraminer #2
Posted 12 May 2012 - 12:20 PM
If I was to create this I would do it this way so, I can't help… :)/>/>
libraryaddict #3
Posted 12 May 2012 - 01:11 PM
-- Computer ID 10

function Title()
  term.clear()
  term.setCursorPos(1,1)
  print(" Welcome ")
  print(" ################################################ ")
  for n=1,14 do
    print(" | | ")
  end
  print(" ################################################ ")
end


function StartUp()
  term.setCursorPos(15,6)
  print(" This bit working ") -- just lets me that the progrma is in the correct spot
  local ID, Msg, Cords=rednet.receive()
  if Msg == "Activate" then
    term.setCursorPos(15,9)
    print("Hello, it is working") -- lets me it receive the code and working
  else
    print("It isnt working. I received: "..Msg) -- lets me code received is not correct and not working
  end
end

rednet.open("back")
Title()
StartUp()
sleep(10)
rednet.close("back")
os.reboot()