Jump to content




M1cr0API v4.0 (All in One Print, Redstone and File functions)

api wireless computer

17 replies to this topic

#1 M1cr0man

    Lua Function Master

  • Members
  • 34 posts

Posted 25 March 2012 - 11:46 PM

M1cr0API v4.0

Makin' it easier


18 functions to extend redstone and textutils APIs, ranging from redstone inverter, to monitor and terminal printer in one.

Links:
Spoiler

Included Functions:
Spoiler

Usage:
Spoiler

Programs using M1cr0API:
Spoiler

Credits & Licence:
Spoiler

Changelog:
Spoiler

To-Do:
Spoiler
Enjoy using my API, and remember to give credits :)/>
Also, post any bugs you find in comments

#2 djblocksaway

    Epic Coderz

  • New Members
  • 397 posts
  • LocationAustralia

Posted 06 April 2012 - 12:41 PM

nice API really useful :)/>

#3 Noodle

  • Members
  • 989 posts
  • LocationSometime.

Posted 06 April 2012 - 02:18 PM

At school right now. I WILL definately try when I get home.

#4 sabian8

  • New Members
  • 51 posts
  • LocationEngland

Posted 06 April 2012 - 05:14 PM

I am a bit stuck with the anti-terminate function, how do i use it?

#5 M1cr0man

    Lua Function Master

  • Members
  • 34 posts

Posted 06 April 2012 - 06:50 PM

View Postsabian8, on 06 April 2012 - 05:14 PM, said:

I am a bit stuck with the anti-terminate function, how do i use it?
What you have to do is put <apifilename>.set(true, 1, 1) near the top of your program. The first argument is whether or not to enable anti-terminate (true, in your case). The other 2 arguments are for handling where the printex "history" argument starts and stops.
Hope this helps :)/>

#6 M1cr0man

    Lua Function Master

  • Members
  • 34 posts

Posted 07 April 2012 - 01:16 PM

Added version 2.6. Changelog:
-Fixed printex nowrap argument making long strings with no n not display.
-Fixed printex history argument not doing anything.
+Added "nocursor" argument - check readme for usage and description.
+Summarised printex code more. Slightly smaller file.

#7 cant_delete_account

  • Members
  • 484 posts

Posted 07 April 2012 - 11:54 PM

Might wanna add some API docs, I have no idea what the names for the functions are, the arguments, etc.

#8 M1cr0man

    Lua Function Master

  • Members
  • 34 posts

Posted 08 April 2012 - 10:38 PM

View Postthesbros, on 07 April 2012 - 11:54 PM, said:

Might wanna add some API docs, I have no idea what the names for the functions are, the arguments, etc.
Check the readme.txt out. It contains all the functions, descriptions of what they do, their arguments and what they are/do aswell.
I might look into finding out how to add a help section to the CC-help command aswell.

#9 sabian8

  • New Members
  • 51 posts
  • LocationEngland

Posted 09 April 2012 - 01:17 PM

View PostM1cr0man, on 06 April 2012 - 06:50 PM, said:

View Postsabian8, on 06 April 2012 - 05:14 PM, said:

I am a bit stuck with the anti-terminate function, how do i use it?
What you have to do is put <apifilename>.set(true, 1, 1) near the top of your program. The first argument is whether or not to enable anti-terminate (true, in your case). The other 2 arguments are for handling where the printex "history" argument starts and stops.
Hope this helps :P/>
Thanks! :D/>

#10 M1cr0man

    Lua Function Master

  • Members
  • 34 posts

Posted 25 April 2012 - 08:50 PM

Added version 2.7 - Changelog:
-Fixed readex line 281 error
-Updated immibis' Serializer. Works properly with boolean false now.
-Remove a 0.1 wait from bundleset() which wasn't doing its purpose - stopping a timer from being set on if it is called at the same time as its tick.
+Added gethistory(agelimit) - will return printex history as a table. If <agelimit - number> is defined, it will only return that amount of recent history.
+Added 3 extra args to readex(). 3rd arg = Character/String to print on screen per key, 4th arg = Printex position/3rd arg, 5th arg = Printex 4th arg

#11 Rwkeith

  • Members
  • 56 posts

Posted 26 April 2012 - 03:22 AM

Very useful. Great contribution,

#12 M1cr0man

    Lua Function Master

  • Members
  • 34 posts

Posted 20 May 2012 - 03:59 PM

I have stopped programming for a while now. My exams are coming in around 3 weeks time, and I have too much to do to be programming.

BUT after those 3 weeks, I will be actively updating this and some other programs I have ready to upload (But need to make videos), so don't think this API is dead for 1 second :P/>

#13 M1cr0man

    Lua Function Master

  • Members
  • 34 posts

Posted 10 July 2012 - 10:27 PM

Major Changes in version 2.9:
-Fixed bug where redchk would return nil if no wire was present/broken on checked side
-Fixed wait returning the wrong event.
*Redchk and Redwait were doing the same thing. Removed redwait.
-Rewrote and Fixed most of the redstone functions firing when a different cable changes, and other bugs.
*Redsig now inverts the signal on a wire instead of setting it true and false (eg. It was not true in the first place)
-Removed comments at the start of the code, bringing it down to 360 lines.

#14 M1cr0man

    Lua Function Master

  • Members
  • 34 posts

Posted 18 August 2012 - 03:53 PM

3.0 Is out. Printex finally has monitor support! :(/>
+Added "monitor", "omonitor", "hstmon" args to printex, check below for description and usage
+Documented wrap() command. See below for discription and usage
-Fixed possible problems with n and tablesave/tableload
-Printex "nocursor" arguement actually restores the cursor to the original position now

#15 M1cr0man

    Lua Function Master

  • Members
  • 34 posts

Posted 18 August 2012 - 03:59 PM

Using M1cr0API in a published program? Post a link to it below and I will add it to the first post! :(/>

#16 M1cr0man

    Lua Function Master

  • Members
  • 34 posts

Posted 31 August 2012 - 08:26 PM

3.1 released! Just bug fixes, but big ones:
-Printex "history" and "hstmon" arguements now only prints the 2nd last string and older
-Mininmum redsig delay is now 0.1, due to how fast bundled cables update
-Fixed everything printed being wrote to history

#17 M1cr0man

    Lua Function Master

  • Members
  • 34 posts

Posted 06 September 2012 - 04:15 PM

3.2 is out. Only 1 simple but serious bugfix:
-Fixed readex spamming the alternative character provided in arguement

I'd appreciate any feedback anyone has on this. like if it made life easier when printing or working with bundled cables, or anything related, just post 'n' bump :D/>

#18 M1cr0man

    Lua Function Master

  • Members
  • 34 posts

Posted 28 March 2013 - 05:35 AM

I'm back :) And I've made some HUGE additions, fixes, and changes - much needed colour support for printex being the largest one.

For now, here is the M1cr0API 4.0 Beta, I will release it next week or so as I want to do lots of testing on the changes I made. Changelog:
    *Set no longer needs all arguements defined
    *tablesave is now save, and always serializes data.
    *tableload is now load, and auto-converts any form of data to the right type. ie "true" will be converted to true. The filed does not need to have been saved with save()
    *tablesend is now send. It automatically opens rednet modem, and always serializes data
    *tablereceive is now receive. It automatically opens rednet modem, and converts data automatically to its correct type (see load())
    +Printex now supports colours! Add %colour% to the text string to colour the text after it. add "bg" after the first % to set background color like so: %bggreen%
    +Added comparetable. Compares all elements of a table and returns if they are exactly the same
    +Passing events to os.pullEvent() should now work
    -Removed comment from start of code
    -History end position is no longer 1 line off
    -Printex now sets next cursor line when "nocursor" isn't specified (like it should)
    +Credit to everyone on #computercraft who helped me with problems I had with printex.

Grab the readme from the first post, it is now updated. Please report any bugs you find here or directly to me on the irc.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users