Jump to content




trying to learn - Modems


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

#1 Dustmuz

  • Members
  • 174 posts
  • LocationDenmark

Posted 18 September 2014 - 02:32 PM

hey again fellow Crafters :)

i have fiddled around with some of all the coding there is for a computer on its own and monitors.. and gotten the hang if it, to my standart :P hehe

now im trying to learn how to use modems..
but i cant find a tutorial (might just be me that havent searched proberly)
but ive gotten as far as opening the modem, and transmit a message from A to B..
the next thing im trying to do, is "look" inside a chest with the openperipheraladdon "peripheral proxy"

my setup is as follows..

computer in the middle, monitor on the right, WIRED modem on the left, with 2 cables, then another modem, the proxy with arrows "into" a vanilla chest.

i can get the .getInventorySize() to work, it comes up with 27 as it should.
what i wanted to try was to use the .getMethods() on the chest, but that just comes up with "test:16:attempt to call nil"

My code so far
Spoiler


i have tried
.getMethods() / .getMethodsRemote()
.getMethods(chest1) / .getMethodsRemote(chest1)
.getMethods("chest1") / .getMethodsRemote("chest1")
.getMethods(container_chest_1) / .getMethodsRemote(container_chest_1)
.getMethods("container_chest_1") / .getMethodsRemote("container_chest_1")
.getMethods('container_chest_1') / .getMethodsRemote('container_chest_1')

all comes up with the same "error"

if someone have a tutorial for Modems, i would appriciate a link to it, as the wiki, just makes me more confused that good is :D hehe

Have a nice day, and be good :)

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 18 September 2014 - 02:44 PM

It's actually peripheral.getMethods("container_chest_1"). The getMethods function is in the peripheral API itself, not on the peripherals. If you just want to see a quick listing for use as a fast reference, executing this line in the Lua prompt may be helpful:

textutils.tabulate(peripheral.getMethods("container_chest_1"))


#3 Dustmuz

  • Members
  • 174 posts
  • LocationDenmark

Posted 18 September 2014 - 02:51 PM

View PostLyqyd, on 18 September 2014 - 02:44 PM, said:

It's actually peripheral.getMethods("container_chest_1"). The getMethods function is in the peripheral API itself, not on the peripherals. If you just want to see a quick listing for use as a fast reference, executing this line in the Lua prompt may be helpful:

textutils.tabulate(peripheral.getMethods("container_chest_1"))

arhh.. that was quite helpfull..

Thanks a lot..

im trying to learn this Computercraft by "trial and error"
google is quite helpfull, but sometimes, it comes up short :D hehe

#4 Dustmuz

  • Members
  • 174 posts
  • LocationDenmark

Posted 18 September 2014 - 04:34 PM

in hopes of that somebody is still watching..

on to the next problem in this category..

ENERGY CELLS..

i've tried looking on the forums here, in the threads
link1
link2

and that i came up "empty" with..

my "problem" so far, is "power:9: expected string"

Spoiler


#5 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 18 September 2014 - 04:36 PM

You've got peripheral.call where you probably meant peripheral.wrap.

#6 Dustmuz

  • Members
  • 174 posts
  • LocationDenmark

Posted 18 September 2014 - 04:40 PM

View PostLyqyd, on 18 September 2014 - 04:36 PM, said:

You've got peripheral.call where you probably meant peripheral.wrap.

yeps.. you were right.. again :D

you must be quite confident, since you always are right :P hehe

but thanks again..





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users