Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.62 KB | None | 0 0
  1. -- Configuration --
  2. GATHER = {}
  3. OPEN_BAGS = true
  4. AUTO_DELETE = {}
  5. DISPLAY_FIGHT_COUNT = true
  6. MIN_MONSTERS = 1
  7. MAX_MONSTERS = 8
  8. -- Function GatherFight --
  9. function GatherFight()
  10. for index, actualMap in pairs(mapsWithChangeMap) do
  11. if (map:onMap(actualMap.map)) then
  12. if actualMap.gather and actualMap.fight then
  13. return "both"
  14. elseif actualMap.gather then
  15. return "gather"
  16. elseif actualMap.forcegather then
  17. return "forcegather"
  18. elseif actualMap.fight then
  19. return "fight"
  20. elseif actualMap.forcefight then
  21. return "forcefight"
  22. end
  23. return "path"
  24. end
  25. end
  26. return false
  27. end
  28. -- Function move --
  29. function move()
  30.  
  31. if GatherFight() == "both" then
  32. return {
  33. {map = map:currentMap(), custom = processMap, gather = true, fight = true}
  34. }
  35. elseif GatherFight() == "gather" then
  36. return {
  37. {map = map:currentMap(), custom = processMap, gather = true}
  38. }
  39. elseif GatherFight() == "forcegather" then
  40. return {
  41. {map = map:currentMap(), custom = processMap, forcegather = true}
  42. }
  43. elseif GatherFight() == "fight" then
  44. return {
  45. {map = map:currentMap(), custom = processMap, fight = true}
  46. }
  47. elseif GatherFight() == "forcefight" then
  48. return {
  49. {map = map:currentMap(), custom = processMap, forcefight = true}
  50. }
  51. elseif GatherFight() == "path" then
  52. return {
  53. {map = map:currentMap(), custom = processMap}
  54. }
  55. else
  56. global:printError("Aucune action sur la map : " .. map:currentMap() .. " | mapID : " .. map:currentMapId())
  57. global:disconnect()
  58. end
  59. end
  60. -- mapsWithChangeMap --
  61. mapsWithChangeMap = {
  62. -- Mine Brakmar --
  63. { map = "10228", path = {"448"}, gather = true },
  64. { map = "10227", path = {"44","448"}, gather = true },
  65. { map = "10229", path = {"44"}, gather = true },
  66. ---------------------
  67. -- Mine Amakna Donjon Larve --
  68. { map = "1052", path = {"177"}, gather = true },
  69. { map = "1051", path = {"222","448"}, gather = true },
  70. { map = "10229", path = {"44"}, gather = true },
  71. ---------------------
  72. -- Mine Astrub --
  73. { map = "7599", path = {"169"}, gather = false },
  74. { map = "7600", path = {"140"}, gather = true },
  75. { map = "7603", path = {"128","366"}, gather = true },
  76. { map = "7604", path = {"55","408"}, gather = true },
  77. { map = "7605", path = {"456"}, gather = true },
  78. ---------------------
  79. -- Mine Amakna Sadida --
  80. { map = "1015", path = {"140"}, gather = true }, -- enlever la cellule 209 pour éviter de monter --
  81. { map = "1018", path = {"222","227","372"}, gather = true },
  82. { map = "1019", path = {"222","227","372"}, gather = true },
  83. { map = "1031", path = {"372"}, gather = true },
  84. { map = "1025", path = {"367"}, gather = true },
  85. { map = "1026", path = {"367"}, gather = true },
  86. { map = "1036", path = {"156","409"}, gather = true },
  87. { map = "1023", path = {"222","227","367"}, gather = true },
  88. { map = "1020", path = {"222","227","372"}, gather = true },
  89. { map = "1021", path = {"222","227","372"}, gather = true },
  90. { map = "1032", path = {"372"}, gather = true },
  91. { map = "1027", path = {"367"}, gather = true },
  92. { map = "1028", path = {"367"}, gather = true },
  93. { map = "1062", path = {"156","409"}, gather = true },
  94. { map = "1024", path = {"222","227","367"}, gather = true },
  95. { map = "1034", path = {"177","417"}, gather = true },
  96. { map = "1022", path = {"222","227","372"}, gather = true },
  97. { map = "1033", path = {"372"}, gather = true },
  98. { map = "1030", path = {"367"}, gather = true },
  99. { map = "1038", path = {"156","409"}, gather = true },
  100. { map = "1029", path = {"367"}, gather = true },
  101. }
  102. ---------------------
  103. -- Function processMap --
  104. function processMap()
  105. for index, actualMap in pairs(mapsWithChangeMap) do
  106. if (map:onMap(actualMap.map)) then
  107. if (type(actualMap.path) == "table") then
  108. if (not actualMap.toggle) then
  109. actualMap.toggle = {}
  110. for i = 1, #(actualMap.path) do
  111. table.insert(actualMap.toggle, false)
  112. end
  113. else
  114. toggleTemp = false
  115. for i = 1, #(actualMap.toggle) do
  116. toggleTemp = actualMap.toggle[i]
  117. end
  118. if (toggleTemp) then
  119. for i = 1, #(actualMap.toggle) do
  120. actualMap.toggle[i] = false
  121. end
  122. end
  123. end
  124. for i, action in pairs(actualMap.path) do
  125. if (not actualMap.toggle[i]) then
  126. if (type(action) == "string") then
  127. actualMap.toggle[i] = true
  128. return map:changeMap(action)
  129. elseif (type(action) == "number") then
  130. actualMap.toggle[i] = true
  131. return map:door(action)
  132. elseif (type(action) == "function") then
  133. actualMap.toggle[i] = true
  134. return action()
  135. end
  136. end
  137. end
  138. else
  139. if (actualMap.path) then
  140. return map:changeMap(actualMap.path)
  141. elseif (actualMap.door) then
  142. if (type(actualMap.door) == "string") then
  143. return map:door(tonumber(actualMap.door))
  144. elseif (type(actualMap.door) == "number") then
  145. return map:door(actualMap.door)
  146. end
  147. elseif (actualMap.custom) then
  148. return actualMap.custom()
  149. end
  150. end
  151. end
  152. end
  153. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement