Posted 02 December 2012 - 10:52 AM

Lyqyd and I have been busy the last week, and there's a prerelease of v2.2 for mc 1.7.10 finally ready. All known bugs have been fixed, but there may be more lurking around yet to be uncovered; if anyone tests it and finds any issues, please report them here, either in the thread or on the github repo download link: BioLock v2.2.pr1 for Minecraft 1.7.10 I've only tested it with cc 1.73, if there have been api changes lately, it may not work with older, but if yer not using 1.73, you should be, all earlier 1.7.10-compatible versions have crucial issues.Thanks to gamax for updating it to 1.6.4 while I was ... on sabatical, lets call it.I plan to update it again as soon as the next version of CC is out of beta and released properly.

gamax92, on 20 December 2013 - 07:44 PM, said:





Changes:

Typo in the crafting recipes fixed, PRB's are craftable.

Removed usage of RecipeResetProgrammable, Everything no longer crafts into a PRB.



Downloads:

MC 1.5.2

MC 1.6.2

MC 1.6.4 (Also works on 1.6.2)

I would like to note that I have not gotten Gopher's permission to fix and port his peripherals but I hope that by doing this, it helps keep this mod alive and well.Typo in the crafting recipes fixed, PRB's are craftable.Removed usage of RecipeResetProgrammable, Everything no longer crafts into a PRB.

**New video** courtesy of Aucarndia, who use the new keypad blocks plus immibis' mods to make a very snazzy elevator!

I'm not able to record/upload videos right now; if anyone makes a video demonstrating the new PRBs and/or Keypad Locks, I'll embed it in the posts here and on minecraftforum.net!

Major new addition: Keypad Locks!

new

BioLocks

Spoiler



I can hear some of you asking "Why a pseudorandom string? Why not just give me their name?" Well, relax. If you edit the config file, you can change the default behavior so it returns the username of the person who clicked instead of a random identifier, saving you the bother of writing code to store the fistprint identifiers and associate them with usernames.



Usage

Peripheral Methods

Spoiler



Like any peripheral, wrap it first to get a table of methods

local sSide="bottom" --or whatever side it's on local biolock=peripheral.wrap(sSide) The methods you can call on this object:

learn(name,bioprint,level)

associate a name and access level with the device. Limit 16 (unless you edit the mod's config file), try to learn a 17th and it will return false and an error message. Takes 3 parameters: first the name to associate, second the bioprint to associate the name with (you'll have to catch these from os.pullEvent("biolock")), and an access level. Access level must be in the range 1-5.

biolock.learn("MyName",myPrint,5)

forget(name)

Just pass a stored name previously learned to make it forget it.

biolock.forget("MyName")

getLearnedNames()

No parameters, returns all the names it has learned. Returns each name as a separate value, so catch in {} to make a lua table...

local names={biolock.getLearnedNames()]

getPrint(name)

gets the bioprint associated with a given name

local bioprint=biolock.getPrint("MyName")

getAccessLevel(name)

gets the bioprint associated with a given name

local level=biolock.getAccessLevel("MyName")

program(side,level,ticks,[reverseOutput=false,[reverseLevel=false]])

Programs the redstone output logic for the specified side. Level is the minimum level to activate, ticks how long to stay activated. reverseLevel and reverseOutput are optional, defaulting to false. If reverseOutput is true, the block will output except when activated, instead of only when activated. If reverseLevel is true, instead of activating when someone equal to or higher than the set level is scanned, it activates when someone lower is scanned.

program("back",5,20) --outputs redstone from the back for 20 ticks when scanned by someone with access level 5. program("left",3,10,true) --outputs redstone from the left constantly, but stopping for 10 ticks when scanned by someone level 3 or higher program("front",1,20,true,true) -- outputs from the front for 20 ticks after scanned --by somone who is NOT level 1 or above, i.e., anyone not learn()ed

forgetProgram(side)

removes a program from the specified side.

All methods return either a requested value or true on success, and false plus an error string on failure.Like any peripheral, wrap it first to get a table of methodsThe methods you can call on this object:associate a name and access level with the device. Limit 16 (unless you edit the mod's config file), try to learn a 17th and it will return false and an error message. Takes 3 parameters: first the name to associate, second the bioprint to associate the name with (you'll have to catch these from os.pullEvent("biolock")), and an access level. Access level must be in the range 1-5.Just pass a stored name previously learned to make it forget it.No parameters, returns all the names it has learned. Returns each name as a separate value, so catch in {} to make a lua table...gets the bioprint associated with a given namegets the bioprint associated with a given namePrograms the redstone output logic for the specified side. Level is the minimum level to activate, ticks how long to stay activated. reverseLevel and reverseOutput are optional, defaulting to false. If reverseOutput is true, the block will output except when activated, instead of only when activated. If reverseLevel is true, instead of activating when someone equal to or higher than the set level is scanned, it activates when someone lower is scanned.removes a program from the specified side.

Events

"biolock", print, attachName, learnedName, accessLevel

Generated when someone right-clicks the biolock and is scanned.

print is the unique hash code that represents the player on this world (or, if the config setting bioLock_GivesUsernames" is true, the true name of the player). attachName is the attachment name of the biolock, the side or lan name used to wrap the peripheral. learnedName is the name the biolock has learned to associate with this print, or "" if it has not been learned, and accessLevel is the level stored with this print, or 0 if none.





New Shell Program

A new convenience utility program is now added to rom/programs when the peripheral is attached called biolock.

Usage:

Spoiler

biolock

Side is the side the peripheral to be affected is on; command can be learn, forget, or list. List takes no additional args and displays a formatted list of the bioprints it's learned and the names and access levels associated with them. Forget takes just a name and makes the BioLock forget the stored print associated with it. Learn takes a name and an access level, prompts for someone to scan (right-click the peripheral), and then associates the scanned bioprint with the provided name and access level.





Crafting



NOTE this has changed! will get new screenshot later, for now, know the new recipe is

stone-stone-stone

stone-prb-stone

stone-glass pane-stone



I can hear some of you asking "Why a pseudorandom string? Why not just give me their name?" Well, relax. If you edit the config file, you can change the default behavior so it returns the username of the person who clicked instead of a random identifier, saving you the bother of writing code to store the fistprint identifiers and associate them with usernames.Peripheral Methods"biolock", print, attachName, learnedName, accessLevelGenerated when someone right-clicks the biolock and is scanned.print is the unique hash code that represents the player on this world (or, if the config setting bioLock_GivesUsernames" is true, the true name of the player). attachName is the attachment name of the biolock, the side or lan name used to wrap the peripheral. learnedName is the name the biolock has learned to associate with this print, or "" if it has not been learned, and accessLevel is the level stored with this print, or 0 if none.A new convenience utility program is now added to rom/programs when the peripheral is attached called biolock.Usage:will get new screenshot later, for now, know the new recipe isstone-stone-stonestone-prb-stonestone-glass pane-stone

Keypad Locks

Spoiler

Full documentation coming later, I need to stop to eat, and walk, and relax, first



For now, what you need to know: from the peripheral side, these work very similarly to biolocks.

Methods:

program & forgetProgram

works exactly like program on the biolock, except that instead of being activated by bioprints, they're activated when stored codes are entered.



learnCode(name,code,accessLevel) & forgetCode(name)

very similar to learnPrint, name is a name associated with this pin code, which will be returned in keypad_code events; code is a string representing the code itself - can be 1 to 8 characters long, any of 0-9, *, and #, the 12 symbols on the keypad buttons. accessLevel is 1-5, like the BioScanner, which affect how the programs (from program method) are activated in response to the code.



Events:

"keypad_button", attachName, button

sent every time a button is pressed.

attachName is the name of the device, same you would use for peripheral.wrap(), either the side of the computer it's on or the name of the networked peripheral.



"keypad_code", attachName, codeName, accessLevel

sent when a learned code is fully entered.

attachName is same as always, codeName is the name used to identify the code when it was learned with learnCode, and accessLevel is the accessLevel associated with the code.



crafting

[image coming later]



button-button-button

button-prb-button

button-button-button



button is a normal stone button, prb is a programmable redstone block from this mod.



Note this recipe is temporary, and will be changing in upcoming versions - along with another tweak to the biolock recipe.



PRBs

Spoiler

Usage

Peripheral Methods

setOutput(side,value1)

setOutput(side,value1,operation,value2)

used to set the output of a given side.

If given only two argument, sets the output on the specified side to that value. true or false become 0 or 15, while integer values on the range 0-15 are set directly.

prb.setOutput("left",true) prb.setOutput("top",11)

value1 can also be a string representing a side, i.e., "top", "left", etc., and that side's input value will be echoed to side.

prb.setOutput("left","top") -- value coming in top will be sent back out the left.

If the 3rd and 4th arguments are specified, they can be used to do logical operations on 2 or more values.

value2 can have any of the same types as value1 - it can be true/false, a number, or the name of a side. Most commonly, you will want to use the name of a 2nd side, to do logical or comparison operations on two side inputs to produce a third side's output.

operator will be a string selecting an operation to perform. The following operations are available:

Boolean operators

These compare their input values as booleans, either true (not zero) or false (0).

"and" true if value1 and value2 are both true.

"or" true if either value1 or value2 is on, or if both are true.

"xor" true if exactly one of value1 and value2 are true, otherwise false

"nand" opposite of and, false if value1 and value2 are both true, otherwise true

"nor" opposite of "or", true only if both inputs are false

"nxor"/"same" opposite of xor, true if value1 and value2 are both true or both false, otherwise false



Comparison operators

These compare analog values numerically, but then output either true (15) or false (0)

"==" true if they are exactly equal values

"!=" true if they are inequal

">" true if value1 is greater than value2

">=" true if value1 is greater than or equal to value2

"<" true if value1 is less than value2

"<=" true if value1 is less than or equal to value2



Other operators

"max" outputs whichever of the two inputs is largest; if value1 is 7 and value2 is 10, will output 10. Similar to one setting on a redstone comparator.

"min" outputs whichever of the two inputs is smallest.

"if" outputs value1, but only if value 2 is true. Acts like a gate.

"unless" outputs value1, but only if value2 is false. Acts like an inverted gate.

prb.setOutput("front","left","and","right") -- outputs on front only if both left and right are true prb.setOutput("top","left","min",5) -- outputs to top whichever is smaller, the input on the left side or the constant value 5

getInput(side)

returns the redstone input level of the specified side, as an integer from 0(off) to 15 (on, max strength)

prb.getInput("left")

getOutput(side)

returns the value currently being output by the PRB on the specified side

prb.getOutput("left")



Crafting





Events

"prb_input", attachName, side, value

generated whenever the redstone input on a side of the PRB changes. attachName is the name used to wrap the peripheral, side is the side of the PRB that changed, and value is the new redstone input level.



used to set the output of a given side.If given only two argument, sets the output on the specified side to that value. true or false become 0 or 15, while integer values on the range 0-15 are set directly.value1 can also be a string representing a side, i.e., "top", "left", etc., and that side's input value will be echoed to side.If the 3rd and 4th arguments are specified, they can be used to do logical operations on 2 or more values.value2 can have any of the same types as value1 - it can be true/false, a number, or the name of a side. Most commonly, you will want to use the name of a 2nd side, to do logical or comparison operations on two side inputs to produce a third side's output.operator will be a string selecting an operation to perform. The following operations are available:Boolean operatorsThese compare their input values as booleans, either true (not zero) or false (0)."and" true if value1 and value2 are both true."or" true if either value1 or value2 is on, or if both are true."xor" true if exactly one of value1 and value2 are true, otherwise false"nand" opposite of and, false if value1 and value2 are both true, otherwise true"nor" opposite of "or", true only if both inputs are false"nxor"/"same" opposite of xor, true if value1 and value2 are both true or both false, otherwise falseComparison operatorsThese compare analog values numerically, but then output either true (15) or false (0)"==" true if they are exactly equal values"!=" true if they are inequal">" true if value1 is greater than value2">=" true if value1 is greater than or equal to value2"

Common Methods

Spoiler

These methods are common to the BioLock, Keypad Lock, and PRB peripherals, and will be shared by most future blocks added to this mod as well.



Peripheral Methods

Spoiler

These methods are common to BioLock and PRB, and will be shared by all the future blocks I currently plan to add to this mod.



lock(password)

lock the peripheral interface, preventing use of any of it's peripheral methods by any computers until it is unlocked with the same password. While locked, only the unlock method can be called.



unlock(password)

unlocks.



Resetting

If you lock a peripheral and forget the password, you can reset it's program by placing it in a crafting grid by itself and pulling it out of the output side. This will unlock it, but will also reset the password and remove all stored programs!

These methods are common to the BioLock, Keypad Lock, and PRB peripherals, and will be shared by most future blocks added to this mod as well.

Download

Spoiler

0.9a - first release

0.91a

new features:

-fistprint event has 2nd parameter, the side of the computer the peripheral is on.

-block is slightly emissive, not enough to light an area but enough to see it in the dark

bug fixes:

-mcmod.info syntax error fixed, data tweaked, url added

-material and damage values corrected, now behaves like other computer blocks

-overrode normal drop behavior, now always drops even by hand

-block appears in "ComputerCraft" tab in creative mode instead of under "Blocks"

1.0.6b

new features:

-learn, forget, getLearnedNames, getPrint, getAccessLevel, program, and forgetProgram peripheral methods

-biolock shell program

-programming redstone output signals from biolock

-persistent storage of programmed settings when broken/replaced

-tooltip shows the unique id of the peripheral

bugs fixed:

-no longer crashes in smp

-...other things I'm sure I'm forgetting atm

1.0.7b

ported to 1.4.6, minor tweaks to path generation and eliminated some meaningless error messages.

1.0.8b

fixed a bug with directly controlling doors, unavoidably rolled back the 1.0.7 minor fixes in the process, will merge the two change sets in the not-too-distant future...

v2.0

Lots of changes in v2.0, the biggest being the addition of the new PRBs! In addition, there are some new features added to biolocks and the new PRBs, including the ability to password-lock the peripheral interface, preventing computers or turtles from wrapping and reprogramming them without knowing the password. There's also a stubbed feature, which will be used in the future, allowing configurable access levels based on computer ID, which will be used in the future to allow restricting access to some methods to specific computers or turtles when locked.

v2.1

-added Keypad Locks, which work similarly to BioLocks but have a physical keypad for entering codes.

-fixed bug in 1.5.2 version that prevented the biolock program from mounting properly

-changed recipe for biolocks to incorporate a PRB instead of redstone dust

-changed behavior so you can only click to be scanned from the front of the block

-ported to mc 1.6.2

-biolock scan events get properly sent out to all clients now, so you can see the scan animation when other people click the scanner.

v2.1.1

removed cruff, logging noise, and fixed version number issue

v2.1.2

fixed major bug with the 1.5.2 version which was crashing clients in smp. Bug did not affect 1.6.2 versions, or ssp in either version.



Place one by a computer, and you start getting "biolock" events containing a unique identifier for the player who scanned them. By itself, that's a pretty handy way to make secure door locks, but now there's more!You can also teach it to associate names and access levels for up to 16 of these bio prints, and then you can program them to output redstone signals on any of it's 6 sides according to simple logic based on those stored access levels.These 12-key keypads are rendered with physical buttons; every button press sends an event to any attached computers, but you can also program them similarly to biolocks, add codes with access levels and program sides to output custom signals that respond to those codes. And, like biolocks, if programmed, they no longer need the computer connection, they will happily output redstone in response to stored codes without any computer involvement!Programmed via connected computer or turtle like the BioLock peripheral, these blocks can act as extenders for redstone control, giving per-side, analog redstone input and output just like a computer's, allowing one computer control redstone devices over a wide area from a single program. Like biolocks, once programmed, they can also be detached from the computer, broken, and placed elsewhere, and they will continue to carry out programmed logical operations, acting like any common logic gate, doing comparisons on analog inputs, and more.This video is from aucarndia, apparently aka gamspony, who made this elevator using the new keypad blocks, as well as immibis' microblocks, with some help from immibis' adventure peripheralTheold video, explaining and demoing the then new 1.0 features!(original demo of v0.9a)v2.1.3!Got more features planned for this down the road, as well as other, more interesting and useful ideas for peripherals, which will be coming soon.Any errors, bugs, block ID conflicts, etc, please report them here.You're free to include this mod in any modpacks, public or private; I only ask you not modify the modinfo file and, if linking to a download that includes this mod on a forum, include a link to this thread as well. People will need the documentation to use more than the most basic features, anyway! I'd also ask that you let me know, in the thread or via PM. No need to wait for permission or anything, it's just nice to know when people are using my mod. Helps with the motivation to keep it maintained and such.Enjoy!

Edited by GopherAtl, 11 April 2015 - 11:17 PM.