Advertisement
lambdaCraft

mc-miner

Jan 18th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.81 KB | None | 0 0
  1. --lua
  2. os.loadAPI('rc/api') ; for k , v in pairs(api) do loadstring(string.format("%s = api.%s" , k , k))() end ;
  3.  
  4. slots = {
  5.     [1] = {fuel} ;
  6.     [2] = {stuff-1} ;
  7.     [3] = {...} ;
  8. } ;
  9. slot.checkList(slots , 2) ;
  10.  
  11. miner = function(slots , forwardDis , digDis)
  12.     workMode.destroy = true ;
  13.     workMode.force = true ;
  14.     workMode.tryTime = 30 ;
  15.     link(scan('f' , forwardDis) , digExcept(slots , digDis)) ;
  16.     status.turnTo('f') ;
  17.     slot.packUpAll() ;
  18. end ;
  19.  
  20. args = {...} ;
  21. if #args < 1 or #args > 3 then
  22.     print("useage: smartMiner slots [forwardDis] [digDis]") ;
  23. else
  24.     for k , v in ipairs(args) do
  25.         args[k] = tonumber(v) ;
  26.     end ;
  27.     if #args == 1 then
  28.         miner(args[1] , 100 , 10) ;
  29.     elseif #args == 2 then
  30.         miner(args[1] , args[2] , 10) ;
  31.     elseif #args == 3 then
  32.         miner(args[1] , args[2] , args[3]) ;
  33.     end ;
  34. end ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement