6 posts
                
             
            
                Posted 07 October 2012 - 08:46 PM
                I tried something like
print "Hello"
cls
print "potato"
cls
print "cow"
But apparently it doesnt work like that. So I found out about term.clear. That does the job but how do I set a delay to it?
 
Edit: Found out about os.sleep, sorry!
                
             
         
        
        
            
            
                
                    
                
                767 posts
                
             
            
                Posted 07 October 2012 - 08:52 PM
                You Are programming in lua. That you need is : term.setCursorPos(1,1) to set the Mouse at the top left corner. 
Term.clear() is clearing the screen, and term.setCursorPos() is setting the Mouse position..
cls is not existing in lua/minecraft. So if you want any other help, type 'help (program)'
                
             
         
        
        
            
            
                
                    
                
                295 posts
                
                    
                        Location
                        In the TARDIS at an unknown place in time.
                    
                
             
            
                Posted 07 October 2012 - 09:19 PM
                Here's how you'd do something like that:
function cls() -- This is optional, you could just type 'term.clear()' but I suppose it's more comfortable for you to do this.   '
term.clear()
end
cls() -- Executes the function cls()
term.setCursorPos(1, 1) -- Sets the cursor to the upper left corner
print("Hello")
sleep(1)  -- Computer waits 1 second before it moves on
cls()
term.setCursorPos(1, 1)
print("potato")
sleep(1)
cls()
term.setCursorPos(1, 1)
print("cow")
sleep(1)
 
                
             
         
        
        
            
            
                
                    
                
                6 posts
                
             
            
                Posted 07 October 2012 - 09:20 PM
                Thanks guys!
                
             
         
        
        
            
            
                
                    
                
                2088 posts
                
                    
                        Location
                        South Africa
                    
                
             
            
                Posted 07 October 2012 - 09:33 PM
                to make the code smaller you can do this
function cls(string)
  term.clear()
  term.setCursorPos(1,1)
  print(string)
end
cls("Hello")
sleep(1)
cls("potato")
sleep(1)
cls("cow")