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

Devon The Novice's Noobish Programs

Started by Devon The Novice, 03 August 2013 - 06:43 PM
Devon The Novice #1
Posted 03 August 2013 - 08:43 PM
Hi, thanks for checking this out, It's not much, but I thought I should post a few things I have.

First off, an API I call Devnote. basically like the colors API, something that only makes programming a little easier. but instead of colors, it is NOTES, (from the Iron Note Block peripheral from RichardG's MiscPeripherals mod) exposes the following functions.


devnote.wrap(side) --side is completely optional.
devnote.piano(nPitch) --play a piano note at the pitch given
devnote.drum(nPitch) --play a bass drum note at the pitch given
devnote.snare(nPitch) --play a snare drum note at the pitch given
devnote.click(nPitch) --play a click note at the pitch given
devnote.bass(nPitch) --play a bass guitar note at the pitch given

So, with a handy tip from Freack100, I shrank the devnote.wrap function, it will auto detect iron note blocks on all sides and wrap the first one it finds, it works on all sides, however, the choice to specify the side is still there, vary useful for iron note blocks on a network.

pastebin link: http://pastebin.com/UayrZS3K

So, with the new rednet and gui functions coming out soonish I have canceled the development of DevNet. Instead, I am thinking of working on something else, maybe OpenEmail and possibly OpenWeb. not sure, If anyone sees this, let me know what you think!
Edited on 30 January 2014 - 10:47 PM
H4X0RZ #2
Posted 03 August 2013 - 09:01 PM
Improvement for the devnote side detection:
You can use rs.getSides().

local noteHandler
for _,side in pairs(rs.getSides()) do
  if peripheral.isPresent(side) and peripheral.getType(side) == "note" then
    noteHandler = peripheral.wrap(side)
  end
end
Devon The Novice #3
Posted 04 August 2013 - 12:35 AM
Improvement for the devnote side detection:
You can use rs.getSides().

local noteHandler
for _,side in pairs(rs.getSides()) do
  if peripheral.isPresent(side) and peripheral.getType(side) == "note" then
	noteHandler = peripheral.wrap(side)
  end
end

I did not know that, thanks for the tip. I updated the OP to include the change, as well as the pastebin. This should make future codes of mine a lot simpler.
DeweySalt #4
Posted 04 August 2013 - 03:35 AM
Why use so many channels if only two are needed? (If it's for security, using 29 channels doesn't help at all) Also, as far as I can tell the 'refresher' is just a relay, which also causes a problem, if a computer is in range of both the relay and the original sender, it'll get two messages.
Suggestion: Make a message checker in which checks if the received message is the same as the last

(I don't want to sound mean, just giving some feedback)
Devon The Novice #5
Posted 04 August 2013 - 01:39 PM
For the refresher, or relay as you called it, it intention was for long cables that would say, stretch from one town to another, however, I was thinking about a message checker. if I do implement a checker then wired routers will become just routers, in that case, WI-FI!!! as for the security risks. it uses so many because they are intended as public channels, that only the routers can directly use, the router translate the address when it receives a message, although I might implement a form of security, the program is still beta. its incomplete, but close enough that I feel, before it's full launch, I should have the community look it over.

And don't worry, its not mean at all. You gave advice on how to improve it and asked legitimate questions.

Mind if I steal the name relay?
Edited on 04 August 2013 - 11:40 AM
DeweySalt #6
Posted 04 August 2013 - 03:02 PM
For the refresher, or relay as you called it, it intention was for long cables that would say, stretch from one town to another, however, I was thinking about a message checker. if I do implement a checker then wired routers will become just routers, in that case, WI-FI!!! as for the security risks. it uses so many because they are intended as public channels, that only the routers can directly use, the router translate the address when it receives a message, although I might implement a form of security, the program is still beta. its incomplete, but close enough that I feel, before it's full launch, I should have the community look it over.

And don't worry, its not mean at all. You gave advice on how to improve it and asked legitimate questions.

Mind if I steal the name relay?

There isn't any need for a relay on a wired network, as wired networks can reach infinitly. The only problem with wired networks is that if they go a long distance, all the chunks there are wires in must stay loaded in order for it to work correctly.

And yes, you can use the name relay, the definition of it is 'Receive and pass on' :P/>
Devon The Novice #7
Posted 04 August 2013 - 05:55 PM
actually at least in my tests, the range was around 255, i tested with a really long cord stretching from the bottom to the top same chunk :P/>, with a cord of 254 it worked, but extended to around 256, and it stops receiving. Well, however the cables work, the refresher (relay in devnet 0.1.5) will be there just in case.
Devon The Novice #8
Posted 04 August 2013 - 06:11 PM
launched an update to fix LAN messages, devnet should be able to send messages via the local network as well and the whole devnet.

as for security and wireless/message checking, that will be added soon, but not yet.
Devon The Novice #9
Posted 16 September 2013 - 05:56 PM
A massive DevNet update is nearly done, it has too much planned for me to type it out on a phone, so I will list it all when I launch it, but this time, it will be so much more then a glorified rednet. I also have a side project that I will be revealing when it is ready for beta testing