Advertisement
Guest User

Untitled

a guest
Aug 28th, 2015
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. import("util.command");
  2. import("util.callAsync");
  3. import("chat.tellraw");
  4.  
  5. init();
  6.  
  7. function init()
  8. {
  9. command("kill @e[type=ArmorStand,name=!validate]");
  10. command("summon ArmorStand -1 10 0 {CustomName:cursor,NoGravity:true}");
  11. command("scoreboard players set @e[type=ArmorStand,name=cursor] stdInteger 0");
  12. command("stats entity @e[type=ArmorStand,name=cursor] set SuccessCount @e[type=ArmorStand,name=cursor] stdInteger");
  13. int arg;
  14. main();
  15. }
  16.  
  17. function main()
  18. {
  19. isCmd("set", function()
  20. {
  21. parseArg(function()
  22. {
  23. int variable = arg;
  24. });
  25. });
  26. isCmd("out", function()
  27. {
  28. tellraw(variable);
  29. });
  30. }
  31.  
  32. function parseArg(delegate callback)
  33. {
  34. arg = -1;
  35. static for(static int i = 0; i <= 3; i++)
  36. {
  37. command("execute @e[type=ArmorStand,name=cursor] ~ ~ ~ testforblock ~ ~ ~ minecraft:wall_sign -1 {Text2:\\"\\\\\"{0}\\\\\"\\"}".format(i)); //"
  38. command("execute @e[type=ArmorStand,name=cursor,score_stdInteger_min=1] ~ ~ ~ scoreboard players set arg stdInteger {0}".format(i));
  39. }
  40. callback();
  41. }
  42.  
  43. function isCmd(string label, delegate callback)
  44. {
  45. async if("execute @e[type=ArmorStand,name=cursor] ~ ~ ~ testforblock ~ ~ ~ minecraft:wall_sign -1 {Text1:\\"\\\\\"{0}\\\\\"\\"}".format(label)) //"
  46. {
  47. callback();
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement