Jump to content




Redstone helper API - rshelp

api

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

#1 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 03 April 2012 - 06:40 PM

Have you ever tried to get a redstone event, and found it lacking the side the redstone event occured on, and whether it was true or false?

I have, which is why I decided to create this API. The usage is very simple for what is provided.

rshelp.pullEvent([noTerminate, exclusive, side, wire, val])

In its simplest form, you can use this EXACTLY like os.pullEvent. The main difference is that if the event is a redstone event, further params are returned. The params returned are the side, the type of redpower coloured cable, or if it is plain redstone, and whether the cable is on or off (true or false). Rather then explaining it, I'll provide examples:

Documentation:
Spoiler

Get the API!
Spoiler

Changelog
Spoiler

I hope you enjoy this and that it is useful. Please feel free to provide me with feedback or requests :)/> I am thinking of expanding it to provide more information on the peripheral event too, and expanding the metatable functionality, so watch this space!

#2 Noodle

  • Members
  • 989 posts
  • LocationSometime.

Posted 03 April 2012 - 09:37 PM

Nice! Used this, help very much.
Do you mind if I reuse some of the code in the API?

#3 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 03 April 2012 - 10:04 PM

Not at all, provided you state you use some of my code, or at least mention me somewhere!

#4 libraryaddict

  • New Members
  • 195 posts

Posted 06 April 2012 - 03:06 PM

Am I a idiot or is there no API to download :

#5 Teraminer

  • New Members
  • 175 posts
  • LocationDon't look behind you..

Posted 06 April 2012 - 04:23 PM

Well you are an not idiot.Yes the download is mising..

#6 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 06 April 2012 - 09:46 PM

D'oh! I have no idea what happened there people. Please feel free to download the API now :)/>

#7 FuzzyPurp

    Part-Time Ninja

  • Members
  • 510 posts
  • LocationHarlem, NY

Posted 08 April 2012 - 07:47 PM

Nice work, very useful.

#8 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 08 April 2012 - 08:20 PM

Thanks :P/> I plan to expand it when I get time and ideas! If you have any, please feel free to share.

#9 Istas

  • New Members
  • 1 posts

Posted 30 May 2012 - 10:31 PM

It was pretty discouraging to be getting into writing a more involved program and then find that the rs API didn't already have this functionality.

Then I searched for this and it'll save me a bunch of annoying code I wasn't looking forward to writing.

It's easier to use than the kludge I was starting to plan, too. Thanks for sharing this!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users