Jump to content




[info]How to get the label of the current computer


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

#1 NullSchritt

  • Members
  • 43 posts

Posted 31 May 2013 - 12:59 AM

Hello all, I have been currently using the ID of each computer to identify the locations that my program transports players between. However, it would allow for a lot more flexibility if the computer label could be used instead of the computer ID.

Is there a way to retrieve the current computer label as a variable? Thanks.

#2 Spongy141

  • Members
  • 526 posts
  • Location'Merica

Posted 31 May 2013 - 01:08 AM

Could you be more specific, from what I'm understanding from this you're teleporting players with a program? If so whats wrong with using the computers ID, to define a ID as a variable do
 local myVariableForTheComputer = 10 --The computer ID 
From there you can set it up to have your 'teleporting computers' check with a main system computer for the ID Label or something.

#3 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 31 May 2013 - 01:17 AM

yes it is possible to get the computer's label, using os.getComputerLabel. You are also able to set the computer's label with os.setComputerLabel.

#4 NullSchritt

  • Members
  • 43 posts

Posted 31 May 2013 - 01:30 AM

View Posttheoriginalbit, on 31 May 2013 - 01:17 AM, said:

yes it is possible to get the computer's label, using os.getComputerLabel. You are also able to set the computer's label with os.setComputerLabel.
Brilliant, thanks!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users