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

Value turtle

Started by proxene, 20 April 2016 - 05:08 PM
proxene #1
Posted 20 April 2016 - 07:08 PM
Hello ,
I have a problem with my code, I can not send my data to another computer which I use server.

rednet.send(ser,turtle.getItemCount(1,16))

Can you help me ?

Regards ,
Proxene
KingofGamesYami #2
Posted 20 April 2016 - 08:29 PM
That code should successfully send the item count of slot 1 over rednet, given that 'ser' is a variable equivalent to the id of the computer you have a so called "server" on.

If ser is not defined anywhere, or is not the id of the computer running your "server" program, it won't work.

In addition, you may remove the 16. turtle.getItemCount only accepts 1 argument.
Dragon53535 #3
Posted 20 April 2016 - 08:31 PM
Question then, does the turtle have a wireless modem attached? Does the receiving computer also have one? Have you used rednet.open() on both the computer and turtle? Are you making sure that the receiving computer is able to receive more than one message?
Edited on 20 April 2016 - 06:31 PM
proxene #4
Posted 20 April 2016 - 09:47 PM
Hello, I use a turtle in wireless with a modem and a computer equip him as a modem, it is communicating properly with each other but apparently when I send the total of the items contained in the inventory of turtle that does not work

Here is the complete code : http://pastebin.com/4W1eywQi

Regards ,
Proxene
The_Cat #5
Posted 20 April 2016 - 10:31 PM
Hello, I use a turtle in wireless with a modem and a computer equip him as a modem, it is communicating properly with each other but apparently when I send the total of the items contained in the inventory of turtle that does not work

Here is the complete code : http://pastebin.com/4W1eywQi

Regards ,
Proxene
Are both computers chuck loaded?
So you are sending 4 rednet.send() commands, is the 'server' listening for these 4 separate items? (maybe you could try delaying the time until you send the next packet of data.)
(or you could send a table meaning you only need to use rednet.send() once.