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

Calling getID() on a wrapped computer

Started by Cloud Ninja, 22 August 2015 - 01:16 AM
Cloud Ninja #1
Posted 22 August 2015 - 03:16 AM
What exactly happens on a computer when i do

Comp = peripheral.wrap("left")
Comp.getID()

I wanted to know if there was a way to get it to lets say, return something else. Like if i have the computer that ive wrapped, ON, and then i get the ID, is there a way to return something i specify?
Bomb Bloke #2
Posted 22 August 2015 - 03:55 AM
The computer that is wrapped as the peripheral doesn't execute any Lua code when a remote system calls that function. You therefore can't alter the result from that end.
Cloud Ninja #3
Posted 22 August 2015 - 05:48 AM
The computer that is wrapped as the peripheral doesn't execute any Lua code when a remote system calls that function. You therefore can't alter the result from that end.
Ah okay, so thats purely through the mod. Darn. Thanks bomb
vargaszm #4
Posted 24 August 2015 - 06:09 PM
If you know the computer in questions startup script, you can turn on or reboot a wrapper computer or turtle. This is handy for activating a command computer in survival.

You can also place a disk drive with a startup script next to the comp, shut it down, then turn it on. Its intended for rescuing your own computers in case of coding error though, not for breaking into other ppls stuffs.
Edited on 24 August 2015 - 04:10 PM
Cloud Ninja #5
Posted 24 August 2015 - 07:40 PM
If you know the computer in questions startup script, you can turn on or reboot a wrapper computer or turtle. This is handy for activating a command computer in survival.

You can also place a disk drive with a startup script next to the comp, shut it down, then turn it on. Its intended for rescuing your own computers in case of coding error though, not for breaking into other ppls stuffs.
I understand what the functions do for the most part, but i didnt know if getID() ran any code on the wrapped computer, because i wanted to do some networking stuff of my own but, oh well.