SuperSpaceEye / Some-Peripherals

MIT License
4 stars 4 forks source link

Cannot use Goggle Link Port #12

Closed shuangfas closed 10 months ago

shuangfas commented 10 months ago

main:

g = peripheral.find("goggle_link_port")
print_r(g)--print_r is used to print the table
g.getConfigInfo()

results: image

SuperSpaceEye commented 10 months ago

Goggle link port by itself doesnt have getConfigInfo. This function exists in getConnected items.

shuangfas commented 10 months ago

I used my "print_r" function to print the results of getConnected, and it does have the functions the wiki talks about, but I don't know why I can't call them at all...

g = peripheral.find("goggle_link_port")
gg=g.getConnected()
print_r(gg)
gg.raycast(100,nil,false,true,false,true)

image

SuperSpaceEye commented 10 months ago

@shuangfas it didn't notify me as the issue was closed. Anyways, if you didn't yet solve this issue, getConnected returns a list of all connected goggles (can be more that one), so you need to gg[1].raycast(...)

shuangfas commented 10 months ago

No, man, your answer is wrong. The right one should be:

g = peripheral.find("goggle_link_port")
gg=g.getConnected()
print_r(gg)
for k, v in pairs(gg) do
    ggg=v
    break
end
print(ggg.type)

because: image Even though your answer was wrong, I thank you very much!

SuperSpaceEye commented 10 months ago

ah, ye. i forgot that i use uuid for keys