Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.58 KB | None | 0 0
  1. //Smelt by Vlek, Grunt of the Bloodclan
  2. //Press associated button and it will combine all like-colored ore
  3. //and then either smelt if there is a forge within range or
  4. //will move the ore two tiles in front of the player based on facing direction
  5. if not listexists 'orecolors'
  6. createlist 'orecolors'
  7. pushlist 'orecolors' 0x0 //Iron
  8. pushlist 'orecolors' 0x973 //Dull Copper
  9. pushlist 'orecolors' 0x966 //Shadow Iron
  10. pushlist 'orecolors' 0x96D //Copper
  11. pushlist 'orecolors' 0x972 //Bronze
  12. pushlist 'orecolors' 0x8A5 //Golden
  13. pushlist 'orecolors' 0x979 //Agapite
  14. pushlist 'orecolors' 0x89F //Verite
  15. pushlist 'orecolors' 0x8AB //Valorite
  16. endif
  17. if not listexists 'oretypes'
  18. createlist 'oretypes'
  19. pushlist 'oretypes' 0x19b9 //large
  20. pushlist 'oretypes' 0x19ba //large2
  21. pushlist 'oretypes' 0x19b8 //medium
  22. pushlist 'oretypes' 0x19b7 //small
  23. endif
  24. if not listexists 'combinetypes'
  25. createlist 'combinetypes'
  26. pushlist 'combinetypes' 0x19b7 //small
  27. pushlist 'combinetypes' 0x19b8 //medium
  28. pushlist 'combinetypes' 0x19ba //large2
  29. pushlist 'oretypes' 0x19b9 //large
  30. endif
  31. if not listexists 'forgetypes'
  32. createlist 'forgetypes'
  33. pushlist 'forgetypes' 0xfb1 //Small Forge
  34. pushlist 'forgetypes' 0x1996 //long mid east
  35. pushlist 'forgetypes' 0x198a //right billow east
  36. pushlist 'forgetypes' 0x1992 //left billow east
  37. pushlist 'forgetypes' 0x19a2 //long mid north
  38. pushlist 'forgetypes' 0x199e //right billow north
  39. pushlist 'forgetypes' 0x197e //left billow north
  40. endif
  41. //Combining ore piles with like colors in sane way
  42. @clearignorelist
  43. for 0 in 'orecolors'
  44. for 0 in 'oretypes'
  45. while @findtype oretypes[] orecolors[] 'backpack' 1 2 or @findtype oretypes[] orecolors[] 'ground' 1 2
  46. @setalias 'ore' 'found'
  47. @ignoreobject 'ore'
  48. for 0 in 'combinetypes'
  49. if @findtype combinetypes[] orecolors[] 'ground' 1 2 or @findtype combinetypes[] orecolors[] 'backpack' 1 2
  50. @setalias 'targetore' 'found'
  51. if @findobject 'ore' 'any' 'ground'
  52. @useobject 'targetore'
  53. waitfortarget 15000
  54. target! 'ore'
  55. else
  56. @useobject 'ore'
  57. waitfortarget 15000
  58. target! 'targetore'
  59. endif
  60. break
  61. endif
  62. endfor
  63. endwhile
  64. endfor
  65. endfor
  66. //Smelting
  67. @clearignorelist
  68. for 0 in 'forgetypes'
  69. if @findtype forgetypes[] 'any' 'ground' 1 2
  70. @setalias 'forge' 'found'
  71. for 0 in 'oretypes'
  72. while @findtype oretypes[] 'any' 'ground' 1 2 or @findtype oretypes[] 'any' 'backpack' 1 2
  73. @useobject 'found'
  74. waitfortarget 15000
  75. target! 'forge'
  76. pause 500
  77. endwhile
  78. endfor
  79. break
  80. endif
  81. endfor
  82. //Shuffle Ore
  83. for 0 in 'oretypes'
  84. while @findtype oretypes[] 'any' 'backpack' or @findtype oretypes[] 'any' 'ground' 1 2
  85. //Make these only move them if they're not already there!
  86. if direction == 0
  87. moveitemoffset 'found' 'ground' 0 -2 0
  88. elseif direction == 1
  89. moveitemoffset 'found' 'ground' 2 -2 0
  90. elseif direction == 2
  91. moveitemoffset 'found' 'ground' 2 0 0
  92. elseif direction == 3
  93. moveitemoffset 'found' 'ground' 2 2 0
  94. elseif direction == 4
  95. moveitemoffset 'found' 'ground' 0 2 0
  96. elseif direction == 5
  97. moveitemoffset 'found' 'ground' -2 2 0
  98. elseif direction == 6
  99. moveitemoffset 'found' 'ground' -2 0 0
  100. elseif direction == 7
  101. moveitemoffset 'found' 'ground' -2 -2 0
  102. endif
  103. @ignoreobject 'found'
  104. if @findobject 'found' 'any' 'backpack'
  105. stop
  106. endif
  107. endwhile
  108. endfor
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement