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
-Latest API:
M1cr0API v4.0.txt 18.25K
163 downloads Pastebin Link (Permanent): http://pastebin.com/YfV1CAHb
-Readme/Documentation: readme.txt 8.14K 135 downloads
Old Versions:
-Readme/Documentation: readme.txt 8.14K 135 downloads
Old Versions:
Spoiler
-v3.2:
M1cr0API v3.2.txt 15.28K
168 downloads
-v3.1: M1cr0API v3.1.txt 15.33K 194 downloads
-v3.0 for 1.31+: M1cr0API v3.0.txt 15.28K 163 downloads
-v2.9 for 1.3+: M1cr0API v2.9.txt 13.6K 179 downloads
-v2.8 for 1.3+: M1cr0API v2.8.txt 17.82K 143 downloads
-v2.7 for 1.3+: M1cr0API v2.7.txt 17.79K 192 downloads
-v2.6 for 1.3+: M1cr0API v2.6.txt 15.77K 325 downloads
-v3.1: M1cr0API v3.1.txt 15.33K 194 downloads
-v3.0 for 1.31+: M1cr0API v3.0.txt 15.28K 163 downloads
-v2.9 for 1.3+: M1cr0API v2.9.txt 13.6K 179 downloads
-v2.8 for 1.3+: M1cr0API v2.8.txt 17.82K 143 downloads
-v2.7 for 1.3+: M1cr0API v2.7.txt 17.79K 192 downloads
-v2.6 for 1.3+: M1cr0API v2.6.txt 15.77K 325 downloads
Included Functions:
Spoiler
-Immibis' Serialize/Deserialize
-Anti-Ctrl+T
-Wait
-Bundled colour setter
-Rs & bundled checker
-Rs & bundled signaller
-Rs & bundled inverter
-Advanced read() with text centering, input limiting and monitor support
-Advanced print() with colour support, text centering and monitor support
-Save to file with auto-serialize
-Load from file with auto type conversion
-Wifi send with auto-serialize
-Wifi receive with auto type conversion]]--
-Advanced Print
-Word Wrap
-Peripheral side checker
-Usage instructions and descriptions can be found in the readme.txt
-Anti-Ctrl+T
-Wait
-Bundled colour setter
-Rs & bundled checker
-Rs & bundled signaller
-Rs & bundled inverter
-Advanced read() with text centering, input limiting and monitor support
-Advanced print() with colour support, text centering and monitor support
-Save to file with auto-serialize
-Load from file with auto type conversion
-Wifi send with auto-serialize
-Wifi receive with auto type conversion]]--
-Advanced Print
-Word Wrap
-Peripheral side checker
-Usage instructions and descriptions can be found in the readme.txt
Usage:
Spoiler
1. Download the API from above.
2. Rename it something handy. All functions you call must have '<filename>.' infront of them.
3. Copy it to the pc/floppy you are programming on OR
4. Copy it to %appdata%\.minecraft\mods\ComputerCraft\lua\rom\apis
5. ONLY for step 3, put 'os.loadAPI("<path>/<filename>")' at the start of your program.
6. Use '<filename>.<function>(<args>)' to call functions, or do shell.run("<filename>") and then <function>(<args>) to call functions.
7. Enjoy />
2. Rename it something handy. All functions you call must have '<filename>.' infront of them.
3. Copy it to the pc/floppy you are programming on OR
4. Copy it to %appdata%\.minecraft\mods\ComputerCraft\lua\rom\apis
5. ONLY for step 3, put 'os.loadAPI("<path>/<filename>")' at the start of your program.
6. Use '<filename>.<function>(<args>)' to call functions, or do shell.run("<filename>") and then <function>(<args>) to call functions.
7. Enjoy />
Programs using M1cr0API:
Spoiler
-M1cr0S Client and Server
-Nuclear Reactor Controller
-Post a link to your published programs that use this API and I will add them />
-Nuclear Reactor Controller
-Post a link to your published programs that use this API and I will add them />
Credits & Licence:
Spoiler
-Special Thanks to all those on the Computer Craft IRC, especially immibis for allowing me to
include and use his
serialize/deserialize functions.
LICENCE:
-You can use and redistribute the ORIGINAL API from this page in any program AS A FILE.
-You CANNOT redistribute a MODIFIED VERSION of this api.
include and use his
serialize/deserialize functions.
LICENCE:
-You can use and redistribute the ORIGINAL API from this page in any program AS A FILE.
-You CANNOT redistribute a MODIFIED VERSION of this api.
Changelog:
Spoiler
4.0:
*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.
3.2:
-Fixed readex spamming the alternative character provided in arguement
3.1:
-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
3.0:
-Fixed possible problems with \n and tablesave/tableload
-Printex "nocursor" arguement actually restores the cursor to the original position now
+Documented wrap() command. See below for discription and usage
+Added "monitor", "omonitor", "hstmon" args to printex, check below for description and usage
2.9 (Major Changes):
-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)
2.8
-Printex now refreshes its screen size upon each call.
-Fixed readex line 285 error.
2.7:
-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
2.6:
-Fixed nowrap argument making long strings with no \n not display.
-Fixed history argument not doing anything.
+Added "nocursor" argument - check readme for usage and description.
+Summarised printex code more. Slightly smaller file.
2.5:
+Initial Release
*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.
3.2:
-Fixed readex spamming the alternative character provided in arguement
3.1:
-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
3.0:
-Fixed possible problems with \n and tablesave/tableload
-Printex "nocursor" arguement actually restores the cursor to the original position now
+Documented wrap() command. See below for discription and usage
+Added "monitor", "omonitor", "hstmon" args to printex, check below for description and usage
2.9 (Major Changes):
-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)
2.8
-Printex now refreshes its screen size upon each call.
-Fixed readex line 285 error.
2.7:
-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
2.6:
-Fixed nowrap argument making long strings with no \n not display.
-Fixed history argument not doing anything.
+Added "nocursor" argument - check readme for usage and description.
+Summarised printex code more. Slightly smaller file.
2.5:
+Initial Release
To-Do:
Spoiler
Enjoy using my API, and remember to give credits /> -Add the API to cc-get.
-Any ideas?
-Any ideas?
Also, post any bugs you find in comments