Author Topic: Looting error Queue Empty  (Read 4763 times)

0 Members and 1 Guest are viewing this topic.

Offline BlacklistedTopic starter

  • Jr. Member
  • **
  • Posts: 75
  • Activity:
    0%
  • Reputation Power: 2
  • Blacklisted has no influence.
  • Respect: +13
  • Referrals: 0
    • View Profile
Looting error Queue Empty
« on: June 08, 2016, 11:20:57 AM »
0
****I posted in the wrong section can it be moved*****

I've been trying to code a script to loot gold from corpses.
I am getting the error Queue Empty at what seems to be very random times so I was thinking would lag be affecting it some way.
I am not using Queues tho just lists so should I even be seeing that error. Anyone see what might be wrong.
the code falls on the line

Code: [Select]
var corpses = Item.Find(typeof(Corpse), 0x0, false);

Code: [Select]
public  void StartLooting()
        {
            List<Item> lootItems = new List<Item>();
            Thread.Sleep(500);
            
            try
            {
                while (Looting)
                {
                    var corpses = Item.Find(typeof(Corpse), 0x0, false);
                    if (corpses.Count > 0)
                    {
                        foreach (Corpse corpse in corpses)
                        {
                            if (corpse.Distance < 4)

                            {
                                corpse.DoubleClick();
                            }                            

                            Thread.Sleep(500);

                            var goldList = Item.Find(typeof(Gold), corpse.Serial.Value, false);

                            foreach (Gold gold in goldList)
                            {
                                lootItems.Add(new Loot(gold.Serial));
                            }

                            if (lootItems.Any())
                            {
                                foreach (Item loot in lootItems)
                                {
                                    loot.MoveItem(Player.Backpack);
                                }
                            }
                            Looting = false;
                            Thread.Sleep(500);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                this.Dispatcher.Invoke((Action)(() =>
                {
                    Clipboard.SetText(e.StackTrace);
                    listBox.Items.Clear();
                    listBox.Items.Add(e);
                }));                
            }
        }

Here's the stack trace.

Code: [Select]
  at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.Queue`1.Dequeue()
   at StealthAPI.StealthClient.WaitReply[T](PacketType type)
   at StealthAPI.StealthClient.SendPacket[T](PacketType packetType, Object[] parameters)
   at StealthAPI.Stealth.FindTypeEx(UInt16 objType, UInt16 color, UInt32 container, Boolean inSub)
   at ScriptSDK.Engines.Scanner.<>c__DisplayClass23_2`1.<Find>b__2(UInt32 le)
   at System.Linq.Enumerable.<>c__DisplayClass6_0`1.<CombinePredicates>b__0(TSource x)
   at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
   at System.Linq.Enumerable.<SelectManyIterator>d__22`3.MoveNext()
   at System.Linq.Enumerable.<SelectManyIterator>d__16`2.MoveNext()
   at System.Linq.Enumerable.<SelectManyIterator>d__16`2.MoveNext()
   at ScriptSDK.Engines.Scanner.Find[T](List`1 Graphics, List`1 Colors, List`1 Locations, Boolean SubSearch)
   at ScriptSDK.Items.Item.Find(Type type, List`1 Locations, Boolean SubSearch)
   at ScriptSDK.Items.Item.Find(Type type, UInt32 Location, Boolean SubSearch)
   at AutoLoot.MainWindow.StartLooting() in C:\Users\GreyWalker\Desktop\UOStuff\Projects\AutoLoot\MainWindow.xaml.cs:line 58
« Last Edit: June 08, 2016, 03:55:32 PM by Blacklisted »

Offline BlacklistedTopic starter

  • Jr. Member
  • **
  • Posts: 75
  • Activity:
    0%
  • Reputation Power: 2
  • Blacklisted has no influence.
  • Respect: +13
  • Referrals: 0
    • View Profile
Re: Looting error Queue Empty
« Reply #1 on: June 08, 2016, 03:56:35 PM »
0
OK so I got round it by just calling the method again in the catch, very messy and doesn't solve the problem tho.

Offline Drabadan

  • Jr. Member
  • **
  • Posts: 28
  • Activity:
    0%
  • Reputation Power: 1
  • Drabadan has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Looting error Queue Empty
« Reply #2 on: July 08, 2016, 12:11:48 PM »
0
it's the bug of dll, don't worry. The Stealth currently migrating to 7.x version and there are still a lot of bugs. All of that will be fixed, i think in about few years...  :'(

Tags: