13440130

Member
13440130 submitted a new resource:

Player Auto-Loot Corpse Item - AutoLoot

I wrote a functional script for AutoLoot using DeepSeek​

Auto-Loot Script Functionality Description​

1. Core Features

  • Auto-Loot Configuration: Players can open a configuration interface (Gump) by entering the AutoLootcommand to manage the list of items to be auto-looted.
    • Add Items: By clicking the "Add Item" button, players can select a target item, and the system will record its type...

Read more about this resource...
 
Thanks you very much, there is also seems to have an issue on my shard everything work except for the looting part. the gump show up when the command prompt is done, we can add item etc... but if i had gold and try to kill a monster, open the corpse nothing hppen eve if i change the delay in the script to a longer or shorter one... Any Idea ?
 
Thanks you very much, there is also seems to have an issue on my shard everything work except for the looting part. the gump show up when the command prompt is done, we can add item etc... but if i had gold and try to kill a monster, open the corpse nothing hppen eve if i change the delay in the script to a longer or shorter one... Any Idea ?
To be honest, I don't understand English. If possible, you'd better record a motion picture to express the problem. I recommend gifcam
 
The corpse.cs edit does not say where to add it in the .cs
In zip read Corpse Edit.txt

using System;
using Server.Mobiles;
using Server.Network;
using Server.Scripts.Custom;

edit:
public partial class Corpse
    {
        public override void Open(Mobile from, bool checkSelfLoot)
        {
            base.OnDoubleClick(from, checkSelfLoot);
            // add autoloot
                if (from is PlayerMobile && from.Backpack != null)
                {
                    PlayerMobile pm = (PlayerMobile)from;
                    Timer.DelayCall(TimeSpan.FromMilliseconds(100), () =>
                    {
                        ProcessAutoLoot(pm);
                    });
                }
        }

        private void ProcessAutoLoot(PlayerMobile pm)
        {
            AutoLootProfile profile = AutoLootProfile.GetProfile(pm);
            bool looted = false;

            foreach (Item item in Items.ToArray())
            {
                string itemType = item.GetType().Name;
                if (profile.LootItems.Exists(x => x.TypeName == itemType))
                {
                    if (pm.Backpack.TryDropItem(pm, item, false))
                    {
                        pm.SendMessage(68, "AutoLoot: {0}", itemType);
                        looted = true;
                    }
                }
            }

            if (looted)
            {
                pm.Send(new ContainerContentUpdate(this));
                pm.Send(new ContainerContent(pm, this));
            }
        }
    }
 

Attachments

  • Corpse Edit.txt
    1.4 KB · Views: 0
Last edited:
can you attach your corpse.cs file? so we can see how yours is?

Errors:
+ Items/Corpses/Corpse.cs:
CS1022: Line 1601: Type or namespace definition, or end-of-file expected

I've tried placing it in different spots, adding or removing } or { and no luck so if you could upload your corpse.cs, it would help. Thank you
 
Last edited:
can you attach your corpse.cs file? so we can see how yours is?

Errors:
+ Items/Corpses/Corpse.cs:
CS1022: Line 1601: Type or namespace definition, or end-of-file expected

I've tried placing it in different spots, adding or removing } or { and no luck so if you could upload your corpse.cs, it would help. Thank you
 

Attachments

  • Corpse.cs
    37.5 KB · Views: 6
Thank you. You don't have that edit placed anywhere near or even in the same layout as your text file says to do. your file works though, as long as i edit out 1 line

CS0234: Line 1387: The type or namespace name 'CharacterDatabase' does not exist in the namespace 'Server.Items' (are you missing an assembly reference?)

once I commented that line out, it works fine so far. Thank you
 
Hello. I can't seem to get the system to work without that CharacterDatabase.LootContainer line. The server won't complie with it in, but the autoloot won't work with it out. I pull up the gump, add items, it loots the items, then locks the server and I have to reboot it.
 
Hello. I can't seem to get the system to work without that CharacterDatabase.LootContainer line. The server won't complie with it in, but the autoloot won't work with it out. I pull up the gump, add items, it loots the items, then locks the server and I have to reboot it.
C#:
Server.Items.CharacterDatabase.LootContainer( from, this );
This is another code related to the picking system in my server
You can delete this sentence, it won't affect anything
 
Ok, there must be something else then. It will pickup whatever I add to the list but then lockup the server for this character. every other character works fine
 

Active Shards

Donations

Total amount
$0.00
Goal
$500.00
Back