Part of the Minds of Chimera Project (dev)
CodeBlocks | MOCPlaytimeTracker | MOCDBLib | RegenBlock | MOCGoodEats | MOC3DImporter | ImageImport | MOCKiosk | MOCRater | MOCFizziks | GravitySheep | MOCChemistry | MOCRegistry
Description
CodeBlocks allows user to control robots through different functions user wrote using special custom blocks. This plugin is still under heavy development and as such might be somewhat buggy. Please report any issues as well as suggestions here.
This is a next stage of CodeBlocks found at http:dev.bukkit.org/server-mods/codeblocks/ . It was expanded to be a lot more dynamic and have more functionality like loops, switches etc.
Each user has their own function space where they can add as many functions as they wants which can call each other or even themselves for recursion, as well as, a fleet of robots that can execute these functions. Multiple robots can run same function or each can run their own.
You can try out latest build on my server at server.aiwing.org I might be around to answer any questions etc as well.
Dependencies
Spout - for custom blocks and GUI.
Permissions
Atm there is a single permission that gives full access to the plugin CodeBlocks.All - Default OP Aside from the ability to use the CodeBlocks in general each move of the robot attempts to check player's permissions with the server as well. So if the player cannot destroy blocks at a particular spot robot will not move there or place blocks etc.
Commands
/cb - Opens main GUI window from which you can go to Functions, Robots, or Blocks windows. /cb functions - Opens Functions GUI /cb robots - Opens Robots GUI /cb blocks - Opens Blocks GUI - you can get custom blocks here while in any mode creative or survival. /cb blocks all - will drop all possible code blocks in stacks of 64 around the player.
Use
Robot - To create a new robot player needs to simple put a robot block wherever they want it. This will open up Robot Controller GUI where they can select a function robot will run (initially empty), adjust speed (20 default means 20 ticks or 1 second per action, min is half a second), assign a name to the robot, and finally control the execution of the function through Run/Stop/Pause buttons.
Last three buttons on the Robot Controller screen are Recall - removes robot from the world dropping its inventory and a single robot block at player's feet. Teleport - Teleports the user to the robot's location Summon - Teleports the robot to the player's location and sets its facing direction to that of the player.
From /cb robots - player can view all of the robots in the current world.
Function To write a first function player needs to put a block [CB] Function on the ground. GUI prompt will ask if player wants to edit an existing function (in which case it will be pasted at that location checking player's build permissions for the area) or to create a new one. First time user will create new function and assign it a name. Name can be any string with or without spaces on the first line of the sign if sign is edited through some other means.
From there player simply puts different code blocks from east to west in a straight line to create a function. (Compass is not really needed, if you look at the top of the block, just make sure worlds there are creating a sentence from left to right - i.e. you would see Func Down Down ... not that upside down etc.)
There are few types of blocks: Blocks page
Robot - robot block
Tool - tool block, this can be used to either compile/save a function by clicking a function block while holding the tool block, or to move parts of the code. Left click shifts blocks left, right - right.
Function blocks - Red. While the other types of blocks are placed in a straight line, most of the function blocks create branches. Branch should be one block down (to north) from the main line of code and then continue parallel to it. You can use White Space block to create separation between parts of code as needed, white block only works for horizontal spacing atm.
When branch is taken, execution moves down into the branch and executes those blocks, after execution continues from the root of the branch (i.e. next block after IF etc.)
Interaction blocks - Blue - Build - takes a block out of robot's inventory and builds it in the world at specified robot's side, Destroy - removes the block and doesn't collect drops, Dig - removes the block and collects drops, PickUp / Place work together - one picks up a block and puts it on top of stack, second takes block from the top of that same stack and places it back in the world.
Movement blocks - Green - move robot one block in the direction indicated or a turn
In general all blocks have some default meaning assigned to them, with Sign block placed on top of them that meaning can be changed for some of the blocks. GUI window should pop up in the case a Sign block works on the code block. For example on block Dig - sign block would ask for a single attribute - Robot's Side, by default this is assumed to be front. Build needs 3 - Block Type, Block data value (wool colors etc.), Robot's Side.
Introductory Video
2.0.2
2.0.3