15 posts
Posted 24 December 2017 - 02:00 PM
So I'm just trying to make a simple program where one computer is a receiver and one is a sender.
The receiver is just fine it's the sender I am having issues with.
local modem = peripheral.wrap("top")
modem.transmit(0,5,"HEY!") -- 5 being the receiver.
The error it outputs is: chat:2 attempt to call nil
3057 posts
Location
United States of America
Posted 24 December 2017 - 04:51 PM
Double check the spelling of "transmit" and verify that the peripheral on top of the computer is aa modem.
15 posts
Posted 24 December 2017 - 05:39 PM
Transmit is spelled right, there is a wireless modem ontop of each computer.
2427 posts
Location
UK
Posted 24 December 2017 - 10:11 PM
Is 'wrap' spelt correctly in your original code?
15 posts
Posted 24 December 2017 - 10:31 PM
Yes… Everything is the same.
3057 posts
Location
United States of America
Posted 24 December 2017 - 11:39 PM
Well, I'm stumped. The error says your program is trying to call a function which does not exist, but the way it's written it should work.
Are any other peripherals attached to the computer?
Do you have any other mods installed?
What version of computercraft are you using?
If you could run this code and tell me the result it may be helpful:
local t = peripheral.getNames()
for k, v in pairs( t ) do
print( "Peripheral '" .. v .. "' is of type '" .. peripheral.getType( v ) "'" )
end
local modem = peripheral.wrap( 'top' )
if modem then
print( "modem exists, checking for transmit" )
if modem.transmit then
print( "modem.transmit exists" )
end
end
print( "Attempting to open rednet" )
local ok, err = pcall( rednet.open, "top" )
if not ok then
print( "Rednet open failed" )
print( err )
else
print( "Attempting to send a message" )
local ok, err = pcall( rednet.broadcast, "test" )
if not ok then
print( "Rednet send failed" )
print( err )
end
end
Edited on 24 December 2017 - 10:40 PM
15 posts
Posted 25 December 2017 - 02:51 AM
Ok, the output comes out with.
- Transmit exists.
- Attempted to send a message.
MC version is: 1.7.10(because of modpack)
3057 posts
Location
United States of America
Posted 25 December 2017 - 03:13 AM
There should be a lot more output than that… I have a feeling you have omitted some lines.
However, if it does say it attempted to send a message and no failure message, I'm 100% sure modem.transmit should work and something isn't lining up with what you have in game and what you're reporting here.
15 posts
Posted 25 December 2017 - 03:32 AM
Well, I sorta gave up because of how stupid the issue is. I don't understand why modem.transmit wouldn't work at all :/
3057 posts
Location
United States of America
Posted 25 December 2017 - 03:49 AM
Well, if you're not going to keep trying I can't really do much. At this point if it's not the information you're reporting some mod is really messing with computercraft or the version of computercraft you're using has been (badly) modified. Maybe with a resource pack?
What's odd is, modem.transmit appears to exist (my program says it does), and rednet.send worked (well, didn't error anyway - it uses modem.transmit internally). So it shouldn't error if you add the modem.transmit line to the end of my program. It should send the message just fine.
15 posts
Posted 25 December 2017 - 04:31 AM
RIP
2427 posts
Location
UK
Posted 25 December 2017 - 03:04 PM
Can you give us a list of your mods or a link to the modpack you are using?
15 posts
Posted 25 December 2017 - 05:19 PM
Well not it's not even the mods. I went ahead setup a ComputerCraft mod only with TMI and it still didn't work. But this time the ComputerCraft version was 1.8.9 :/ I just gave up.
2427 posts
Location
UK
Posted 25 December 2017 - 06:29 PM
Any resource packs?
15 posts
Posted 26 December 2017 - 06:34 PM
Nope
2427 posts
Location
UK
Posted 26 December 2017 - 07:32 PM
It might be worth downloding CC again.
15 posts
Posted 26 December 2017 - 08:51 PM
"Well not it's not even the mods. I went ahead setup a ComputerCraft mod only with TMI and it still didn't work. But this time the ComputerCraft version was 1.8.9 :/ I just gave up. "
2427 posts
Location
UK
Posted 26 December 2017 - 09:39 PM
Send a screenshot of the code, something may be autocorrecting a typo when you paste to the forums.
15 posts
Posted 26 December 2017 - 10:49 PM
I gave up on it.