Jump to content




peripheral.find(self)


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

#1 EveryOS

  • Members
  • 570 posts
  • LocationOver there ->

Posted 28 April 2016 - 11:55 AM

I really want to get a handle using peripheral.find
The problem is, self refers to a table,and I need a string.
Also, the computer finding the peripheral is not a peripheral.

Is there a way around this, without using term.native() or term

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 28 April 2016 - 12:38 PM

wut

You may need to elaborate. Preferably by providing the code you're using to try... whatever it is you're attempting.

View PosteveryOS, on 28 April 2016 - 11:55 AM, said:

The problem is, self refers to a table,and I need a string.

Where's "self" coming from? Why are you making it a table in the first place, and what's in it? Why do you expect any sort of useful answer when you haven't provided this information?

View PosteveryOS, on 28 April 2016 - 11:55 AM, said:

Also, the computer finding the peripheral is not a peripheral.

Er, yes it is, even if you're not using it as one! Not that this appears relevant to the issue at hand?

View PosteveryOS, on 28 April 2016 - 11:55 AM, said:

Is there a way around this, without using term.native() or term

What on earth would terminal objects have to do with your ability to find peripherals?

#3 EveryOS

  • Members
  • 570 posts
  • LocationOver there ->

Posted 28 April 2016 - 12:54 PM

View PostBomb Bloke, on 28 April 2016 - 12:38 PM, said:

View PosteveryOS, on 28 April 2016 - 11:55 AM, said:

The problem is, self refers to a table,and I need a string.

Where's "self" coming from? Why are you making it a table in the first place, and what's in it? Why do you expect any sort of useful answer when you haven't provided this information?
It's nil, but it's not if you are using a table.

View PostBomb Bloke, on 28 April 2016 - 12:38 PM, said:

View PosteveryOS, on 28 April 2016 - 11:55 AM, said:

Is there a way around this, without using term.native() or term
What on earth would terminal objects have to do with your ability to find peripherals?
peripheral.find returns a terminal object for a peripheral, doesn't it. And if you are trying to get a computer as a peripheral, it's going to return something that looks (almost) exactly like the default terminal.

The code:
handle = peripheral.find(self or 'computer')

Edited by everyOS, 28 April 2016 - 12:53 PM.


#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 28 April 2016 - 12:59 PM

View PosteveryOS, on 28 April 2016 - 12:54 PM, said:

It's nil, but it's not if you are using a table.

That doesn't address the question asked.

View PosteveryOS, on 28 April 2016 - 12:54 PM, said:

peripheral.find returns a terminal object for a peripheral, doesn't it.

Er, no. Terminal objects aren't for peripherals, and are only returned in the first place if you search for a suitable peripheral - such as a monitor. I'm not aware of any other peripheral types which can be used as terminal objects after wrapping.

View PosteveryOS, on 28 April 2016 - 12:54 PM, said:

And if you are trying to get a computer as a peripheral, it's going to return something that looks (almost) exactly like the default terminal.

No, you're going to get a table with with the functions outlined here.

View PosteveryOS, on 28 April 2016 - 12:54 PM, said:

The code:

That code in no way attempts to define "self".

#5 EveryOS

  • Members
  • 570 posts
  • LocationOver there ->

Posted 28 April 2016 - 01:04 PM

OK, I do put more importance in my other topic, though.

#6 Dragon53535

  • Members
  • 973 posts
  • LocationIn the Matrix

Posted 28 April 2016 - 11:09 PM

You ask these arbitrary questions as if each is isolated. Could you give an example of what you want to receive, while also saying what you want to achieve and then I think we should all be on the same page.

When you wrap a computer you get back a table, peripheral.find automatically wraps, and the only things you can do with a wrapped computer is outlined here. Nothing more, nothing less.

You cannot view it's screen, any input it may have, it's current running program, nothing. You can only tell it to start up, turn off, reboot, and get it's ID and tell if it's on or not. That is it. If you want to be able to manipulate a computer using another computer you need to write your own program to be able to do so.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users