Advertisement
Sanwi

Customizable Crafting

Jul 29th, 2014
716
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. $${
  2. UNSAFE(0);
  3.  
  4. #wait = 300
  5.  
  6. PROMPT(&amount,"$$?","How many do you want to make?",true,"1")
  7.  
  8. // The crafting bench is arranged like this:
  9. // [1] [2] [3]
  10. // [4] [5] [6]
  11. // [7] [8] [9]
  12.  
  13. PROMPT(@&recipe_prompt,"$$?","Input a recipe. Recipes are split into horizontal rows. Use 'blank' to leave the slot blank. Hit escape to use the last recipe input.",true,"%@&recipe_prompt%")
  14.  
  15. &default_item = "cobblestone"
  16. &recipe_items[] = split(" ","%@&recipe_prompt%")
  17.  
  18. arraysize(&recipe_items,#recipesize)
  19.  
  20. log("%@&recipe_prompt%")
  21.  
  22. key(use);
  23. wait(500ms);
  24.  
  25. // Make items
  26. for(#for,1,%&amount%);
  27. // Crafting grid
  28. for(#forcraft,0,%#recipesize%);
  29. // If item cued
  30. if(%&recipe_items[%#forcraft%]% != "blank");
  31. // Search for items
  32. for(#forsearch,10,45);
  33. getslot(%&recipe_items[%#forcraft%]%,#stackslot,10);
  34. getslotitem(%#stackslot%,&id,#stacksize);
  35. if("%&id%" = "%&recipe_items[%#forcraft%]%");
  36. // Pick up item
  37. log("Found %&recipe_items[%#forcraft%]%");
  38. slotclick(%#stackslot%);
  39. wait(50ms);
  40. break();
  41. endif;
  42. next;
  43. // Place item in crafting grid
  44. #current_craft_slot = (%#forcraft%) + (1)
  45. slotclick(%#current_craft_slot%);
  46. wait(%#wait%ms);
  47. endif;
  48. next;
  49. // Pick created items
  50. slotclick(0,1,true);
  51. next;
  52.  
  53. gui();
  54.  
  55. ENDUNSAFE;
  56. stop();
  57. }$$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement