Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Smelt by Vlek, Grunt of the Bloodclan
- //Press associated button and it will combine all like-colored ore
- //and then either smelt if there is a forge within range or
- //will move the ore two tiles in front of the player based on facing direction
- if not listexists 'orecolors'
- createlist 'orecolors'
- pushlist 'orecolors' 0x0 //Iron
- pushlist 'orecolors' 0x973 //Dull Copper
- pushlist 'orecolors' 0x966 //Shadow Iron
- pushlist 'orecolors' 0x96D //Copper
- pushlist 'orecolors' 0x972 //Bronze
- pushlist 'orecolors' 0x8A5 //Golden
- pushlist 'orecolors' 0x979 //Agapite
- pushlist 'orecolors' 0x89F //Verite
- pushlist 'orecolors' 0x8AB //Valorite
- endif
- if not listexists 'oretypes'
- createlist 'oretypes'
- pushlist 'oretypes' 0x19b9 //large
- pushlist 'oretypes' 0x19ba //large2
- pushlist 'oretypes' 0x19b8 //medium
- pushlist 'oretypes' 0x19b7 //small
- endif
- if not listexists 'combinetypes'
- createlist 'combinetypes'
- pushlist 'combinetypes' 0x19b7 //small
- pushlist 'combinetypes' 0x19b8 //medium
- pushlist 'combinetypes' 0x19ba //large2
- pushlist 'oretypes' 0x19b9 //large
- endif
- if not listexists 'forgetypes'
- createlist 'forgetypes'
- pushlist 'forgetypes' 0xfb1 //Small Forge
- pushlist 'forgetypes' 0x1996 //long mid east
- pushlist 'forgetypes' 0x198a //right billow east
- pushlist 'forgetypes' 0x1992 //left billow east
- pushlist 'forgetypes' 0x19a2 //long mid north
- pushlist 'forgetypes' 0x199e //right billow north
- pushlist 'forgetypes' 0x197e //left billow north
- endif
- //Combining ore piles with like colors in sane way
- @clearignorelist
- for 0 in 'orecolors'
- for 0 in 'oretypes'
- while @findtype oretypes[] orecolors[] 'backpack' 1 2 or @findtype oretypes[] orecolors[] 'ground' 1 2
- @setalias 'ore' 'found'
- @ignoreobject 'ore'
- for 0 in 'combinetypes'
- if @findtype combinetypes[] orecolors[] 'ground' 1 2 or @findtype combinetypes[] orecolors[] 'backpack' 1 2
- @setalias 'targetore' 'found'
- if @findobject 'ore' 'any' 'ground'
- @useobject 'targetore'
- waitfortarget 15000
- target! 'ore'
- else
- @useobject 'ore'
- waitfortarget 15000
- target! 'targetore'
- endif
- break
- endif
- endfor
- endwhile
- endfor
- endfor
- //Smelting
- @clearignorelist
- for 0 in 'forgetypes'
- if @findtype forgetypes[] 'any' 'ground' 1 2
- @setalias 'forge' 'found'
- for 0 in 'oretypes'
- while @findtype oretypes[] 'any' 'ground' 1 2 or @findtype oretypes[] 'any' 'backpack' 1 2
- @useobject 'found'
- waitfortarget 15000
- target! 'forge'
- pause 500
- endwhile
- endfor
- break
- endif
- endfor
- //Shuffle Ore
- for 0 in 'oretypes'
- while @findtype oretypes[] 'any' 'backpack' or @findtype oretypes[] 'any' 'ground' 1 2
- //Make these only move them if they're not already there!
- if direction == 0
- moveitemoffset 'found' 'ground' 0 -2 0
- elseif direction == 1
- moveitemoffset 'found' 'ground' 2 -2 0
- elseif direction == 2
- moveitemoffset 'found' 'ground' 2 0 0
- elseif direction == 3
- moveitemoffset 'found' 'ground' 2 2 0
- elseif direction == 4
- moveitemoffset 'found' 'ground' 0 2 0
- elseif direction == 5
- moveitemoffset 'found' 'ground' -2 2 0
- elseif direction == 6
- moveitemoffset 'found' 'ground' -2 0 0
- elseif direction == 7
- moveitemoffset 'found' 'ground' -2 -2 0
- endif
- @ignoreobject 'found'
- if @findobject 'found' 'any' 'backpack'
- stop
- endif
- endwhile
- endfor
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement