Jump to content




Could someone help me with RedNet?


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

#1 ebernerd

  • Members
  • 262 posts
  • LocationBoston, MA

Posted 10 January 2013 - 11:37 AM

So I have done what the wiki has told me... but it is soooo slow and too much programming for the simple user. I want to put a constantly updating rednet script in my operating system... maybe like instant messaging! Could someone please help their fellow newbie?

#2 crazyguymgd

  • Members
  • 139 posts
  • LocationUSA

Posted 10 January 2013 - 11:40 AM

Are you asking someone to write the code for you because it's too much programming for the simple user?

#3 ebernerd

  • Members
  • 262 posts
  • LocationBoston, MA

Posted 10 January 2013 - 11:45 AM

View Postcrazyguymgd, on 10 January 2013 - 11:40 AM, said:

Are you asking someone to write the code for you because it's too much programming for the simple user?
No no no... I mean like in the LUA prompt. It is too much work to just be like HEY I AM ONLINE! No.. I want just a simple base line where I can then edit it to my liking.

#4 crazyguymgd

  • Members
  • 139 posts
  • LocationUSA

Posted 10 January 2013 - 11:50 AM

while true do
  message = rednet.receive()
  print(message)
  response = read()
  rednet.broadcast(response)
end

Is a simple get message, send message loop.

#5 ebernerd

  • Members
  • 262 posts
  • LocationBoston, MA

Posted 10 January 2013 - 12:03 PM

View Postcrazyguymgd, on 10 January 2013 - 11:50 AM, said:

while true do
  message = rednet.receive()
  print(message)
  response = read()
  rednet.broadcast(response)
end

Is a simple get message, send message loop.
I tried... and I cant type anything

#6 ebernerd

  • Members
  • 262 posts
  • LocationBoston, MA

Posted 10 January 2013 - 12:06 PM

This is what I have, but I cant run it. Could somebody help?
 textutils.slowPrint("What side is your modem on?")
input = read()
rednet.open(input)
while true do
print("Message (to stop type /stop)")
input = read()
if input == "/stop" then
shell.run("cd disk")
end
else
rednet.broadcast(input)
end
end


#7 crazyguymgd

  • Members
  • 139 posts
  • LocationUSA

Posted 10 January 2013 - 12:08 PM

Well you have to open the rednet modem first, and also have another computer running the same program to send the first message.

#8 ebernerd

  • Members
  • 262 posts
  • LocationBoston, MA

Posted 10 January 2013 - 12:16 PM

View Postcrazyguymgd, on 10 January 2013 - 12:08 PM, said:

Well you have to open the rednet modem first, and also have another computer running the same program to send the first message.

I have one working... but it is in its beta...
When I ran a stop program... it crashed my minecraft......
This was the stop command:
if input == "/stop" then
break
end


#9 ebernerd

  • Members
  • 262 posts
  • LocationBoston, MA

Posted 10 January 2013 - 12:20 PM

Fixed the crash bug, but now I get a "PUT AN END ON LINE 12 TO CLOSE WHILE" on this code:

textutils.slowPrint("What side is your modem on?")
input = read()
rednet.open(input)
textutils.slowPrint("Sadly, this program cannot automagically update")
textutils.slowPrint("To see if you have a new message, type /refresh")
print("Message (to stop type /stop)")
while true do
input = read()
if input == "/stop" then
break
end
elseif input == "/refresh" then
g = rednet.receive()
print(g)
break
end
else
rednet.broadcast(input)
end
end



#10 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 10 January 2013 - 12:29 PM

View Postcrazyguymgd, on 10 January 2013 - 11:50 AM, said:

while true do
  message = rednet.receive()
  print(message)
  response = read()
  rednet.broadcast(response)
end

Is a simple get message, send message loop.

In this case, message is a number and is the ID of the computer from which the message is received from.

View PostViextraProgramming, on 10 January 2013 - 12:20 PM, said:

Fixed the crash bug, but now I get a "PUT AN END ON LINE 12 TO CLOSE WHILE" on this code:

textutils.slowPrint("What side is your modem on?")
input = read()
rednet.open(input)
textutils.slowPrint("Sadly, this program cannot automagically update")
textutils.slowPrint("To see if you have a new message, type /refresh")
print("Message (to stop type /stop)")
while true do
input = read()
if input == "/stop" then
break
-- Whole if block needs only one end
-- Not sure what you're trying to do with the /refresh part here..
else
rednet.broadcast(input)
end
end


Btw, the arguments for rednet.receive() are as follows:

senderID, message, distance = rednet.receive()
-- senderID is the ID of which the message is received from
-- message is the message recieved
-- distance the distance between the two computers


#11 crazyguymgd

  • Members
  • 139 posts
  • LocationUSA

Posted 10 January 2013 - 12:30 PM

One end not 3 ends

#12 crazyguymgd

  • Members
  • 139 posts
  • LocationUSA

Posted 10 January 2013 - 12:32 PM

View PostremiX, on 10 January 2013 - 12:29 PM, said:

View Postcrazyguymgd, on 10 January 2013 - 11:50 AM, said:

while true do
  message = rednet.receive()
  print(message)
  response = read()
  rednet.broadcast(response)
end

Is a simple get message, send message loop.

In this case, message is a number and is the ID of the computer from which the message is received from.

View PostViextraProgramming, on 10 January 2013 - 12:20 PM, said:

Fixed the crash bug, but now I get a "PUT AN END ON LINE 12 TO CLOSE WHILE" on this code:

textutils.slowPrint("What side is your modem on?")
input = read()
rednet.open(input)
textutils.slowPrint("Sadly, this program cannot automagically update")
textutils.slowPrint("To see if you have a new message, type /refresh")
print("Message (to stop type /stop)")
while true do
input = read()
if input == "/stop" then
break
-- Whole if block needs only one end
-- Not sure what you're trying to do with the /refresh part here..
else
rednet.broadcast(input)
end
end


Btw, the arguments for rednet.receive() are as follows:

senderID, message, distance = rednet.receive()
-- senderID is the ID of which the message is received from
-- message is the message recieved
-- distance the distance between the two computers

Thanks for the catch.

#13 ebernerd

  • Members
  • 262 posts
  • LocationBoston, MA

Posted 10 January 2013 - 12:37 PM

View PostremiX, on 10 January 2013 - 12:29 PM, said:

View Postcrazyguymgd, on 10 January 2013 - 11:50 AM, said:

while true do
  message = rednet.receive()
  print(message)
  response = read()
  rednet.broadcast(response)
end

Is a simple get message, send message loop.

In this case, message is a number and is the ID of the computer from which the message is received from.

View PostViextraProgramming, on 10 January 2013 - 12:20 PM, said:

Fixed the crash bug, but now I get a "PUT AN END ON LINE 12 TO CLOSE WHILE" on this code:

textutils.slowPrint("What side is your modem on?")
input = read()
rednet.open(input)
textutils.slowPrint("Sadly, this program cannot automagically update")
textutils.slowPrint("To see if you have a new message, type /refresh")
print("Message (to stop type /stop)")
while true do
input = read()
if input == "/stop" then
break
-- Whole if block needs only one end
-- Not sure what you're trying to do with the /refresh part here..
else
rednet.broadcast(input)
end
end


Btw, the arguments for rednet.receive() are as follows:

senderID, message, distance = rednet.receive()
-- senderID is the ID of which the message is received from
-- message is the message recieved
-- distance the distance between the two computers

Can I have it just receive a broadcast message?

And I was trying to make it so that it would autoupdate
but it wouldnt work in three different coding situations (program ran, just got stuck)
*btw.. dont have that code anymore...*

so typing /refresh would update the screen.

#14 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 10 January 2013 - 12:41 PM

View PostViextraProgramming, on 10 January 2013 - 12:37 PM, said:

View PostremiX, on 10 January 2013 - 12:29 PM, said:

-- snip

Can I have it just receive a broadcast message?

And I was trying to make it so that it would autoupdate
but it wouldnt work in three different coding situations (program ran, just got stuck)
*btw.. dont have that code anymore...*

so typing /refresh would update the screen.

Well, you will need to save the message into a table and then re-print them onto the screen.

This involves a lot of rednet stuff and is advanced if you're a beginner. I'd suggest looking through the programs sections, there are quite a few email programs.

#15 ebernerd

  • Members
  • 262 posts
  • LocationBoston, MA

Posted 10 January 2013 - 12:50 PM

View PostremiX, on 10 January 2013 - 12:41 PM, said:

View PostViextraProgramming, on 10 January 2013 - 12:37 PM, said:

View PostremiX, on 10 January 2013 - 12:29 PM, said:

-- snip

Can I have it just receive a broadcast message?

And I was trying to make it so that it would autoupdate
but it wouldnt work in three different coding situations (program ran, just got stuck)
*btw.. dont have that code anymore...*

so typing /refresh would update the screen.

Well, you will need to save the message into a table and then re-print them onto the screen.

This involves a lot of rednet stuff and is advanced if you're a beginner. I'd suggest looking through the programs sections, there are quite a few email programs.
Thanks... I will work on it more when I am more advanced..

#16 crazyguymgd

  • Members
  • 139 posts
  • LocationUSA

Posted 10 January 2013 - 12:54 PM

Haha well you're on track if you just want a simple instant messenger type system. Yes a full email system is more complicated but i'm sure you can figure this IM stuff out. However, you do need to read up on rednet a bit more. Have you made progress on it? (You said you don't have that code anymore) I'd like to see how you're coming.

#17 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 10 January 2013 - 12:55 PM

View PostViextraProgramming, on 10 January 2013 - 12:50 PM, said:

View PostremiX, on 10 January 2013 - 12:41 PM, said:

--snip
Thanks... I will work on it more when I am more advanced..

I'm not saying you can't do it. I'm sure anyone can if they practice/learn and code over and over. Eventually you will know a lot.

Here's an email program: TCMail - Fully Functional Email

I've never used/tried it but check out the code and see if you can learn from it :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users