fork download
  1. local Objects = {435, 1948, 7771}
  2. local Doors = {7727, 8265, 1629, 1632, 8266, 7728, 1211, 1220, 1224, 1228, 1233, 1238, 1242, 1246, 1251, 1256, 1260, 1540, 3546, 3548, 3550, 3552, 4915, 5083, 5109, 5111, 5113, 5115, 5127, 5129, 5131,
  3. 5133, 5142, 5145, 5283, 5285, 5289, 5293, 5516, 5737, 5749, 6194, 6199, 6203, 6207, 6251, 6256, 6260, 6264, 6798, 6802, 6902, 6904, 6906, 6908, 7044,
  4. 7046, 7048, 7050, 7055, 8543, 8548, 8552, 8556, 9167, 9172, 9269, 9274, 9274, 9269, 9278, 9282, 10270, 10275, 10279, 10283, 10479, 10481, 10485, 10483,
  5. 10786, 12101, 12199, 19851, 19853, 19991, 19993, 20284, 20286, 17238, 13021, 10790, 12103, 12205, 19855, 19995, 20288, 10792, 12105, 12203, 19857, 19997,
  6. 20290, 22825, 22827, 22829, 22831, 1214, 1222, 1226, 1230, 1236, 1240, 1244, 1248, 1254, 1258, 1262, 1542, 3537, 3539, 3541, 3543, 4918, 5085, 5100, 5102, 5104, 5106, 5118,
  7. 5120, 5122, 5124, 5136, 5139, 5280, 5287, 5291, 5295, 5518, 5734, 5746, 6197, 6201, 6205, 6209, 6254, 6258, 6262, 6266, 6796, 6800, 6893,
  8. 6895, 6897, 6899, 7035, 7037, 7039, 7041, 7057, 8546, 8550, 8554, 8558, 9170, 9174, 9272, 9276, 9280, 9284, 10273, 10277, 10281, 10285,
  9. 10470, 10472, 10476, 10474, 10777, 12094, 12190, 19842, 19844, 19982, 19984, 20275, 20277, 17236, 18209, 13023, 10781, 12096, 12196,
  10. 19846, 19986, 20279, 10783, 12098, 12194, 19848, 19988, 20281, 22816, 22818, 22820, 22822, 1224, 1226, 1228, 1230, 1242, 1244, 1246, 1248, 1256, 1258, 1260, 1262, 3541, 3543, 3550, 3552, 5104, 5106, 5113, 5115, 5122, 5124, 5131, 5133,
  11. 5289, 5291, 5293, 5295, 6203, 6205, 6207, 6209, 6260, 6262, 6264, 6266, 6897, 6899, 6906, 6908, 7039, 7041, 7048, 7050, 8552, 8554, 8556, 8558,
  12. 9176, 9178, 9180, 9182, 9278, 9280, 9282, 9284, 10279, 10281, 10283, 10285, 10474, 10476, 10483, 10485, 10781, 12096, 12196, 19846, 19986, 20279,
  13. 10783, 12098, 12194, 19848, 19988, 20281, 10790, 12103, 12205, 19855, 19995, 20288, 10792, 12105, 12203, 19857, 19997, 20290, 1223, 1225, 1241, 1243, 1255, 1257, 3542, 3551, 5105, 5114, 5123, 5132, 5288, 5290, 5745, 5748, 6202, 6204, 6259, 6261, 6898, 6907, 7040, 7049,
  14. 8551, 8553, 9175,9177, 9277, 9279, 10278, 10280, 10475, 10484, 10782, 12097, 19847, 19987, 20280, 10791, 12104, 12204, 12195, 19856, 19996, 20289,
  15. 22821, 22830, 1227, 1229, 1245, 1247, 1259, 1261, 3540, 3549, 5103, 5112, 5121, 5130, 5292, 5294, 6206, 6208, 6263, 6265, 6896, 6905, 7038, 7047, 8555, 8557,9179, 9181,
  16. 9281, 9283, 10282, 10284, 10473, 10482, 10780, 10789, 10780, 12095, 12195, 19845, 19985, 20278, 10789, 12102, 12193, 12202, 19854, 19994, 20287}
  17. followName = "Name"
  18. if not storage[followName] then storage[followName] = { player = 'name'} end
  19. local toFollowPos = {}
  20.  
  21. UI.Separator()
  22. UI.Label("Auto Follow")
  23.  
  24. followTE = UI.TextEdit(storage[followName].player or "name", function(widget, newText)
  25. storage[followName].player = newText
  26. end)
  27.  
  28. local followChange = macro(200, "Follow Change", function() end)
  29. local followMacro = macro(20, "Follow", function()
  30. local position = pos()
  31. local target = getCreatureByName(storage[followName].player)
  32. if target then
  33. local tpos = target:getPosition()
  34. toFollowPos[tpos.z] = tpos
  35. end
  36. if not player:isWalking() and target and (getDistanceBetween(pos(), target:getPosition()) >2) then
  37. for i,interact in ipairs(Doors) do
  38. if (player:getDirection() == 1 or player:getDirection() == 3) then
  39. for x=-1,2,2 do
  40. position["x"] = posx() + x
  41. position["y"] = posy()
  42. for y=-1,3,2 do
  43. if g_map.getTile(position) then
  44. for u,item in ipairs(g_map.getTile(position):getItems()) do
  45. if item:getId() == interact then
  46. g_game.use(item)
  47. return
  48. end
  49. end
  50. position["y"] = posy()+y
  51. end
  52. end
  53. end
  54. end
  55. position = pos()
  56. if (player:getDirection() == 0 or player:getDirection() == 2) then
  57. for y=-1,2,2 do
  58. position["x"] = posx()
  59. position["y"] = posy()+y
  60. for x=-1,3,2 do
  61. for u,item in ipairs(g_map.getTile(position):getItems()) do
  62. if item:getId() == interact then
  63. g_game.use(item)
  64. return
  65. end
  66. end
  67. position["x"] = posx()+x
  68. end
  69. end
  70. end
  71. position = pos()
  72. end
  73. elseif not player:isWalking() and not target and toFollowPos[posz()] then
  74. for i,interact in ipairs(Objects) do
  75. for x=-1,2,1 do
  76. for y=-1,2,1 do
  77. position["x"] = toFollowPos[posz()].x + x
  78. position["y"] = toFollowPos[posz()].y + y
  79. if getDistanceBetween(pos(), position) <= 8 and g_map.getTile(position) then
  80. for u,item in ipairs(g_map.getTile(position):getItems()) do
  81. if item:getId() == interact then
  82. g_game.use(item)
  83. delay(500)
  84. end
  85. end
  86. end
  87. end
  88. end
  89. end
  90. end
  91. local p = toFollowPos[posz()]
  92. if not p then return end
  93. if autoWalk(p, 20, { ignoreNonPathable = true, precision = 1}) then delay(100) end
  94. end)
  95. UI.Separator()
  96. onPlayerPositionChange(function(newPos, oldPos)
  97. if followChange:isOff() then return end
  98. if (g_game.isFollowing()) then
  99. tfollow = g_game.getFollowingCreature()
  100.  
  101. if tfollow then
  102. if tfollow:getName() ~= storage[followName].player then
  103. followTE:setText(tfollow:getName())
  104. storage[followName].player = tfollow:getName()
  105. end
  106. end
  107. end
  108. end)
  109.  
  110. onCreaturePositionChange(function(creature, newPos, oldPos)
  111. if creature:getName() == storage[followName].player and newPos then
  112. toFollowPos[newPos.z] = newPos
  113. end
  114. end)
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class, interface, or enum expected
local Objects = {435, 1948, 7771}
^
Main.java:18: error: unclosed character literal
if not storage[followName] then storage[followName] = { player = 'name'} end
                                                                 ^
Main.java:18: error: unclosed character literal
if not storage[followName] then storage[followName] = { player = 'name'} end
                                                                      ^
3 errors
stdout
Standard output is empty