Jump to content




Devon The Novice's Noobish Programs

computer api networking

8 replies to this topic

#1 Devon The Novice

  • Members
  • 14 posts
  • LocationUnity University, Unity City, Unity

Posted 03 August 2013 - 07: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 by Devon The Novice, 30 January 2014 - 11:47 PM.


#2 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 03 August 2013 - 08: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


#3 Devon The Novice

  • Members
  • 14 posts
  • LocationUnity University, Unity City, Unity

Posted 03 August 2013 - 11:35 PM

View PostFreack100, on 03 August 2013 - 08:01 PM, said:

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.

#4 DeweySalt

  • Members
  • 52 posts
  • LocationIn a galaxy far far away, aka New York

Posted 04 August 2013 - 02: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)

#5 Devon The Novice

  • Members
  • 14 posts
  • LocationUnity University, Unity City, Unity

Posted 04 August 2013 - 12: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 by Devon The Novice, 04 August 2013 - 12:40 PM.


#6 DeweySalt

  • Members
  • 52 posts
  • LocationIn a galaxy far far away, aka New York

Posted 04 August 2013 - 02:02 PM

View PostDevon The Novice, on 04 August 2013 - 12:39 PM, said:

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

#7 Devon The Novice

  • Members
  • 14 posts
  • LocationUnity University, Unity City, Unity

Posted 04 August 2013 - 04: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.

#8 Devon The Novice

  • Members
  • 14 posts
  • LocationUnity University, Unity City, Unity

Posted 04 August 2013 - 05: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.

#9 Devon The Novice

  • Members
  • 14 posts
  • LocationUnity University, Unity City, Unity

Posted 16 September 2013 - 04: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





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users