Jump to content




Input


  • You cannot reply to this topic
2 replies to this topic

#1 CreeperWiz

  • Members
  • 116 posts
  • LocationOn earth!

Posted 22 February 2015 - 02:59 AM

How do I recive input from a keyboard. For example I want to make a program with a guy to change labels.

#2 Dog

  • Members
  • 1,179 posts
  • LocationEarth orbit

Posted 22 February 2015 - 04:25 AM

To get input from the user via keyboard, you would use read. To change the computer label you'd use the OS API.

For example...
term.write("Enter new label: ")
local newLabel = read()
if newLabel then os.setComputerLabel(newLabel) end

Edited by Dog, 22 February 2015 - 04:27 AM.


#3 CreeperWiz

  • Members
  • 116 posts
  • LocationOn earth!

Posted 22 February 2015 - 09:55 PM

View PostDog, on 22 February 2015 - 04:25 AM, said:

To get input from the user via keyboard, you would use read. To change the computer label you'd use the OS API.

For example...
term.write("Enter new label: ")
local newLabel = read()
if newLabel then os.setComputerLabel(newLabel) end
Ik i can use the label change thing. It was a example. Also Thank you a lot :) !





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users