Discussion in   Coding Corner   started     7 years ago   March 26, 2017, 11:54:42 AM   by   Espcevan

Decent little Mining Macro

Espcevan
Offline
1 Posts
Topic :   Decent little Mining Macro
7 years ago  March 26, 2017, 11:54:42 AM

I found a couple Mining Macros for UOSteam that worked alright for what they were made for. I decided to piece a few of them together with some of my own stuff.


What this macro does, is Mines the location directly in front of you until it has no more ore. After that it goes threw your backpack checking if you have ore to smelt and smelts it on a portable forge for you and stops the macro




How To Use -
When you hit play, It will ask you to target your portable forge.
Make sure you are facing a minable location.
After it mines out the location And smelts the ore it will stop on its own.
Simple as that.


I put this macro on a hotkey and use it wait until its done then I move on by myself and start over.


Code: [Select]
//Make SURE you have a portable forge on you...
if not @findalias 'mobile forge'   promptalias 'mobile forge'
endif
if @findtype '0xf39' 'any' 'backpack' 'any' '2'
  @usetype '0xf39' '0'  'backpack' '1' 1
elseif @findtype '0xe86' 'any' 'backpack' 'any' '2'
  @usetype '0xe86' 'any' 'backpack' 'any' '2'
endif
waitfortarget 5000
if direction == 0
  targettileoffset 0 -1 0
elseif direction == 1
  targettileoffset 1 -1 0
elseif direction == 2
  targettileoffset 1 0 0
elseif direction == 3
  targettileoffset 1 1 0
elseif direction == 4
  targettileoffset 0 1 0
elseif direction == 5
  targettileoffset -1 1 0
elseif direction == 6
  targettileoffset -1 0 0
elseif direction == 7
  targettileoffset -1 -1 0
else
  headmsg 'No Tools Found!'
endif
pause 600
if @injournal 'no metal' 'system'
  headmsg 'No More Ore Here'
  pause 1000
  headmsg 'Smelting Ore'
  @clearjournal
  while @findtype '0x19b9' 'any' 'backpack' '1' '2'
    @usetype 0x19b9
    waitfortarget 750
    target! 'mobile forge'
    cleartargetqueue
  endwhile
  while @findtype '0x19b8' 'any' 'backpack' '1' '2'
    @usetype 0x19b8
    waitfortarget 750
    target! 'mobile forge'
    cleartargetqueue
  endwhile
  while @findtype '0x19b7' 'any' 'backpack' '2' '2'
    @usetype 0x19b7
    waitfortarget 750
    target! 'mobile forge'
    cleartargetqueue
  endwhile
  while @findtype '0x19ba' 'any' 'backpack' '1' '2'
    @usetype 0x19ba
    waitfortarget 750
    target! 'mobile forge'
    cleartargetqueue
  endwhile
  headmsg 'Mining and Smelting Finished!'
  stop
endif




If you have any problems or just like this, Leave a comment!
Thank you