diff --git a/data/minimap.otmm b/data/minimap.otmm deleted file mode 100644 index 1dd2be4..0000000 Binary files a/data/minimap.otmm and /dev/null differ diff --git a/modules/client_profiles/profiles.otmod b/modules/client_profiles/profiles.otmod index 1cc012c..d14a6b7 100644 --- a/modules/client_profiles/profiles.otmod +++ b/modules/client_profiles/profiles.otmod @@ -1,6 +1,6 @@ Module name: client_profiles - description: Provides option to save client customizations into separate profiles + description: Client profiles author: Vithrax discord: Vithrax#5814 autoload: true diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/version.txt b/modules/game_bot/default_configs/vBot_4.4/vBot/version.txt deleted file mode 100644 index d54b7c3..0000000 --- a/modules/game_bot/default_configs/vBot_4.4/vBot/version.txt +++ /dev/null @@ -1 +0,0 @@ -4.4,2e01326d0a \ No newline at end of file diff --git a/modules/game_bot/default_configs/vBot_4.4/_Loader.lua b/modules/game_bot/default_configs/vBot_4.41/_Loader.lua similarity index 95% rename from modules/game_bot/default_configs/vBot_4.4/_Loader.lua rename to modules/game_bot/default_configs/vBot_4.41/_Loader.lua index b13e3c8..bb90908 100644 --- a/modules/game_bot/default_configs/vBot_4.4/_Loader.lua +++ b/modules/game_bot/default_configs/vBot_4.41/_Loader.lua @@ -31,7 +31,7 @@ local luaFiles = { "pushmax", "combo", "HealBot", - "new healer", + "new_healer", "AttackBot", -- last of major modules "ingame_editor", "Dropper", @@ -50,7 +50,8 @@ local luaFiles = { "depositer_config", "npc_talk", "xeno_menu", - "hold_target" + "hold_target", + "cavebot_control_panel" } for i, file in ipairs(luaFiles) do diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/actions.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/actions.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/actions.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/actions.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/bank.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/bank.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/bank.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/bank.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/buy_supplies.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/buy_supplies.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/buy_supplies.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/buy_supplies.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/cavebot.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/cavebot.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/cavebot.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/cavebot.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/cavebot.otui b/modules/game_bot/default_configs/vBot_4.41/cavebot/cavebot.otui similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/cavebot.otui rename to modules/game_bot/default_configs/vBot_4.41/cavebot/cavebot.otui diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/clear_tile.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/clear_tile.lua similarity index 56% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/clear_tile.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/clear_tile.lua index d9b95ae..53b6d68 100644 --- a/modules/game_bot/default_configs/vBot_4.4/cavebot/clear_tile.lua +++ b/modules/game_bot/default_configs/vBot_4.41/cavebot/clear_tile.lua @@ -4,11 +4,21 @@ CaveBot.Extensions.ClearTile.setup = function() CaveBot.registerAction("ClearTile", "#00FFFF", function(value, retries) local data = string.split(value, ",") local pos = {x=tonumber(data[1]), y=tonumber(data[2]), z=tonumber(data[3])} - local doors + local doors = false + local stand = false local pPos = player:getPosition() - if #data == 4 then - doors = true + + + for i, value in ipairs(data) do + value = value:lower():trim() + if value == "stand" then + stand = true + elseif value == "doors" then + doors = true + end end + + if not #pos == 3 then warn("CaveBot[ClearTile]: invalid value. It should be position (x,y,z), is: " .. value) return false @@ -32,8 +42,14 @@ CaveBot.Extensions.ClearTile.setup = function() -- no items on tile and walkability means we are done if tile:isWalkable() and tile:getTopUseThing():isNotMoveable() and not tile:hasCreature() and not doors then - print("CaveBot[ClearTile]: tile clear, proceeding") - return true + if stand then + if not CaveBot.MatchPosition(tPos, 0) then + CaveBot.GoTo(tPos, 0) + return "retry" + end + print("CaveBot[ClearTile]: tile clear, proceeding") + return true + end end if not CaveBot.MatchPosition(tPos, 3) then @@ -42,49 +58,64 @@ CaveBot.Extensions.ClearTile.setup = function() end if retries > 0 then - delay(1500) + delay(1100) end - -- but if not then first check for creatures + -- monster if tile:hasCreature() then local c = tile:getCreatures()[1] if c:isMonster() then attack(c) return "retry" - -- ok here we will find tile to push player, random - elseif c:isPlayer() then - local candidates = {} - for _, tile in ipairs(g_map.getTiles(posz())) do - if getDistanceBetween(c:getPosition(), tile:getPosition()) == 1 and tile:getPosition() ~= pPos and tile:isWalkable(false) then - table.insert(candidates, tile:getPosition()) - end - end - - if #candidates == 0 then - print("CaveBot[ClearTile]: can't find tile to push, cannot clear way, skipping") - return false - else - print("CaveBot[ClearTile]: pushing player... " .. c:getName() .. " out of the way") - local pos = candidates[math.random(1,#candidates)] - local tile = g_map.getTile(pos) - tile:setText("here") - schedule(500, function() tile:setText("") end) - g_game.move(c, pos) - return "retry" - end end end - for i, item in ipairs(tile:getItems()) do - if not item:isNotMoveable() then + + -- moveable item + local item = tile:getTopMoveThing() + if item:isItem() then + if item and not item:isNotMoveable() then print("CaveBot[ClearTile]: moving item... " .. item:getId().. " from tile") g_game.move(item, pPos, item:getCount()) return "retry" - end + end end + + -- player + + -- push creature + if tile:hasCreature() then + local c = tile:getCreatures()[1] + if c and c:isPlayer() then + + local candidates = {} + for _, tile in ipairs(g_map.getTiles(posz())) do + local tPos = tile:getPosition() + if getDistanceBetween(c:getPosition(), tPos) == 1 and tPos ~= pPos and tile:isWalkable() then + table.insert(candidates, tPos) + end + end + + if #candidates == 0 then + print("CaveBot[ClearTile]: can't find tile to push, cannot clear way, skipping") + return false + else + print("CaveBot[ClearTile]: pushing player... " .. c:getName() .. " out of the way") + local pos = candidates[math.random(1,#candidates)] + local tile = g_map.getTile(pos) + tile:setText("here") + schedule(500, function() tile:setText("") end) + g_game.move(c, pos, 1) + return "retry" + end + end + end + + -- doors if doors then use(tile:getTopUseThing()) return "retry" end + return "retry" end) diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/config.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/config.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/config.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/config.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/config.otui b/modules/game_bot/default_configs/vBot_4.41/cavebot/config.otui similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/config.otui rename to modules/game_bot/default_configs/vBot_4.41/cavebot/config.otui diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/d_withdraw.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/d_withdraw.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/d_withdraw.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/d_withdraw.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/depositor.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/depositor.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/depositor.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/depositor.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/doors.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/doors.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/doors.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/doors.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/editor.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/editor.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/editor.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/editor.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/editor.otui b/modules/game_bot/default_configs/vBot_4.41/cavebot/editor.otui similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/editor.otui rename to modules/game_bot/default_configs/vBot_4.41/cavebot/editor.otui diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/example_functions.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/example_functions.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/example_functions.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/example_functions.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/extension_template.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/extension_template.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/extension_template.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/extension_template.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/imbuing.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/imbuing.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/imbuing.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/imbuing.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/inbox_withdraw.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/inbox_withdraw.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/inbox_withdraw.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/inbox_withdraw.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/lure.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/lure.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/lure.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/lure.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/minimap.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/minimap.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/minimap.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/minimap.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/pos_check.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/pos_check.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/pos_check.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/pos_check.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/recorder.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/recorder.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/recorder.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/recorder.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/sell_all.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/sell_all.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/sell_all.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/sell_all.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/supply_check.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/supply_check.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/supply_check.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/supply_check.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/tasker.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/tasker.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/tasker.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/tasker.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/travel.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/travel.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/travel.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/travel.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/walking.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/walking.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/walking.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/walking.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/cavebot/withdraw.lua b/modules/game_bot/default_configs/vBot_4.41/cavebot/withdraw.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/cavebot/withdraw.lua rename to modules/game_bot/default_configs/vBot_4.41/cavebot/withdraw.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/targetbot/creature.lua b/modules/game_bot/default_configs/vBot_4.41/targetbot/creature.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/targetbot/creature.lua rename to modules/game_bot/default_configs/vBot_4.41/targetbot/creature.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/targetbot/creature_attack.lua b/modules/game_bot/default_configs/vBot_4.41/targetbot/creature_attack.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/targetbot/creature_attack.lua rename to modules/game_bot/default_configs/vBot_4.41/targetbot/creature_attack.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/targetbot/creature_editor.lua b/modules/game_bot/default_configs/vBot_4.41/targetbot/creature_editor.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/targetbot/creature_editor.lua rename to modules/game_bot/default_configs/vBot_4.41/targetbot/creature_editor.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/targetbot/creature_editor.otui b/modules/game_bot/default_configs/vBot_4.41/targetbot/creature_editor.otui similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/targetbot/creature_editor.otui rename to modules/game_bot/default_configs/vBot_4.41/targetbot/creature_editor.otui diff --git a/modules/game_bot/default_configs/vBot_4.4/targetbot/creature_priority.lua b/modules/game_bot/default_configs/vBot_4.41/targetbot/creature_priority.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/targetbot/creature_priority.lua rename to modules/game_bot/default_configs/vBot_4.41/targetbot/creature_priority.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/targetbot/looting.lua b/modules/game_bot/default_configs/vBot_4.41/targetbot/looting.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/targetbot/looting.lua rename to modules/game_bot/default_configs/vBot_4.41/targetbot/looting.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/targetbot/looting.otui b/modules/game_bot/default_configs/vBot_4.41/targetbot/looting.otui similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/targetbot/looting.otui rename to modules/game_bot/default_configs/vBot_4.41/targetbot/looting.otui diff --git a/modules/game_bot/default_configs/vBot_4.4/targetbot/target.lua b/modules/game_bot/default_configs/vBot_4.41/targetbot/target.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/targetbot/target.lua rename to modules/game_bot/default_configs/vBot_4.41/targetbot/target.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/targetbot/target.otui b/modules/game_bot/default_configs/vBot_4.41/targetbot/target.otui similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/targetbot/target.otui rename to modules/game_bot/default_configs/vBot_4.41/targetbot/target.otui diff --git a/modules/game_bot/default_configs/vBot_4.4/targetbot/walking.lua b/modules/game_bot/default_configs/vBot_4.41/targetbot/walking.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/targetbot/walking.lua rename to modules/game_bot/default_configs/vBot_4.41/targetbot/walking.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/AttackBot.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/AttackBot.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/AttackBot.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/AttackBot.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/AttackBot.otui b/modules/game_bot/default_configs/vBot_4.41/vBot/AttackBot.otui similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/AttackBot.otui rename to modules/game_bot/default_configs/vBot_4.41/vBot/AttackBot.otui diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/BotServer.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/BotServer.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/BotServer.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/BotServer.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/BotServer.otui b/modules/game_bot/default_configs/vBot_4.41/vBot/BotServer.otui similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/BotServer.otui rename to modules/game_bot/default_configs/vBot_4.41/vBot/BotServer.otui diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/Conditions.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/Conditions.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/Conditions.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/Conditions.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/Conditions.otui b/modules/game_bot/default_configs/vBot_4.41/vBot/Conditions.otui similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/Conditions.otui rename to modules/game_bot/default_configs/vBot_4.41/vBot/Conditions.otui diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/Containers.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/Containers.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/Containers.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/Containers.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/Dropper.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/Dropper.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/Dropper.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/Dropper.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/Equipper.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/Equipper.lua similarity index 99% rename from modules/game_bot/default_configs/vBot_4.4/vBot/Equipper.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/Equipper.lua index c5eb1ee..ea8ec1a 100644 --- a/modules/game_bot/default_configs/vBot_4.4/vBot/Equipper.lua +++ b/modules/game_bot/default_configs/vBot_4.41/vBot/Equipper.lua @@ -448,10 +448,12 @@ inputPanel.addButton.onClick = function() local name = inputPanel.name:getText() local items = getItemsFromBox() local unequip = {} + local hasUnequip = false for i, child in pairs(inputPanel.unequipPanel:getChildren()) do if child:isChecked() then table.insert(unequip, true) + hasUnequip = true else table.insert(unequip, false) end @@ -491,8 +493,8 @@ inputPanel.addButton.onClick = function() end end - if #items == 0 then - return warn("[vBot Equipper] Please add items.") + if #items == 0 and not hasUnequip then + return warn("[vBot Equipper] Please add items or select unequip slots.") end if #name == 0 then diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/HealBot.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/HealBot.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/HealBot.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/HealBot.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/HealBot.otui b/modules/game_bot/default_configs/vBot_4.41/vBot/HealBot.otui similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/HealBot.otui rename to modules/game_bot/default_configs/vBot_4.41/vBot/HealBot.otui diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/Sio.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/Sio.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/Sio.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/Sio.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/alarms.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/alarms.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/alarms.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/alarms.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/alarms.otui b/modules/game_bot/default_configs/vBot_4.41/vBot/alarms.otui similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/alarms.otui rename to modules/game_bot/default_configs/vBot_4.41/vBot/alarms.otui diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/analyzer.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/analyzer.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/analyzer.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/analyzer.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/analyzer.otui b/modules/game_bot/default_configs/vBot_4.41/vBot/analyzer.otui similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/analyzer.otui rename to modules/game_bot/default_configs/vBot_4.41/vBot/analyzer.otui diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/antiRs.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/antiRs.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/antiRs.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/antiRs.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/cast_food.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/cast_food.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/cast_food.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/cast_food.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/cavebot.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/cavebot.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/cavebot.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/cavebot.lua diff --git a/modules/game_bot/default_configs/vBot_4.41/vBot/cavebot_control_panel.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/cavebot_control_panel.lua new file mode 100644 index 0000000..765a640 --- /dev/null +++ b/modules/game_bot/default_configs/vBot_4.41/vBot/cavebot_control_panel.lua @@ -0,0 +1,63 @@ +setDefaultTab("Cave") + +g_ui.loadUIFromString([[ +CaveBotControlPanel < Panel + margin-top: 5 + layout: + type: verticalBox + fit-children: true + + HorizontalSeparator + + Label + text-align: center + text: CaveBot Control Panel + font: verdana-11px-rounded + margin-top: 3 + + HorizontalSeparator + + Panel + id: buttons + margin-top: 2 + layout: + type: grid + cell-size: 86 20 + cell-spacing: 1 + flow: true + fit-children: true + + HorizontalSeparator + margin-top: 3 +]]) + +local panel = UI.createWidget("CaveBotControlPanel") + +storage.caveBot = { + forceRefill = false, + backStop = false, + backTrainers = false, + backOffline = false +} + +-- [[ B U T T O N S ]] -- + +local forceRefill = UI.Button("Force Refill", function(widget) + storage.caveBot.forceRefill = true + print("[CaveBot] Going back on refill on next supply check.") +end, panel.buttons) + +local backStop = UI.Button("Back & Stop", function(widget) + storage.caveBot.backStop = true + print("[CaveBot] Going back to city on next supply check and turning off CaveBot on depositer action.") +end, panel.buttons) + +local backTrainers = UI.Button("To Trainers", function(widget) + storage.caveBot.backTrainers = true + print("[CaveBot] Going back to city on next supply check and going to label 'toTrainers' on depositer action.") +end, panel.buttons) + +local backOffline = UI.Button("Offline", function(widget) + storage.caveBot.backOffline = true + print("[CaveBot] Going back to city on next supply check and going to label 'toOfflineTraining' on depositer action.") +end, panel.buttons) \ No newline at end of file diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/combo.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/combo.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/combo.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/combo.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/combo.otui b/modules/game_bot/default_configs/vBot_4.41/vBot/combo.otui similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/combo.otui rename to modules/game_bot/default_configs/vBot_4.41/vBot/combo.otui diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/configs.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/configs.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/configs.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/configs.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/depositer_config.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/depositer_config.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/depositer_config.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/depositer_config.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/depositer_config.otui b/modules/game_bot/default_configs/vBot_4.41/vBot/depositer_config.otui similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/depositer_config.otui rename to modules/game_bot/default_configs/vBot_4.41/vBot/depositer_config.otui diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/depot_withdraw.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/depot_withdraw.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/depot_withdraw.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/depot_withdraw.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/eat_food.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/eat_food.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/eat_food.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/eat_food.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/equip.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/equip.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/equip.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/equip.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/equipper.otui b/modules/game_bot/default_configs/vBot_4.41/vBot/equipper.otui similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/equipper.otui rename to modules/game_bot/default_configs/vBot_4.41/vBot/equipper.otui diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/exeta.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/exeta.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/exeta.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/exeta.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/extras.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/extras.lua similarity index 98% rename from modules/game_bot/default_configs/vBot_4.4/vBot/extras.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/extras.lua index 756fdaf..e734948 100644 --- a/modules/game_bot/default_configs/vBot_4.4/vBot/extras.lua +++ b/modules/game_bot/default_configs/vBot_4.41/vBot/extras.lua @@ -14,6 +14,14 @@ extrasWindow.closeButton.onClick = function(widget) extrasWindow:hide() end +extrasWindow.onGeometryChange = function(widget, old, new) + if old.height == 0 then return end + + settings.height = new.height +end + +extrasWindow:setHeight(settings.height or 360) + -- available options for dest param local rightPanel = extrasWindow.content.right local leftPanel = extrasWindow.content.left @@ -525,7 +533,9 @@ if true then end end if settings.checkPlayer then - checkPlayers() + schedule(500, function() + checkPlayers() + end) end onPlayerPositionChange(function(x,y) diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/extras.otui b/modules/game_bot/default_configs/vBot_4.41/vBot/extras.otui similarity index 92% rename from modules/game_bot/default_configs/vBot_4.4/vBot/extras.otui rename to modules/game_bot/default_configs/vBot_4.41/vBot/extras.otui index d72f916..de551d9 100644 --- a/modules/game_bot/default_configs/vBot_4.4/vBot/extras.otui +++ b/modules/game_bot/default_configs/vBot_4.41/vBot/extras.otui @@ -136,7 +136,17 @@ ExtrasWindow < MainWindow anchors.right: parent.right anchors.left: parent.left anchors.bottom: closeButton.top - margin-bottom: 8 + margin-bottom: 8 + + ResizeBorder + id: bottomResizeBorder + anchors.fill: separator + height: 3 + minimum: 260 + maximum: 600 + margin-left: 3 + margin-right: 3 + background: #ffffff88 Button id: closeButton diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/hold_target.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/hold_target.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/hold_target.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/hold_target.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/ingame_editor.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/ingame_editor.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/ingame_editor.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/ingame_editor.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/items.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/items.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/items.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/items.lua diff --git a/modules/game_bot/default_configs/vBot_4.41/vBot/lib/CaveBot.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/lib/CaveBot.lua new file mode 100644 index 0000000..e69de29 diff --git a/modules/game_bot/default_configs/vBot_4.41/vBot/lib/Container.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/lib/Container.lua new file mode 100644 index 0000000..2cfdf21 --- /dev/null +++ b/modules/game_bot/default_configs/vBot_4.41/vBot/lib/Container.lua @@ -0,0 +1,159 @@ +Container = {} + +--- returns all open containers +-- @return table +function Container:getAll() return getContainers() end + +--- gets first open container +-- @return userdata +function Container:getFirst() return getContainers()[1] end + +--- gets last open container +-- @return userdata +function Container:getLast() return getContainers()[#getContainers()] end + +-- returns open containers count +-- @return number +function Container:getOpenContainersCount() return #getContainers() end + +--- returns given container item id +-- @param container is userdata +-- @return number +function Container:getItemId() end + +--- closes all open container windows +-- @return void +function Container:closeAllContainers() + for i, container in ipairs(Container:getContainers()) do + container:close() + end +end + +--- checks if container has any free slots +-- @param container is userdata +-- @return boolean +function Container:isFull(container) + return container:getCapacity() > #container:getItems() +end + +--- returns free slots count in given container +-- @param container is userdata +-- @return number +function Container:getFreeSlots(container) + return #container:getItems() - container:getCapacity() +end + +--- returns first free slot position +-- @param container is userdata +-- @return table +function Container:getFreeSlotPosition(container) + return container:getSlotPosition(container:getItems()) +end + +--- opens given container parent +-- @param container is userdata +-- @return void +function Container:openParent(container) g_game.openParent(container) end + +--- finds open container object based on the id +-- @param itemId is number +-- @return userdata +function Container:getContainerByItemId(itemId) + + for i, container in ipairs(getContainers()) do + local cId = container:getContainerItem():getId() + if cId == itemId then return container end + end + +end + +--- finds open container object based on the name +-- @param name is string +-- @return userdata +function Container:getContainerByName(name) + name = name:lower():trim() + + for i, container in ipairs(getContainers()) do + local cName = container:getName():lower() + if cName == name then return container end + end + +end + +--- checks if given container is declared as loot container in TargetBot +-- @param container is userdata / integer / string +-- @returns boolean +function Container:isLootContainer(container) + local id + + if type(container) == "number" then + id = container + elseif type(container) == "string" then + id = Container:getContainerByName(container) + id = id and id:getContainerItem():getId() + elseif type(container) == "userdata" then + id = container:getContainerItem():getId() + end + + if not id then return false end + + if table.find(vBot.lootConainers, id) then + return true + else + return false + end +end + +--- returns the amount of open loot containers +-- @return amount +function Container:getOpenLootContainersCount() + local amount = 0 + + for i, container in ipairs(getContainers()) do + amount = Container:isLootContainer(container) and amount + 1 or amount + end + + return amount +end + +--- opens child container with the same id inside given one +-- @param container is userdata +-- @param newWindow is boolean +-- @return void +function Container:openChild(container, newWindow) + local parentId = container:getContaierItem():getId() + + for i, item in ipairs(container:getItems()) do + local id = item:getId() + + if id == parentId then + return g_game.open(item, newWindow and container or nil) + end + end +end + +-- returns all items inside given container +-- @param container is userdata +-- @return table +function Container:getItems(container) return container:getItems() end + +--- checks if given container helds item with given id +-- @param container is userdata +-- @param id is number +-- @return boolean +function Container:hasItem(container, id) + local isInsideContainer = false + + for i, item in ipairs(container:getItems()) do + if item:getId() == id then + isInsideContainer = true + break + end + end + + return isInsideContainer +end + +function Container:reOpenAllContainers() + -- TODO, extract function from containers.lua +end \ No newline at end of file diff --git a/modules/game_bot/default_configs/vBot_4.41/vBot/lib/Map.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/lib/Map.lua new file mode 100644 index 0000000..e69de29 diff --git a/modules/game_bot/default_configs/vBot_4.41/vBot/lib/Player.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/lib/Player.lua new file mode 100644 index 0000000..39508e5 --- /dev/null +++ b/modules/game_bot/default_configs/vBot_4.41/vBot/lib/Player.lua @@ -0,0 +1,100 @@ +Player = {} + +--- opens main backpack +-- @return void +function Player:openMain() + local back = getBack() + + if back then g_game.open(back) end +end + +--- opens purse/store inbox slot +-- @return void +function Player:openPurse() + local purse = getPurse() + + if item then use(purse) end +end + +--- player says certain phrase or sequence +-- @param text is string or table +-- @param npc is boolean +-- @return void +function Player:speak(text, npc, wait) + if type(text) == "string" then + if npc then + return NPC.say(text) + else + return say(text) + end + end + + -- text is table, therefore sequence + local talkDelay = 0 + local globalDelay = storage.extras.talkDelay + + for i, string in ipairs(text) do + + schedule(talkDelay, function() + + if npc then + return NPC.say(string) + else + return say(string) + end + + end) + + talkDelay = talkDelay + globalDelay + end + if wait then delay( talkDelay + globalDelay ) end +end + + +function Player:getId() + return player:getId() +end + +function Player:getName() + return player:getName() +end + +function Player:getTarget() + return g_game.getAttackingCreature() +end + +function Player:getTargetName() + return Player:getTarget():getName() +end + +function Player:getTargetPosition() + return Player:getTarget():getPosition() +end + +function Player:getDistanceFromTarget() + return getDistanceBetween(Player:getPosition(), Player:getTargetPosition()) +end + +function Player:getPosition() + return player:getPosition() +end + +function Player:getLookDirection() + return player:getDirection() +end + +function Player:getLookPosition(range) + local dir = Player:getLookDirection() + local pos = Player:getPosition() + local n = range or 1 + if (dir == NORTH) then + pos.y = pos.y - n + elseif (dir == SOUTH) then + pos.y = pos.y + n + elseif (dir == WEST) then + pos.x = pos.x - n + elseif (dir == EAST) then + pos.x = pos.x + n + end + return pos +end \ No newline at end of file diff --git a/modules/game_bot/default_configs/vBot_4.41/vBot/lib/Spectators.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/lib/Spectators.lua new file mode 100644 index 0000000..e69de29 diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/main.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/main.lua similarity index 68% rename from modules/game_bot/default_configs/vBot_4.4/vBot/main.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/main.lua index 59ecc78..20b0b74 100644 --- a/modules/game_bot/default_configs/vBot_4.4/vBot/main.lua +++ b/modules/game_bot/default_configs/vBot_4.41/vBot/main.lua @@ -1,6 +1,5 @@ -local version = "4.4" +local version = "4.41" local currentVersion -local hashcode local available = false storage.checkVersion = storage.checkVersion or 0 @@ -16,9 +15,7 @@ if os.time() > storage.checkVersion + (12 * 60 * 60) then return end - local t = string.split(data, ",") - currentVersion = t[1]:trim() - hashcode = t[2]:trim() + currentVersion = data available = true end) @@ -29,18 +26,15 @@ UI.Button("Official OTCv8 Discord!", function() g_platform.openUrl("https://disc UI.Separator() schedule(5000, function() + if not available then return end if currentVersion ~= version then UI.Separator() - local label = UI.Label("New vBot is available for download! v"..currentVersion) - label:setColor() - UI.Button("Get Hash Code", function() - g_window.setClipboardText(hashcode) - info("Hashcode copied to clipboard!") - end) + UI.Label("New vBot is available for download! v"..currentVersion) UI.Button("Go to vBot GitHub Page", function() g_platform.openUrl("https://github.com/Vithrax/vBot") end) UI.Separator() + end end) \ No newline at end of file diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/new healer.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/new healer.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/new healer.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/new healer.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/new healer.otui b/modules/game_bot/default_configs/vBot_4.41/vBot/new healer.otui similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/new healer.otui rename to modules/game_bot/default_configs/vBot_4.41/vBot/new healer.otui diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/new_cavebot_lib.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/new_cavebot_lib.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/new_cavebot_lib.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/new_cavebot_lib.lua diff --git a/modules/game_bot/default_configs/vBot_4.41/vBot/new_healer.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/new_healer.lua new file mode 100644 index 0000000..9e85304 --- /dev/null +++ b/modules/game_bot/default_configs/vBot_4.41/vBot/new_healer.lua @@ -0,0 +1,455 @@ +setDefaultTab("Main") +local panelName = "newHealer" +local ui = setupUI([[ +Panel + height: 19 + + BotSwitch + id: title + anchors.top: parent.top + anchors.left: parent.left + text-align: center + width: 130 + !text: tr('Friend Healer') + + Button + id: edit + anchors.top: prev.top + anchors.left: prev.right + anchors.right: parent.right + margin-left: 3 + height: 17 + text: Setup + +]]) +ui:setId(panelName) + +-- validate current settings +if not storage[panelName] or not storage[panelName].priorities then + storage[panelName] = nil +end + +if not storage[panelName] then + storage[panelName] = { + enabled = false, + customPlayers = {}, + vocations = {}, + groups = {}, + priorities = { + + {name="Custom Spell", enabled=false, custom=true}, + {name="Exura Gran Sio", enabled=true, strong = true}, + {name="Exura Sio", enabled=true, normal = true}, + {name="Exura Gran Mas Res", enabled=true, area = true}, + {name="Health Item", enabled=true, health=true}, + {name="Mana Item", enabled=true, mana=true} + + }, + settings = { + + {type="HealItem", text="Mana Item ", value=268}, + {type="HealScroll", text="Item Range: ", value=6}, + {type="HealItem", text="Health Item ", value=3160}, + {type="HealScroll", text="Mas Res Players: ", value=2}, + {type="HealScroll", text="Heal Friend at: ", value=80}, + {type="HealScroll", text="Use Gran Sio at: ", value=80}, + {type="HealScroll", text="Min Player HP%: ", value=80}, + {type="HealScroll", text="Min Player MP%: ", value=50}, + + }, + conditions = { + knights = true, + paladins = true, + druids = false, + sorcerers = false, + party = true, + guild = false, + botserver = false, + friends = false + } + } +end + +local config = storage[panelName] +local healerWindow = UI.createWindow('FriendHealer') +healerWindow:hide() +healerWindow:setId(panelName) + +ui.title:setOn(config.enabled) +ui.title.onClick = function(widget) + config.enabled = not config.enabled + widget:setOn(config.enabled) +end + +ui.edit.onClick = function() + healerWindow:show() + healerWindow:raise() + healerWindow:focus() +end + +local conditions = healerWindow.conditions +local targetSettings = healerWindow.targetSettings +local customList = healerWindow.customList +local priority = healerWindow.priority + +-- customList +-- create entries on the list +for name, health in pairs(config.customPlayers) do + local widget = UI.createWidget("HealerPlayerEntry", customList.playerList.list) + widget.remove.onClick = function() + config.customPlayers[name] = nil + widget:destroy() + end + widget:setText("["..health.."%] "..name) +end + +customList.playerList.onDoubleClick = function() + customList.playerList:hide() +end + +local function clearFields() + customList.addPanel.name:setText("friend name") + customList.addPanel.health:setText("1") + customList.playerList:show() +end + +local function capitalFistLetter(str) + return (string.gsub(str, "^%l", string.upper)) + end + +customList.addPanel.add.onClick = function() + local name = "" + local words = string.split(customList.addPanel.name:getText(), " ") + local health = tonumber(customList.addPanel.health:getText()) + for i, word in ipairs(words) do + name = name .. " " .. capitalFistLetter(word) + end + + if not health then + clearFields() + return warn("[Friend Healer] Please enter health percent value!") + end + + if name:len() == 0 or name:lower() == "friend name" then + clearFields() + return warn("[Friend Healer] Please enter friend name to be added!") + end + + if config.customPlayers[name] or config.customPlayers[name:lower()] then + clearFields() + return warn("[Friend Healer] Player already added to custom list.") + else + config.customPlayers[name] = health + local widget = UI.createWidget("HealerPlayerEntry", customList.playerList.list) + widget.remove.onClick = function() + config.customPlayers[name] = nil + widget:destroy() + end + widget:setText("["..health.."%] "..name) + end + + clearFields() +end + +local function validate(widget, category) + local list = widget:getParent() + local label = list:getParent().title + -- 1 - priorities | 2 - vocation + category = category or 0 + + if category == 2 and not storage.extras.checkPlayer then + label:setColor("#d9321f") + label:setTooltip("! WARNING ! \nTurn on check players in extras to use this feature!") + return + else + label:setColor("#dfdfdf") + label:setTooltip("") + end + + local checked = false + for i, child in ipairs(list:getChildren()) do + if category == 1 and child.enabled:isChecked() or child:isChecked() then + checked = true + end + end + + if not checked then + label:setColor("#d9321f") + label:setTooltip("! WARNING ! \nNo category selected!") + else + label:setColor("#dfdfdf") + label:setTooltip("") + end +end +-- targetSettings +targetSettings.vocations.box.knights:setChecked(config.conditions.knights) +targetSettings.vocations.box.knights.onClick = function(widget) + config.conditions.knights = not config.conditions.knights + widget:setChecked(config.conditions.knights) + validate(widget, 2) +end + +targetSettings.vocations.box.paladins:setChecked(config.conditions.paladins) +targetSettings.vocations.box.paladins.onClick = function(widget) + config.conditions.paladins = not config.conditions.paladins + widget:setChecked(config.conditions.paladins) + validate(widget, 2) +end + +targetSettings.vocations.box.druids:setChecked(config.conditions.druids) +targetSettings.vocations.box.druids.onClick = function(widget) + config.conditions.druids = not config.conditions.druids + widget:setChecked(config.conditions.druids) + validate(widget, 2) +end + +targetSettings.vocations.box.sorcerers:setChecked(config.conditions.sorcerers) +targetSettings.vocations.box.sorcerers.onClick = function(widget) + config.conditions.sorcerers = not config.conditions.sorcerers + widget:setChecked(config.conditions.sorcerers) + validate(widget, 2) +end + +targetSettings.groups.box.friends:setChecked(config.conditions.friends) +targetSettings.groups.box.friends.onClick = function(widget) + config.conditions.friends = not config.conditions.friends + widget:setChecked(config.conditions.friends) + validate(widget) +end + +targetSettings.groups.box.party:setChecked(config.conditions.party) +targetSettings.groups.box.party.onClick = function(widget) + config.conditions.party = not config.conditions.party + widget:setChecked(config.conditions.party) + validate(widget) +end + +targetSettings.groups.box.guild:setChecked(config.conditions.guild) +targetSettings.groups.box.guild.onClick = function(widget) + config.conditions.guild = not config.conditions.guild + widget:setChecked(config.conditions.guild) + validate(widget) +end + +targetSettings.groups.box.botserver:setChecked(config.conditions.botserver) +targetSettings.groups.box.botserver.onClick = function(widget) + config.conditions.botserver = not config.conditions.botserver + widget:setChecked(config.conditions.botserver) + validate(widget) +end + +validate(targetSettings.vocations.box.knights) +validate(targetSettings.groups.box.friends) +validate(targetSettings.vocations.box.sorcerers, 2) + +-- conditions +for i, setting in ipairs(config.settings) do + local widget = UI.createWidget(setting.type, conditions.box) + local text = setting.text + local val = setting.value + widget.text:setText(text) + + if setting.type == "HealScroll" then + widget.text:setText(widget.text:getText()..val) + if not (text:find("Range") or text:find("Mas Res")) then + widget.text:setText(widget.text:getText().."%") + end + widget.scroll:setValue(val) + widget.scroll.onValueChange = function(scroll, value) + setting.value = value + widget.text:setText(text..value) + if not (text:find("Range") or text:find("Mas Res")) then + widget.text:setText(widget.text:getText().."%") + end + end + if text:find("Range") or text:find("Mas Res") then + widget.scroll:setMaximum(10) + end + else + widget.item:setItemId(val) + widget.item:setShowCount(false) + widget.item.onItemChange = function(widget) + setting.value = widget:getItemId() + end + end +end + + + +-- priority and toggles +local function setCrementalButtons() + for i, child in ipairs(priority.list:getChildren()) do + if i == 1 then + child.increment:disable() + elseif i == 6 then + child.decrement:disable() + else + child.increment:enable() + child.decrement:enable() + end + end +end + +for i, action in ipairs(config.priorities) do + local widget = UI.createWidget("PriorityEntry", priority.list) + + widget:setText(action.name) + widget.increment.onClick = function() + local index = priority.list:getChildIndex(widget) + local table = config.priorities + + priority.list:moveChildToIndex(widget, index-1) + table[index], table[index-1] = table[index-1], table[index] + setCrementalButtons() + end + widget.decrement.onClick = function() + local index = priority.list:getChildIndex(widget) + local table = config.priorities + + priority.list:moveChildToIndex(widget, index+1) + table[index], table[index+1] = table[index+1], table[index] + setCrementalButtons() + end + widget.enabled:setChecked(action.enabled) + widget:setColor(action.enabled and "#98BF64" or "#dfdfdf") + widget.enabled.onClick = function() + action.enabled = not action.enabled + widget:setColor(action.enabled and "#98BF64" or "#dfdfdf") + widget.enabled:setChecked(action.enabled) + validate(widget, 1) + end + if action.custom then + widget.onDoubleClick = function() + local window = modules.client_textedit.show(widget, {title = "Custom Spell", description = "Enter below formula for a custom healing spell"}) + schedule(50, function() + window:raise() + window:focus() + end) + end + widget.onTextChange = function(widget,text) + action.name = text + end + widget:setTooltip("Double click to set spell formula.") + end + + if i == #config.priorities then + validate(widget, 1) + setCrementalButtons() + end +end + +local lastItemUse = now +local function friendHealerAction(spec, targetsInRange) + local name = spec:getName() + local health = spec:getHealthPercent() + local mana = spec:getManaPercent() + local dist = distanceFromPlayer(spec:getPosition()) + targetsInRange = targetsInRange or 0 + + local masResAmount = config.settings[4].value + local itemRange = config.settings[2].value + local healItem = config.settings[3].value + local manaItem = config.settings[1].value + local normalHeal = config.customPlayers[name] or config.settings[5].value + local strongHeal = config.customPlayers[name] and normalHeal/2 or config.settings[6].value + + for i, action in ipairs(config.priorities) do + if action.enabled then + if action.area and masResAmount <= targetsInRange and canCast("exura gran mas res") then + return say("exura gran mas res") + end + if action.mana and findItem(manaItem) and mana <= normalHeal and dist <= itemRange and now - lastItemUse > 1000 then + lastItemUse = now + return useWith(manaItem, spec) + end + if action.health and findItem(healItem) and health <= normalHeal and dist <= itemRange and now - lastItemUse > 1000 then + lastItemUse = now + return useWith(healItem, spec) + end + if action.strong and health <= strongHeal and not modules.game_cooldown.isCooldownIconActive(101) then + return say('exura gran sio "'..name) + end + if (action.normal or action.custom) and health <= normalHeal and canCast('exura sio "'..name) then + return say('exura sio "'..name) + end + end + end +end + +macro(100, function() + if not config.enabled then return end + if modules.game_cooldown.isGroupCooldownIconActive(2) then return end + + local minHp = config.settings[7].value + local minMp = config.settings[8].value + + -- first index will be heal target + local finalTable = {} + local inMasResRange = 0 + + -- check basic + if hppercent() <= minHp or manapercent() <= minMp then return end + + -- get all spectators + local spectators = getSpectators() + + -- clear table from irrelevant spectators + for i, spec in ipairs(getSpectators()) do + if spec:isLocalPlayer() or not spec:isPlayer() or not spec:canShoot() then + if not config.customPlayers[name] then + table.remove(spectators, table.find(spectators, spec)) + end + else + local specText = spec:getText() + -- check players is enabled and spectator already verified + if storage.extras.checkPlayer and specText:len() > 0 then + if specText:find("EK") and not config.conditions.knights or + specText:find("RP") and not config.conditions.paladins or + specText:find("ED") and not config.conditions.druids or + specText:find("MS") and not config.conditions.sorcerers then + if not config.customPlayers[name] then + table.remove(spectators, table.find(spectators, spec)) + end + end + end + local okParty = config.conditions.party and spec:isPartyMember() + local okFriend = config.conditions.friends and isFriend(spec) + local okGuild = config.conditions.guild and spec:getEmblem() == 1 + local okBotServer = config.conditions.botserver and vBot.BotServerMembers[spec:getName()] + if not (okParty or okFriend or okGuild or okBotServer) then + if not config.customPlayers[name] then + table.remove(spectators, table.find(spectators, spec)) + end + end + end + end + + -- no targets, return + if #spectators == 0 then return end + + for name, health in pairs(config.customPlayers) do + for i, spec in ipairs(spectators) do + local specHp = spec:getHealthPercent() + if spec:getName() == name and specHp <= health then + if distanceFromPlayer(spec:getPosition()) <= 2 then + inMasResRange = inMasResRange + 1 + end + table.insert(finalTable, spec) + table.remove(spectators, i) + end + end + end + + for i=1,#spectators do + local spec = spectators[i] + if distanceFromPlayer(spec:getPosition()) <= 3 then + inMasResRange = inMasResRange + 1 + end + table.insert(finalTable, spec) + end + + -- no targets, return + if #finalTable == 0 then return end + + friendHealerAction(finalTable[1], inMasResRange) +end) \ No newline at end of file diff --git a/modules/game_bot/default_configs/vBot_4.41/vBot/new_healer.otui b/modules/game_bot/default_configs/vBot_4.41/vBot/new_healer.otui new file mode 100644 index 0000000..2eb55cc --- /dev/null +++ b/modules/game_bot/default_configs/vBot_4.41/vBot/new_healer.otui @@ -0,0 +1,413 @@ +CategoryCheckBox < CheckBox + font: verdana-11px-rounded + margin-top: 3 + + $checked: + color: #98BF64 + +HealScroll < Panel + + ToolTipLabel + id: text + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + text-align: center + text: test + + HorizontalScrollBar + id: scroll + anchors.left: parent.left + anchors.right: parent.right + anchors.top: prev.bottom + margin-top: 3 + minimum: 0 + maximum: 100 + step: 1 + +HealItem < Panel + + BotItem + id: item + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + size: 34 34 + + ToolTipLabel + id: text + anchors.fill: parent + anchors.left: prev.right + margin-left: 8 + text-wrap: true + text-align: left + +ToolTipLabel < UIWidget + font: verdana-11px-rounded + color: #dfdfdf + height: 14 + text-align: center + +HealerPlayerEntry < Label + background-color: alpha + text-offset: 5 1 + focusable: true + height: 16 + font: verdana-11px-rounded + text-align: left + + $focus: + background-color: #00000055 + + Button + id: remove + anchors.right: parent.right + margin-right: 2 + anchors.verticalCenter: parent.verticalCenter + size: 15 15 + margin-right: 15 + text: X + tooltip: Remove player from the list + +PriorityEntry < ToolTipLabel + background-color: alpha + text-offset: 18 1 + focusable: true + height: 16 + font: verdana-11px-rounded + text-align: left + + $focus: + background-color: #00000055 + + CheckBox + id: enabled + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + size: 15 15 + margin-top: 2 + margin-left: 3 + + Button + id: increment + anchors.right: parent.right + margin-right: 2 + anchors.verticalCenter: parent.verticalCenter + size: 14 14 + text: + + tooltip: Increase Priority + + Button + id: decrement + anchors.right: prev.left + margin-right: 2 + anchors.verticalCenter: parent.verticalCenter + size: 14 14 + text: - + tooltip: Decrease Priority + +TargetSettings < Panel + size: 280 125 + padding: 3 + image-source: /images/ui/window + image-border: 6 + + Label + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + font: verdana-11px-rounded + text: Heal Target Settings + + Groups + id: groups + anchors.top: prev.bottom + margin-top: 8 + anchors.left: parent.left + margin-left: 9 + + Vocations + id: vocations + anchors.left: prev.right + margin-left: 5 + anchors.verticalCenter: prev.verticalCenter + +Groups < FlatPanel + size: 150 90 + padding: 3 + padding-top: 5 + + ToolTipLabel + id: title + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + text: Groups + tooltip: Players added in custom list will always be in scope + + HorizontalSeparator + anchors.top: prev.bottom + margin-top: 2 + anchors.left: parent.left + anchors.right: parent.right + + Panel + id: box + anchors.top: prev.bottom + margin-top: 2 + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + padding: 2 + layout: + type: verticalBox + + CategoryCheckBox + id: friends + text: Friends + + CategoryCheckBox + id: party + text: Party Members + + CategoryCheckBox + id: guild + text: Guild Members + + CategoryCheckBox + id: botserver + text: BotServer Members + +Vocations < FlatPanel + size: 100 90 + padding: 3 + padding-top: 5 + + ToolTipLabel + id: title + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + font: verdana-11px-rounded + text: Vocations + + HorizontalSeparator + anchors.top: prev.bottom + margin-top: 2 + anchors.left: parent.left + anchors.right: parent.right + + Panel + id: box + anchors.top: prev.bottom + margin-top: 2 + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + padding: 2 + + layout: + type: verticalBox + + CategoryCheckBox + id: knights + text: Knights + + CategoryCheckBox + id: paladins + text: Paladins + + CategoryCheckBox + id: druids + text: Druids + + CategoryCheckBox + id: sorcerers + text: Sorcerers + +Priority < Panel + size: 190 123 + padding: 6 + padding-top: 3 + image-source: /images/ui/window + image-border: 6 + + ToolTipLabel + id: title + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + font: verdana-11px-rounded + text: Priority & Toggles + + TextList + id: list + anchors.top: prev.bottom + margin-top: 3 + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + fit-children: true + padding-top: 1 + +AddPlayer < FlatPanel + padding: 5 + + Label + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + font: verdana-11px-rounded + text: Add Player to Custom List + text-align: center + text-wrap: true + + HorizontalSeparator + anchors.top: prev.bottom + anchors.left: parent.left + anchors.right: parent.right + margin-top: 2 + + SpinBox + id: health + anchors.left: parent.left + anchors.top: prev.bottom + margin-top: 20 + width: 50 + minimum: 1 + maximum: 99 + step: 1 + focusable: true + text-align: center + + Label + anchors.verticalCenter: prev.verticalCenter + anchors.left: prev.right + margin-left: 3 + font: verdana-11px-rounded + text: %HP - heal if below + + TextEdit + id: name + anchors.top: health.bottom + margin-top: 5 + anchors.left: health.left + anchors.right: parent.right + font: verdana-11px-rounded + text-align: center + text: friend name + + Button + id: add + anchors.left: health.left + anchors.right: parent.right + anchors.top: prev.bottom + margin-top: 5 + font: verdana-11px-rounded + text: Add Player + +PlayerList < Panel + + TextList + id: list + anchors.fill: parent + fit-children: true + padding-top: 2 + vertical-scrollbar: listScrollBar + + VerticalScrollBar + id: listScrollBar + anchors.top: list.top + anchors.bottom: list.bottom + anchors.right: list.right + step: 14 + pixels-scroll: true + +CustomList < Panel + size: 190 172 + padding: 6 + padding-top: 3 + image-source: /images/ui/window + image-border: 6 + + ToolTipLabel + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + font: verdana-11px-rounded + text: Custom Player List + tooltip: Double click on the list below to add new player. + + AddPlayer + id: addPanel + anchors.top: prev.bottom + margin-top: 3 + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + + PlayerList + id: playerList + anchors.fill: prev + +Conditions < Panel + size: 280 170 + padding: 3 + image-source: /images/ui/window + image-border: 6 + + Label + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + font: verdana-11px-rounded + text: Player Conditions + + Panel + id: box + anchors.fill: parent + margin-top: 16 + padding: 5 + padding-top: 3 + layout: + type: grid + cell-size: 128 31 + cell-spacing: 5 + num-columns: 2 + +FriendHealer < MainWindow + !text: tr('Friend Healer') + size: 512 390 + padding-top: 30 + @onEscape: self:hide() + + Conditions + id: conditions + anchors.top: parent.top + anchors.right: parent.right + + TargetSettings + id: targetSettings + anchors.top: prev.bottom + margin-top: 10 + anchors.left: prev.left + + Priority + id: priority + anchors.top: parent.top + anchors.left: parent.left + + CustomList + id: customList + anchors.top: priority.bottom + margin-top: 10 + anchors.left: priority.left + + HorizontalSeparator + id: separator + anchors.right: parent.right + anchors.left: parent.left + anchors.bottom: closeButton.top + margin-bottom: 8 + + Button + id: closeButton + !text: tr('Close') + font: cipsoftFont + anchors.right: parent.right + anchors.bottom: parent.bottom + size: 45 21 + @onClick: self:getParent():hide() \ No newline at end of file diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/npc_talk.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/npc_talk.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/npc_talk.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/npc_talk.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/playerlist.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/playerlist.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/playerlist.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/playerlist.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/playerlist.otui b/modules/game_bot/default_configs/vBot_4.41/vBot/playerlist.otui similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/playerlist.otui rename to modules/game_bot/default_configs/vBot_4.41/vBot/playerlist.otui diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/pushmax.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/pushmax.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/pushmax.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/pushmax.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/pushmax.otui b/modules/game_bot/default_configs/vBot_4.41/vBot/pushmax.otui similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/pushmax.otui rename to modules/game_bot/default_configs/vBot_4.41/vBot/pushmax.otui diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/quiver_manager.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/quiver_manager.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/quiver_manager.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/quiver_manager.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/siolist.otui b/modules/game_bot/default_configs/vBot_4.41/vBot/siolist.otui similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/siolist.otui rename to modules/game_bot/default_configs/vBot_4.41/vBot/siolist.otui diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/spy_level.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/spy_level.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/spy_level.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/spy_level.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/supplies.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/supplies.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/supplies.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/supplies.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/supplies.otui b/modules/game_bot/default_configs/vBot_4.41/vBot/supplies.otui similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/supplies.otui rename to modules/game_bot/default_configs/vBot_4.41/vBot/supplies.otui diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/tools.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/tools.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/tools.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/tools.lua diff --git a/modules/game_bot/default_configs/vBot_4.41/vBot/version.txt b/modules/game_bot/default_configs/vBot_4.41/vBot/version.txt new file mode 100644 index 0000000..cb83bc1 --- /dev/null +++ b/modules/game_bot/default_configs/vBot_4.41/vBot/version.txt @@ -0,0 +1 @@ +4.41 \ No newline at end of file diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/vlib.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/vlib.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/vlib.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/vlib.lua diff --git a/modules/game_bot/default_configs/vBot_4.4/vBot/xeno_menu.lua b/modules/game_bot/default_configs/vBot_4.41/vBot/xeno_menu.lua similarity index 100% rename from modules/game_bot/default_configs/vBot_4.4/vBot/xeno_menu.lua rename to modules/game_bot/default_configs/vBot_4.41/vBot/xeno_menu.lua diff --git a/otclient_dx.exe b/otclient_dx.exe index 2e3cf71..b4d28d8 100644 Binary files a/otclient_dx.exe and b/otclient_dx.exe differ diff --git a/otclient_gl.exe b/otclient_gl.exe index 3014748..7fa976f 100644 Binary files a/otclient_gl.exe and b/otclient_gl.exe differ diff --git a/otclientv8.apk b/otclientv8.apk index 777f0f0..03ac9a2 100644 Binary files a/otclientv8.apk and b/otclientv8.apk differ