Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7719235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:21:53+00:00 2026-06-01T03:21:53+00:00

Ive got this problem: Line 20 (LOOT_FromContainer(container) I need that to use as Invoke

  • 0

Ive got this problem:

Line 20 (LOOT_FromContainer(container) I need that to use as Invoke, because the process I want to exec takes some time, so ServerMessageHandler won’t handle it…

If I just simply rewrite that line to LOOT_FromContainer.BeginInvoke(container); then I have this error:

error CS0119: ‘LOOT.LOOT_FromContainer(Phoenix.Serial)’ is a ‘method’,
which is not valid in the given context

I’m new to C#, came from PHP, and about Invoke I don’t know much really. I’ve been trying to sort this out for a couple of days, not even google helped…

  [ServerMessageHandler(0x3C)]
  public CallbackResult ContainerContains(byte[] data, CallbackResult prevResult)
  {
     PacketReader reader = new PacketReader(data);
     reader.Skip(3);

     ushort len = reader.ReadUInt16();
     for (int i = 0; i < len; i++)
     {
        Serial serial = (Serial)(reader.ReadUInt32());
        ushort graphic = (ushort)(reader.ReadUInt16());

        reader.Skip(7);

        Serial container = (Serial)(reader.ReadUInt32());
        ushort color = (ushort)(reader.ReadUInt16());

        if (((int)graphic == 0x0E76) && ((int)color == 0x049A))
        {
           LOOT_FromContainer.BeginInvoke(container);
        }
     }
     return CallbackResult.Normal;
  }

  [Command]
  public static void LOOT_FromContainer(Serial target)
  {
        UOItem lootCorpse = new UOItem(target);
        if (lootCorpse.Graphic == 0x2006)
        {
            if (((draw == 1) && (World.Player.Backpack.AllItems.Count(draw_knife[0], draw_knife[1]) > 0)) || (World.Player.Layers[Layer.RightHand].Exist))
            {
                if ((lootCorpse.Amount != 400) && (lootCorpse.Amount != 401))
                {
                    if (draw == 0)
                    {
                        UO.WaitTargetObject(lootCorpse);
                        UO.UseObject(World.Player.Layers[Layer.RightHand].Serial);
                    }
                    else
                    {
                        UO.WaitTargetObject(lootCorpse);
                        UO.UseType(draw_knife[0], draw_knife[1]);
                    }
                    UO.Wait(500);
                }
            }
            else
        {
               UO.Print("Neni cim rezat, pouze lootim");
        }

            for (int i = 0; i < loot.Length; i++)
            {
           if (lootCorpse.Items.Count(loot[i][0], loot[i][1]) > 0)
                {
              if (loot[i][2] == 1)
              {
                 if (loot[i][4] == 1)
                 {
                    UO.MoveItem(lootCorpse.Items.FindType(loot[i][0], loot[i][1]), 0, Aliases.GetObject("loot_bag"), loot[i][5], loot[i][6]);
                      UO.Wait(200);
                 }
                 else
                 {
                    UO.MoveItem(lootCorpse.Items.FindType(loot[i][0], loot[i][1]), 0, World.Player.Backpack);
                        UO.Wait(200);
                 }
              }
                }
            }
        }
  }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T03:21:54+00:00Added an answer on June 1, 2026 at 3:21 am

    I think this is what you need. You need to declare a delegate with the same return type and input parameters as your method, instantiate this delegate pointing it at your method and then call BeginInvoke on it passing in your serial variable, followed by null, null:

    public delegate void LFC(Serial target);
    
    [ServerMessageHandler(0x3C)]
      public CallbackResult ContainerContains(byte[] data, CallbackResult prevResult)
      {
       PacketReader reader = new PacketReader(data);
       reader.Skip(3);
    
       ushort len = reader.ReadUInt16();
       for (int i = 0; i < len; i++)
       {
          Serial serial = (Serial)(reader.ReadUInt32());
          ushort graphic = (ushort)(reader.ReadUInt16());
    
          reader.Skip(7);
    
          Serial container = (Serial)(reader.ReadUInt32());
          ushort color = (ushort)(reader.ReadUInt16());
    
        LFC = lootfromcontainer = new LFC(LOOT_FromContainer);
    
          if (((int)graphic == 0x0E76) && ((int)color == 0x049A))
          {
            lootfromcontainer.BeginInvoke(container, null, null);
             //LOOT_FromContainer.BeginInvoke(container);
          }
       }
       return CallbackResult.Normal;
      }
    
    
    [Command]
    public static void LOOT_FromContainer(Serial target)
    {
       UOItem lootCorpse = new UOItem(target);
          if (lootCorpse.Graphic == 0x2006)
          {
              if (((draw == 1) && (World.Player.Backpack.AllItems.Count(draw_knife[0], draw_knife[1]) > 0)) || (World.Player.Layers[Layer.RightHand].Exist))
              {
                  if ((lootCorpse.Amount != 400) && (lootCorpse.Amount != 401))
                  {
                      if (draw == 0)
                      {
                          UO.WaitTargetObject(lootCorpse);
                          UO.UseObject(World.Player.Layers[Layer.RightHand].Serial);
                      }
                      else
                      {
                          UO.WaitTargetObject(lootCorpse);
                          UO.UseType(draw_knife[0], draw_knife[1]);
                      }
                      UO.Wait(500);
                  }
              }
              else
          {
                 UO.Print("Neni cim rezat, pouze lootim");
          }
    
              for (int i = 0; i < loot.Length; i++)
              {
             if (lootCorpse.Items.Count(loot[i][0], loot[i][1]) > 0)
                  {
                if (loot[i][2] == 1)
                {
                   if (loot[i][4] == 1)
                   {
                      UO.MoveItem(lootCorpse.Items.FindType(loot[i][0], loot[i][1]), 0, Aliases.GetObject("loot_bag"), loot[i][5], loot[i][6]);
                        UO.Wait(200);
                   }
                   else
                   {
                      UO.MoveItem(lootCorpse.Items.FindType(loot[i][0], loot[i][1]), 0, World.Player.Backpack);
                          UO.Wait(200);
                   }
                }
                  }
              }
          }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm been pounding on this problem all day. I've got a LinqDataSource that
Has anyone else run into this problem before? I've got a method that calls
I've got a problem with inheritance and generics. This is the code that illustrates
I've got this silly problem (called Internet Explorer) that keeps breaking on something that
I've got two columns and i need to add line between them. This is
I've got this weird problem - I'm calling ChangeServiceConfig on a newly installed service
I've got this nasty problem where sending multiple, large messages in quick succession from
I’ve got this strange problem whereby the content within a scroll viewer increases in
I know I've had this problem before so I'm really frustrated. I've got the
The responses I've got to this question have solved the problem I had in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.