Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. local walk_button = modules.game_luniabot.walkButton;
  2.  
  3. function hasEffect(tile, effect)
  4. for i, fx in ipairs(tile:getEffects()) do
  5. if fx:getId() == effect then
  6. return true
  7. end
  8. end
  9. return false
  10. end
  11.  
  12. macro(500, "Collect essences", function()
  13. for _, tile in pairs(g_map.getTiles(posz())) do
  14. if (hasEffect(tile, 56)) then
  15. walk_button:setChecked(false);
  16. autoWalk(tile:getPosition(), 100, { ignoreNonPathable = true });
  17. schedule(2000, function() walk_button:setChecked(true); end);
  18. end
  19. end
  20. end, toolsTab)
  21.  
  22. onAddThing(function(tile, thing)
  23. if thing:isItem() and thing:getId() == 2129 then
  24. local pos = tile:getPosition().x .. "," .. tile:getPosition().y .. "," .. tile:getPosition().z
  25. if not storage[pos] or storage[pos] < now then
  26. storage[pos] = now + 20000
  27. end
  28. tile:setTimer(storage[pos] - now)
  29. end
  30. end)
  31.  
  32. macro(200, "Open monsterboxes", function()
  33. for i, tile in ipairs(g_map.getTiles(posz())) do
  34. for u,item in ipairs(tile:getItems()) do
  35. if (item and item:getId() == 9586) then
  36. walk_button:setChecked(false);
  37. g_game.use(item)
  38. schedule(2000, function() walk_button:setChecked(true); end);
  39. return
  40. end
  41. end
  42. end
  43. end)
  44.  
  45. macro(1000, "Collect monsterflames", function()
  46. for i, tile in ipairs(g_map.getTiles(posz())) do
  47. for u,item in ipairs(tile:getItems()) do
  48. if (item:getId() == 21463) then
  49. walk_button:setChecked(false);
  50. autoWalk(tile:getPosition(), 100, {ignoreNonPathable = true})
  51. schedule(2000, function() walk_button:setChecked(true); end);
  52. end
  53. end
  54. end
  55. end)
  56.  
  57. macro(1000, "Enter Invasion Portals", function()
  58. for i, tile in ipairs(g_map.getTiles(posz())) do
  59. for u,item in ipairs(tile:getItems()) do
  60. if (item:getId() == 25058) then
  61. walk_button:setChecked(false);
  62. autoWalk(tile:getPosition(), 100, {ignoreNonPathable = true})
  63. schedule(3000, function() walk_button:setChecked(true); end);
  64. end
  65. end
  66. end
  67. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement