Discussion in   Tutorials   started     10 years ago   March 21, 2014, 11:45:25 PM   by   Oslin

Mining Script

Oslin
Offline
4 Posts
Topic :   Mining Script
10 years ago  March 21, 2014, 11:45:25 PM

Here is a little Macro for Mining      you will need shovels and a portable forge   (orc forge will work) and mining keys


it will mine the cave floor  (sorry no mountain sides) smelt the ore and place the ingot into you mining keys for you.


I does not move you around  but it does tell you when it time to find more ore   


in steam go to macros make new  copy paste the macro


Enjoy


if not @findalias 'mobile forge'
  promptalias 'mobile forge'
endif
while weight <= 481
  usetype 0xf39
  waitfortarget 750
  targettileoffset 0 0 0
  pause 750
  if @injournal 'no metal' 'system'
    @clearjournal
    for 3
      @usetype 0x19b9
      waitfortarget 750
      target! 'mobile forge'
      @usetype 0x19b8
      waitfortarget 750
      target! 'mobile forge'
      @usetype 0x19b7
      waitfortarget 750
      target! 'mobile forge'
      @usetype 0x19ba
      waitfortarget 750
      target! 'mobile forge'
    endfor
    usetype 0x1be8
    waitforgump 0x6abce12 1000
    replygump 0x6abce12 31
    waitforgump 0x6abce12 1000
    replygump 0x6abce12 0
    headmsg 'No more ore here. Smelting complete!'
    stop
  endif
endwhile
for 3
  @usetype 0x19b9
  waitfortarget 750
  target!

Topknot
Offline
1 Posts
#1 Re :   Mining Script
10 years ago  March 22, 2014, 09:17:52 PM

nice macro thx :)

Rael
Offline
4 Posts
#2 Re :   Mining Script
10 years ago  March 24, 2014, 09:26:01 AM

Thanks Oslin... Can't wait to give this a try!!!

Kenandan
Offline
3 Posts
#3 Re :   Mining Script
10 years ago  March 29, 2014, 03:16:47 AM

Love the use of the keys. I am stealing this, as it is way cleaner then mine.

For mining on the side of a mountain:

Change:

waitfortarget 750
  targettileoffset 0 0 0
  pause 750

To:

waitfortarget 750
 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
endif
pause 750

This will change the macro from mining directly under your feet, to mining 1 space front of your character that it is facing. So if your facing north, it will mine north. West/west, etc.

I don't know if its possible to make it cleaner.

Rael
Offline
4 Posts
#4 Re :   Mining Script
10 years ago  March 30, 2014, 08:40:56 AM

Oslin made a couple changes, ignored a couple lines of the code, to my (his) cave floor mining script which eliminated the error and need for me to retarget my forge. I think I will setup another macro with your changes Kenandan to mine the sides. Thanks guys!