Log in

View Full Version : Tillmen's "loot"



nunye
12-02-2016, 06:12 PM
Is there a setting in ;loot that will let you loot kills that aren't yours? Or another version that can be run as need to do so? I really like the simplicity of (and my own loot script no longer works!), but I'd like to have one that will work when I'm group hunting with friends.

Tgo01
12-02-2016, 06:19 PM
;loot requires you to attack a critter before it will loot it, I'm not sure if it requires actually doing damage or just looks for if you cast/swung at a critter regardless of if you hit it.

nunye
12-02-2016, 07:07 PM
I'm pretty sure it requires it to be the kill, but I'll double check.

EDIT: Double checked. It does need to be the kill.

Tgo01
12-02-2016, 07:32 PM
I'm pretty sure it requires it to be the kill, but I'll double check.

EDIT: Double checked. It does need to be the kill.

Looking at the code it looks like you're right.

I think Tillmen said since the script is automated he set it up to err on the side of caution rather than being overly aggressive in looting things.

I'm not aware of an option to have ;loot loot everything in the room like ;sloot does.

Donquix
12-02-2016, 08:12 PM
as obviously the problem becomes you taking other people's kills (yes, they should have grouploot on)

I guess if you had it only loot other people's kills if no PC, no disk (or disk like object) was in the room. Add a white list like if otherchar == Dreaven fuck it, take his shit.

Tgo01
12-02-2016, 08:14 PM
as obviously the problem becomes you taking other people's kills (yes, they should have grouploot on)

I guess if you had it only loot other people's kills if no PC, no disk (or disk like object) was in the room. Add a white list like if otherchar == Dreaven fuck it, take his shit.

:(

SashaFierce
12-02-2016, 08:15 PM
If you don't mind running it manually as needed, just use ;sloot

nunye
12-02-2016, 08:23 PM
Ah well. Guess I'll get mine working, thanks!

Tgo01
12-02-2016, 08:39 PM
Ah well. Guess I'll get mine working, thanks!

You can easily get the script to auto loot dead things you have attacked if you do the following:

Make the very first line of the script:

candidates = Array.new

Then either delete line 417 (which is candidates = Array.new) or put a # symbol as the first character of that line (so it looks like #candidates = Array.new)

This should make it so you autoloot everything you have attacked, rather than just what you got the killing blow on.

EDIT: Although I just realized it will only loot things after you have attacked something so it might not work perfectly.

Tillmen
12-03-2016, 08:06 PM
I intended to add this feature, but never got around to it. The proper way to do it is to add an array of names of whose kills you want to loot, and edit line 608 so it watches for their attacks as well as your own. And then make the list of names configurable like the rest of the options.

Line 608 would first need to be editing so that it accepts the other characters names instead of only "You".
from:

elsif (line =~ /You (?:swing|gesture|sing|weave another verse|...
to:

elsif (line =~ /(?:You|<.*?>(?:#{$loot_poachable_names.join('|')})<.*?>) (?:swing|gesture|sing|weave another verse|...
Then, you'd have to change all the known attack messages so they accept the third person message as well:

elsif (line =~ /(?:You|<.*?>(?:#{$loot_poachable_names.join('|')})<.*?>) (?:swings?|gestures?|sings?|weaves? another verse|...
To get it working perfectly, you'd probably have to change some more stuff too, like the messages for weapon fire, call lightning, holy bolt, pestilence, and other delayed kill spells that are detected farther down in the script. If you're hunting with an archer, the script might also start stealing their arrows.

If you get it working well, send it to me and I'll upload it to the repo.

BigWorm
12-07-2016, 01:33 AM
I have a separate script I call ;forceloot that tells ;loot to search everything the room:



start_script "loot" unless running? "loot"
GameObj.npcs.select { |npc| npc.status == 'dead' } .each do |npc|
echo "Forcing loot for #{npc.name} (##{npc.id})"
$loot_dead_npcs.push(npc.id)
end