• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Feature [TFS 1.2]+ Advanced Auto Loot System

Nekiro

Legendary OT User
TFS Developer
Joined
Sep 7, 2015
Messages
2,677
Solutions
126
Reaction score
2,112
Hi, today I release system exclusively written to be released publicly. I noticed that we don't have a good auto loot system here on otland, so that's why. It was tested on latest tfs 1.3 master branch, but it should work in any 1.x version probably.

How does it work?
Clicking on corpse will loot the corpse, only corpse owners can auto loot the corpse, in addition to that you can choose to which backpack it should loot the item.
The configuration is also very easy! Just put the code and that's it.

Players can easily write their items into a list that will be parsed then and converted into auto loot config, configs are saved in database.

Example list:
ungz5FM.png


Any means it will loot to anywhere, your main backpack including.

To send that window to player use, player:sendAutoLootWindow() method.

You can find the changes required to add this function to your server in my fork of forgottenserver, branch autoloot_system.
Link: nekiro/forgottenserver (https://github.com/nekiro/forgottenserver/tree/autoloot_system)

Enjoy, let me know if you liked it!
 
Is this working flawlessly for you guys?

I'm using TFS 1.2
Looting only applies to main backpack(unless full)
If full, nothing happens(No errors). Haven't looked into why yet, might have to do something with my former adjustments to the server.
Writing out specific items to specific containers has no effect for me as well.
Just thought I'd write this before taking a look, to know if it's because of something in just my server or not.
 
Is this working flawlessly for you guys?

I'm using TFS 1.2
Looting only applies to main backpack(unless full)
If full, nothing happens(No errors). Haven't looked into why yet, might have to do something with my former adjustments to the server.
Writing out specific items to specific containers has no effect for me as well.
Just thought I'd write this before taking a look, to know if it's because of something in just my server or not.
Could you do more testing or elaborate actually all wrong behaviour that should be fixed? I'll fix that in my free time.
 
here is a compare for people for easy access

Post automatically merged:

Also would it be possible to make it so it loots on kill instead of on corpse open?
 
Last edited:
Player.cpp code has this erro

Code:
identifier "StringVector" is undefined

Lastest stable tfs
 
for those using the source in "releases" make these edits

add this too tool.h
C++:
using StringVector = std::vector<std::string>;

and in the code change these
From
C++:
Database& db = Database::getInstance();

too
C++:
Database* db = Database::getInstance();

and from
C++:
if (DBResult_ptr result = db.storeQuery(query.str())) {

too

C++:
if (DBResult_ptr result = db->storeQuery(query.str())) {
 
for those using the source in "releases" make these edits

add this too tool.h
C++:
using StringVector = std::vector<std::string>;

and in the code change these
From
C++:
Database& db = Database::getInstance();

too
C++:
Database* db = Database::getInstance();

and from
C++:
if (DBResult_ptr result = db.storeQuery(query.str())) {

too

C++:
if (DBResult_ptr result = db->storeQuery(query.str())) {

Nope nope.

I confirmed in this thread:
That it builds just fine if your TFS codebase is up-to-date.

The errors are specific to you, due to old sources.
Gj sorting it out though.
 
Nope nope.

I confirmed in this thread:
That it builds just fine if your TFS codebase is up-to-date.

The errors are specific to you, due to old sources.
Gj sorting it out though.
That is why i said the source in "releases" as that is what i am using, and i downloaded less then a week ago so its not that old. Releases section has to be manually updated, and the last time it was, was 443 commits ago, which my guess is when they added in the vectorstring

You can download and check for yourself, i promise i am not wrong.

Untitled.png
 
talkactions for tfs 1.2??
Post automatically merged:

I don't understand how to use it, I installed everything, but I don't know how to add items to the list ..., regards
 
Last edited:
Any specifics for "create a talkaction and add player:sendAutoLootWindow() to it"? Tried multiple things and only been getting errors (I'm new if you couldn't tell).
 
Any specifics for "create a talkaction and add player:sendAutoLootWindow() to it"? Tried multiple things and only been getting errors (I'm new if you couldn't tell).

if you are using tfs 1.4 or newer just create a .lua file inside data/scripts

and put this:
Lua:
local talkaction = TalkAction("!autoloot")

function talkaction.onSay(player, words, param, type)
    player:sendAutoLootWindow()
    return true
end

talkaction:register()
 
Sorry I didn't clarify @Evil Puncker, I'm currently on TFS 1.2 :{

please don't. it is 6 years old and missing lots of features and bugfixes
if you can, move to 1.4.1 as soon as possible

but if you still want 1.2 (highly not recommended) create autoloot.lua at data/talkactions/scripts:

Lua:
function onSay(player, words, param)
    player:sendAutoLootWindow()
    return false
end

and add to data/talkactions/talkactions.xml
XML:
<talkaction words="!autoloot" script="autoloot.lua" />
 
Ah dang, didn't realize it was that bad. Sorry to keep bothering, is there any way guide to swap to 1.4.1?
 
Back
Top