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

EMMRF - External Modem Message Reciever Function

Started by chrdov, 21 February 2014 - 03:07 PM
chrdov #1
Posted 21 February 2014 - 04:07 PM
Just Install the API on your computer using pastebin get mhBawGsB emmrf

Thanks for trying out the EMMRF! have fun enjoying the easiest way to recieve modem messages without the hassle of events! :)/>
call the function using:

table messageData = emmrf.recieve()

which returns the following since 1.1 (Removed Return of modemSide):

messageData[1] = senderChannel
messageData[2] = replyChannel
messageData[3] = message
messageData[4] = senderDistance

Version 1.0's function returns this:

messageData[1] = modemSide
messageData[2] = senderChannel
messageData[3] = replyChannel
messageData[4] = message
messageData[5] = senderDistance

Enjoy! :P/>
Edited on 22 February 2014 - 09:36 AM
CometWolf #2
Posted 21 February 2014 - 05:24 PM
You realize your api boils down to this

messageData = {os.pullEvent"modem_message"}
right?

or hell, even this

messageData = {rednet.receive()}
theoriginalbit #3
Posted 21 February 2014 - 06:40 PM
You realize your api boils down to this

messageData = {os.pullEvent"modem_message"}
right?

or hell, even this

messageData = {rednet.receive()}
I believe that this would be the entire API

function receive()
  return {os.pullEvent("modem_message")}
end
chrdov #4
Posted 22 February 2014 - 10:30 AM
You realize your api boils down to this

messageData = {os.pullEvent"modem_message"}
right?

or hell, even this

messageData = {rednet.receive()}
I believe that this would be the entire API

function receive()
  return {os.pullEvent("modem_message")}
end
well, yes. the api is one function.

1ST EDIT: just fixed it so modemSide is not a returned value, so there should be no point in you guys making fun of MY FIRST API. also, the event argument is not returned since 1.0.
2ND EDIT: It's not rednet_message, it's friggin' modem_message, except event and modemSide is not returned in the function, so SHUT UP
Edited on 22 February 2014 - 09:46 AM
CometWolf #5
Posted 22 February 2014 - 10:51 AM
it may be YOUR FIRST API, but it's so pointless, it's not even worth the effort of downloading it and writing os.loadAPI"whatever" into your program… Im not trying to be rude here, it's just no one would ever use this. Since it requires more work to just set up, than it takes to get the same result. and that's something you should consider before making an API.