fix: auto loot distance check with version-specific corpse mechanics#1525
fix: auto loot distance check with version-specific corpse mechanics#1525divinity76 merged 6 commits intomainfrom
Conversation
Co-authored-by: divinity76 <1874996+divinity76@users.noreply.github.com>
divinity76
left a comment
There was a problem hiding this comment.
At some point, CipSoft added support for looting corpses without adjacency. I don't know when they did that, but it was after 760.
The code should do something like
if g_game.getClientVersion() <= 760 then
...
with a note 760 is probably not the correct cutoff either, but we don't know the correct cutoff (we only know it's > 760)
unless you happen to know when cipsoft did it.
Co-authored-by: divinity76 <1874996+divinity76@users.noreply.github.com>
Co-authored-by: divinity76 <1874996+divinity76@users.noreply.github.com>
divinity76
left a comment
There was a problem hiding this comment.
I don't like the coding style. Try something like
local minDist = 3
local walkPrecision = 2
if g_game.getClientVersion() <= 760 then
-- Later versions allow looting from larger distance. We use 760 as cutoff, but the exact
-- version when CipSoft changed this is unknown
minDist = 1
walkPrecision = 1
end
if dist > minDist or not tile thenCo-authored-by: divinity76 <1874996+divinity76@users.noreply.github.com>
Co-authored-by: divinity76 <1874996+divinity76@users.noreply.github.com>
... Updated in commit d1db0ac. Changed to the requested coding style with defaults set first (minDist = 2, walkPrecision = 2), then overridden for version <= 760 (minDist = 1, walkPrecision = 1). |
|
|
hey @copilot Do you think these issues and pull requests should be in divinity76’s repository instead of the main repository? |
|
@javiertringol I see your point, I think the way to achieve that is to copy-paste the issue to the local repo, then assign copilot in that repo, fix it, and then send a PR. Clunky but yeah. Anyway, the code LGTM now, I haven't actually tested it (and it's 4am, i won't be able to test it for another 10 hours I think), Marked as ready-for-review |
|
btw does anyone know when Cip added that "you don't need to stand right next to the body" thing? |
|
Have tested it. auto looter no longer get stuck on 7.6 👍 my recommendation, ship it. ping @kokekanon need a 2nd reviewer to approve for Copilot PRs. |
in 13.40 they made it possible to loot all corpses in exori range with one click. Just tested it on cip servers and I had to walk to the monster corpse in order to quick loot it. Might be ots-only thing (or premium account feature). |
Oh wow, in that case, I'm in favor of removing the version guard entirely and make the bot always enter exori range to loot. Is "vBot getting stuck on auto-loot" a well-known problem? Does it happen in like 10.x versions too?
Neat. Does Cipsoft let you implement blacklist to ignore trash/stuff you're not interested in? I have not been on Cipsoft servers in many years |
|
quoting https://forum.gunzodus.net/threads/is-there-an-option-to-loot-from-distance.143/
Which suggest that, at least in 2019, Cipsoft's tibia allowed autoloot to loot away from corpses 🤔 I also recall BlackD Proxy's cavebot adding more-distant-than-exori-range looting at some point, and breaking 7.6 looting in the process (7.6 was later fixed) |
yes, there are two modes, one is collecting defined items only, the other mode does exact opposite |
commit 5c276fa Author: André Morais <andreoam@gmail.com> Date: Mon Jan 5 12:15:09 2026 -0300 fix: cyclopedia map (opentibiabr#1545) commit 62f9bb5 Author: divinity76 <hans@loltek.net> Date: Mon Jan 5 16:13:36 2026 +0100 fix: remove vBot upstream version check (opentibiabr#1547) commit b967b44 Author: Renato Machado <mehahx@gmail.com> Date: Sun Jan 4 20:55:57 2026 -0300 fix(drawpool): guard against nullptr coords when batching commit 3db1163 Author: Renato Machado <mehahx@gmail.com> Date: Sun Jan 4 17:16:21 2026 -0300 fix: auto-repaint for foreground and map when shader is enabled commit a751caf Author: Gabriel Alcântara Bernardes <gabrielalcantaratp@gmail.com> Date: Sun Jan 4 10:59:31 2026 -0300 fix: bestiary search (opentibiabr#1536) commit 7518e6b Author: divinity76 <hans@loltek.net> Date: Sat Jan 3 14:55:39 2026 +0100 fix(vbot): item list scroll to bottom on new entry (opentibiabr#1530) commit 5466028 Author: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Sat Jan 3 10:55:06 2026 -0300 fix(vbot): typo in method name: 'hasCreature' to 'hasCreatures' (opentibiabr#1534) commit a4bd7d4 Author: divinity76 <hans@loltek.net> Date: Sat Jan 3 04:26:14 2026 +0100 fix(vbot): Expose Directions to bot sandbox (opentibiabr#1533) Allow doing ```lua g_game.walk(Directions.South) ``` instead of ```lua g_game.walk(2) ``` in cavebot waypoint Functions. Was in a situation where I needed the cavebot to walk exactly 1 sqm south, and the cavebot's built-in "Go To" command is not reliable for that, when you need precision walking. commit 8f2959d Author: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri Jan 2 22:04:04 2026 +0100 fix: auto loot distance check (opentibiabr#1525) commit 4067a07 Author: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Fri Jan 2 16:01:03 2026 -0300 fix: violation rule Windows length opentibiabr#1519 (opentibiabr#1522) commit e4a07ec Author: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Thu Jan 1 17:02:18 2026 -0300 rollback: UIItem onClick fix vbot issues opentibiabr#1520 (opentibiabr#1521) commit 1e2da94 Author: Renato Machado <mehahx@gmail.com> Date: Tue Dec 30 19:08:27 2025 -0300 improve: use GameDoublePlayerGoodsMoney flag instead of version check for u64 money support commit b47799e Author: Gabriel Alcântara Bernardes <gabrielalcantaratp@gmail.com> Date: Tue Dec 30 16:40:47 2025 -0300 feat: stash stow items (opentibiabr#1480) commit a6856e0 Author: Renato Machado <mehahx@gmail.com> Date: Tue Dec 30 15:43:39 2025 -0300 Revert "fix: detection of Vorbis, VorbisFile and OGG in CMake for non-Windows targets (opentibiabr#1508)" This reverts commit 8b68c8b. commit 8b68c8b Author: grepwood <4225739+grepwood@users.noreply.github.com> Date: Tue Dec 30 18:30:42 2025 +0100 fix: detection of Vorbis, VorbisFile and OGG in CMake for non-Windows targets (opentibiabr#1508) commit 3fe17bf Author: Renato Machado <mehahx@gmail.com> Date: Tue Dec 30 13:20:28 2025 -0300 perf: parallelize draw pipeline (FOREGROUND starts collecting without waiting MAP preLoad) (opentibiabr#1510) commit 0c17f86 Author: Renato Machado <mehahx@gmail.com> Date: Tue Dec 30 13:20:17 2025 -0300 feat: add public config.ini support for client-exposed settings (opentibiabr#1513) commit b263bc8 Author: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Tue Dec 30 13:18:32 2025 -0300 fix: hook flag in protobuf opentibiabr#1482 (opentibiabr#1517) commit a43c1ca Author: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Tue Dec 30 13:18:17 2025 -0300 fix: modules html opentibiabr#1505 opentibiabr#1506 (opentibiabr#1516) commit ce858a2 Author: SkullzOTS <86809689+SkullzOTS@users.noreply.github.com> Date: Tue Dec 30 13:17:38 2025 -0300 fix: android (opentibiabr#1515) commit a7251bc Author: André Morais <andreoam@gmail.com> Date: Tue Dec 30 01:30:37 2025 -0300 fix: market value format (opentibiabr#1509) commit 6e2c568 Author: javiertringol <javier.tringo@gmail.com> Date: Mon Dec 29 14:04:56 2025 -0300 fix: opentibiabr#1501 Mouse Control Mode save (opentibiabr#1503) commit 285a906 Author: Renato Machado <mehahx@gmail.com> Date: Mon Dec 29 13:01:49 2025 -0300 perf: streamline DrawPool repaint flow and reduce hot-path overhead Refines the DrawPool repaint flow by simplifying canRepaint() and adjusting release() / repaint() to avoid unnecessary work. Reduces synchronization overhead by switching hot-path atomics to memory_order_relaxed (e.g. LightView, TextureAtlas), removes redundant logic in DrawPoolManager’s pre-draw flow, and makes draw-hash reset behavior more consistent. Results: +5.46% performance commit 5bbc87d Author: Renato Machado <mehahx@gmail.com> Date: Fri Dec 26 23:14:30 2025 -0300 chore: cleanup attachedEffect commit fe99915 Author: Renato Machado <mehahx@gmail.com> Date: Fri Dec 26 23:12:13 2025 -0300 feat: add followOwner flag to the attachedEffect system so effects can follow the owner during bounce commit ccdb09b Author: Renato Machado <mehahx@gmail.com> Date: Fri Dec 26 18:47:54 2025 -0300 fix: don’t force creature bounce on attached effects Attached effects should not automatically inherit the owner’s bounce. When needed, reuse the same bounce/elevation data used by the creature. For visuals that must always stay bound to the character (e.g., wings), use the paperdoll system. commit aafef1c Author: Renato Machado <mehahx@gmail.com> Date: Wed Dec 24 13:46:36 2025 -0300 feat: paperdoll (Ho Ho Ho!!!) (opentibiabr#1500) commit b3bee2b Author: Avaji <103899149+AvajiOT@users.noreply.github.com> Date: Tue Dec 23 14:41:31 2025 -0500 fix: Adding datdump cpp/h to vcxproj (opentibiabr#1499) commit 318ed83 Author: divinity76 <hans@loltek.net> Date: Tue Dec 23 19:18:15 2025 +0100 feat: add dat dump cli (opentibiabr#1492) commit 4ff2d4b Author: divinity76 <hans@loltek.net> Date: Tue Dec 23 18:09:41 2025 +0100 fix: handle floor-change tiles in walk logic (opentibiabr#1494) commit 3442323 Author: divinity76 <hans@loltek.net> Date: Tue Dec 23 18:04:21 2025 +0100 fix: f(char*) f(std::string) + replace c_str() with data() (opentibiabr#1485) commit 0005d3e Author: divinity76 <hans@loltek.net> Date: Tue Dec 23 18:04:06 2025 +0100 fix: optimize color tolower (opentibiabr#1490) commit 81ccbd8 Author: divinity76 <hans@loltek.net> Date: Tue Dec 23 18:03:48 2025 +0100 ci/cd: fix emscripten build (opentibiabr#1491) commit 7b132aa Author: Luan Luciano <luanluciano@outlook.com> Date: Sun Dec 21 12:06:28 2025 -0300 feat: compatibility with 15.11 (only bytes) Co-authored-by: kokekanon <114332266+kokekanon@users.noreply.github.com> commit 9d485b5 Author: divinity76 <hans@loltek.net> Date: Sat Dec 20 02:04:21 2025 +0100 fix: cleanup unused sha1 (opentibiabr#1486) commit dad1f4d Author: Renato Machado <mehahx@gmail.com> Date: Thu Dec 18 21:41:54 2025 -0300 fix(localplayer): avoid forced step to next tile when overlapping passable creatures (thx @nekiro) commit 0646982 Author: divinity76 <hans@loltek.net> Date: Tue Dec 16 17:06:20 2025 +0100 fix: capacity scaling for 7.6 protocol Co-authored-by: kokekanon <114332266+kokekanon@users.noreply.github.com> commit eb656a7 Author: Renato Machado <mehahx@gmail.com> Date: Sun Dec 7 16:07:50 2025 -0300 fix: avoid concurrent thing texture loading with atomic flag commit dc2ff31 Author: Renato Machado <mehahx@gmail.com> Date: Sun Dec 7 16:03:15 2025 -0300 fix: rare crash on close client commit 1d26861 Author: Renato Machado <mehahx@gmail.com> Date: Sat Dec 6 14:24:44 2025 -0300 fix(hash): resolve compilation issues on x86 platforms commit 730835a Author: Renato Machado <mehahx@gmail.com> Date: Fri Dec 5 23:33:10 2025 -0300 fix(hud): make crosshair and attached widgets respect HUD scale (fix opentibiabr#1436) commit 3aa478e Author: Renato Machado <mehahx@gmail.com> Date: Fri Dec 5 23:13:07 2025 -0300 fix(draw): wait for all draw pools to finish before processing next cycle (fix opentibiabr#1472) commit 8a0d43b Author: Renato Machado <mehahx@gmail.com> Date: Fri Dec 5 22:27:35 2025 -0300 fix(drawpool): set repaint flag only after preparing draw objects commit a47fdf2 Author: Renato Machado <mehahx@gmail.com> Date: Fri Dec 5 22:25:03 2025 -0300 feat(drawpool): add hash support to addAction commit cb29a60 Author: Renato Machado <mehahx@gmail.com> Date: Fri Dec 5 19:51:35 2025 -0300 fix: ThingType loading sets default boolean to false commit 66c2ad7 Author: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Tue Dec 2 11:04:00 2025 -0300 fix: skill Miniwindows in Old protocol (opentibiabr#1477) commit acc928e Author: Renato Machado <mehahx@gmail.com> Date: Sun Nov 30 20:53:30 2025 -0300 feat: add recursive loading for style files commit 8fa1bce Author: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Fri Nov 28 14:42:43 2025 -0300 fix: protocol 12.91 (opentibiabr#1478) commit fa77ad0 Author: Renato Machado <mehahx@gmail.com> Date: Mon Nov 24 21:21:08 2025 -0300 improve: use `addEvent` instead of `scheduleEvent` to trigger the `onGameStart` event commit fc57601 Author: Renato Machado <mehahx@gmail.com> Date: Mon Nov 24 20:03:01 2025 -0300 feat: enable atlas in UI (opentibiabr#1471) commit 806c9c7 Author: Renato Machado <mehahx@gmail.com> Date: Mon Nov 24 19:51:52 2025 -0300 chore: cleanup leftover anti-bot logic commit 7d57547 Author: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Sun Nov 23 21:56:52 2025 -0300 fix: compilation Encryption Mode (opentibiabr#1474) commit c0dd2a7 Author: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Sun Nov 23 21:56:46 2025 -0300 fix: compilation in FRAMEWORK_EDITOR (opentibiabr#1473) commit 7cd36e2 Author: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Sat Nov 22 10:23:43 2025 -0300 fix: prevent ERROR: /game_battle/battle.lua:20: stack overflow (opentibiabr#1470) commit 8ffba36 Author: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Fri Nov 21 20:55:38 2025 -0300 fix: opentibiabr#1460 Failed to fetch sprite (opentibiabr#1468) commit 34c52dc Author: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Fri Nov 21 16:21:07 2025 -0300 fix. NPC message text duplication in console (opentibiabr#1469) commit a6ee810 Author: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Thu Nov 20 21:49:23 2025 -0300 fix: prevent WARNING: Lua warning: member function call skipped becau… (opentibiabr#1467) commit f726bb0 Author: SkullzOTS <86809689+SkullzOTS@users.noreply.github.com> Date: Thu Nov 20 16:55:02 2025 -0300 feat: dragging item icon (opentibiabr#1466) commit 67460c0 Author: Eduardo Dantas <eduardo.dantas@hotmail.com.br> Date: Thu Nov 20 02:08:02 2025 -0300 refactor: string encoding to use utf8cpp and add tests (opentibiabr#1443) Update string encoding implementation to use utf8cpp This change updates the string encoding implementation to use the utf8cpp library for improved robustness and consistency across platforms. It refactors the encoding functions in src/framework/stdext/string.cpp, adds comprehensive unit tests, updates build configurations to include utf8cpp, and documents the new encoding policy and behavior. String encoding improvements Refactored all string encoding functions in src/framework/stdext/string.cpp to use the utf8cpp library, providing strict UTF-8 validation, robust conversions between UTF-8, Latin-1, and UTF-16, and consistent error handling. Added a new documentation file docs/string-encoding-policy.md detailing the updated encoding policy, error handling, dependencies, and testing strategy. Testing enhancements Added a new unit test suite in tests/stdext/string_encoding_test.cpp covering UTF-8 validation, conversions, roundtrip consistency, control character handling, and platform-specific UTF-16 conversions. Updated the test build configuration to include the new test directory and sources. Build system updates Updated src/CMakeLists.txt to require and link the utf8cpp library for all platforms, ensuring proper integration. Added utf8cpp as a dependency in vcpkg.json for package management. commit bf6e3c5 Author: cynio <dominik.smolinski19@gmail.com> Date: Wed Nov 19 22:32:45 2025 +0100 fix(game_console): WASD toggle for game_hotkeys (opentibiabr#1461)
I know this is two weeks old but as I never stopped playing real tibia, I can say for sure that it was NEVER POSSIBLE to loot from distance, also, in real tibia we don't have "auto loot" but "quick loot", and yes the corpse should always be in your range in order for the quick loot to work, because you still have to click the corpse there was never a premium feature or anything like that, that allowed autoloot from distance, this gunzodus post is totally shit |
|
Well does anybody want to craft a PR to remove the version check for the distance looting fix? |



Fix vBot_4.8 auto loot corpse distance issue
The issue: vBot thinks corpses are lootable without being adjacent (touching) them. On Tibia 7.6, you must be at distance 1 (adjacent) to loot corpses:
Root cause: The looting code didn't account for version differences. CipSoft added support for looting corpses from larger distance at some point after version 760.
Changes made:
g_game.getClientVersion()Files modified:
mods/game_bot/default_configs/vBot_4.8/targetbot/looting.luamods/game_bot/default_configs/cavebot_1.3/targetbot/looting.luaPlan:
Security Summary: No security vulnerabilities introduced. These are configuration changes to Lua bot scripts that only affect game behavior based on client version.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.