Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function main(func){
- var entx = func.getX(); //X-Coordinate
- var enty = func.getY(); //Y-Coordinate
- var entz = func.getZ(); //Z-Coordinate
- var looking = 0;
- sendCommand("/gamerule commandBlockOutput false");
- sendCommand('/summon ArmorStand ~ ~1 ~ {CustomName:"RobotCarol",CustomNameVisible:1,Equipment:[{},{id:iron_boots,Count:1},{id:iron_leggings,Count:1},{id:iron_chestplate,Count:1},{id:dirt,Count:1}]}');
- // basic Commands:
- // step(); lets your robot walk one block
- // set(); lets your robot place a block
- // turnRight(); lets your robot turn Right
- // turnLeft(); lets your robot turn Left
- // sendCommand("s"); executes a command inside Minecraft (s = to execute [e.g. /say tree])
- // sleep(1000); sleeps 1000 milliseconds (=1sec.) you can also use different Numbers [like sleep(2345);]
- // turnRight() and turnLeft() don't work yet!
- // of course you can also use if conditions, while loops and so on. Don't worry if you don't know what that is :)
- // if you want to learn how to use those, just google "javascript tutorial for beginners" or something like that
- //write your RobotSteve Minescript code below
- //Code Example: (remove it if you want to create your own :) )
- turnRight();
- step();
- sleep(1000);
- step();
- sleep(1000);
- step();
- sleep(1000);
- step();
- sleep(1000);
- step();
- sleep(1000);
- step();
- sleep(1000);
- step();
- sleep(1000);
- set();
- turnRight();
- //end of Code Example
- //ignore everything below here
- function sleep(milliseconds) {
- var start = new Date().getTime();
- for (var i = 0; i < 1e7; i++) {
- if ((new Date().getTime() - start) > milliseconds){
- break;
- }
- }
- }
- function step(){
- if(isWall()==false&&looking==0){sendCommand("/tp @e[name=RobotCarol] ~1 ~ ~");}
- if(isWall()==false&&looking==1){sendCommand("/tp @e[name=RobotCarol] ~ ~ ~1");}
- if(isWall()==false&&looking==2){sendCommand("/tp @e[name=RobotCarol] ~-1 ~ ~");}
- if(isWall()==false&&looking==3){sendCommand("/tp @e[name=RobotCarol] ~ ~ ~-1");}
- }
- function set(){
- if(looking==0){sendCommand("/execute @e[name=RobotCarol] ~1 ~ ~ /setblock ~ ~ ~ minecraft:stone 0 replace");}
- if(looking==1){sendCommand("/execute @e[name=RobotCarol] ~ ~ ~1 /setblock ~ ~ ~ minecraft:stone 0 replace");}
- if(looking==2){sendCommand("/execute @e[name=RobotCarol] ~-1 ~ ~ /setblock ~ ~ ~ minecraft:stone 0 replace");}
- if(looking==3){sendCommand("/execute @e[name=RobotCarol] ~ ~ ~-1 /setblock ~ ~ ~ minecraft:stone 0 replace");}
- }
- function isWall(){
- return false;
- //TODO
- }
- function turnRight(){
- looking = looking + 1;
- sendCommand("/tp @e[name=RobotCarol] ~ ~ ~ ~90 ~");
- if(looking>3){
- looking = 0;
- }
- }
- function turnLeft(){
- looking = looking - 1;
- sendCommand("/tp @e[name=RobotCarol] ~ ~ ~ ~-90 ~");
- if(looking<0){
- looking = 3;
- }
- }
- function popUp(Text, Title){
- window.showMessageDialog(null, Text, Title, window.ERROR_MESSAGE);
- }
- function sendCommand(Command) {
- func.sendCommand(func.var1, Command);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement