Empty Container

Datum: 27/07/2011 01:08:45

Staženo: 288x

Popis:

vybere z baglu/těla itemy..


Hodnocení: 5.0/10 (31 hlasy)

Download file:cs

Příkazy:

  • ,luxovani "int pause"
  • ,lootall "int pause"

Kód:

    using System;
    using System.Collections.Generic;
    using System.Text;
    using Phoenix;
    using Phoenix.WorldData;

    namespace Phoenix.Scripts
    {
        public class Emptycontainer
        {
         [Command("luxovani")]
            public void luxing(int pause)
            {
                UOItem source = World.GetItem(UIManager.TargetObject());
                bool lootTimer = false;
                if (!source.Exist)
                    UO.Print("Toto nemuzes zamerit!");
                if (!source.Opened)
                {
                    using (ItemOpenedEventWaiter ew = new ItemOpenedEventWaiter(source))
                    {
                        source.Use();
                        if (!ew.Wait(2000))
                            UO.PrintWarning("Unable to open container to empty.");
                    }
                }
                UO.DeleteJournal();
                foreach (UOItem lootItem in source.Items)
                {
                    if (source.Opened)
                    {
                        if (source.Distance < 6)
                        {
                            if (lootTimer == false)
                            {
                                UO.MoveItem(lootItem, 10000, Aliases.Backpack);
                                UO.Wait(pause);
                                if (Journal.Contains("Jeste nemuzes vzit dalsi vec."))
                                {
                                    lootTimer = true;
                                    UO.Wait(2000);
                                    UO.MoveItem(lootItem, 10000, Aliases.Backpack);
                     UO.Wait(2000);
                                }
                            }
                            else
                            {
                                using (JournalEventWaiter waiter = new JournalEventWaiter(true, "...akce skoncila"))
                                {
                                    UO.MoveItem(lootItem, 10000, Aliases.Backpack);
                                    if (!waiter.Wait(5000))
                                    {
                                        UO.PrintError("Loot waiting timeout");
                                        return;
                                    }
                                }
                            }
                        }
                        else
                        {
                            UO.PrintInformation("Luxovani preruseno z duvodu velke vzdalenosti od zdroje.");
                            return;
                        }
                    }
                    else
                    {
                        UO.PrintInformation("Luxovani preruseno z duvodu zavreni zdroje.");
                        return;
                    }
                }
            }

          [Command("lootall")]
            public void lootalll(int pause)
            {
                UOItem source = World.GetItem(UIManager.TargetObject());
                bool lootTimer = false;
                if (!source.Exist)
                    UO.Print("Toto nemuzes zamerit!");
                if (!source.Opened)
                {
                    using (ItemOpenedEventWaiter ew = new ItemOpenedEventWaiter(source))
                    {
                        source.Use();
                        if (!ew.Wait(2000))
                            UO.PrintWarning("Unable to open container to empty.");
                    }
                }
                UO.DeleteJournal();
                foreach (UOItem lootItem in source.Items)
                {
                    if (source.Opened)
                    {
                        if (source.Distance < 6)
                        {
                            if (lootTimer == false)
                            {
                                UO.MoveItem(lootItem, 10000, Aliases.Backpack, 150, 170);
                                UO.Wait(pause);
                                if (Journal.Contains("Jeste nemuzes vzit dalsi vec."))
                                {
                                    lootTimer = true;
                                    UO.Wait(2000);
                                    UO.MoveItem(lootItem, 10000, Aliases.Backpack, 150, 170);
                     UO.Wait(2000);
                                }
                            }
                            else
                            {
                                using (JournalEventWaiter waiter = new JournalEventWaiter(true, "...akce skoncila"))
                                {
                                    UO.MoveItem(lootItem, 10000, Aliases.Backpack, 150, 170);
                                    if (!waiter.Wait(5000))
                                    {
                                        UO.PrintError("Loot waiting timeout");
                                        return;
                                    }
                                }
                            }
                        }
                        else
                        {
                            UO.PrintInformation("Luxovani preruseno z duvodu velke vzdalenosti od zdroje.");
                            return;
                        }
                    }
                    else
                    {
                        UO.PrintInformation("Luxovani preruseno z duvodu zavreni zdroje.");
                        return;
                    }
                }
            }

        }
    }
Zde ještě není žádný komentář.

Nový komentář