예제 #1
0
        internal void InvokeTraining(bool returnToStart)
        {
            if (AccountsPanel.CheckedIndices.Count < 1)
            {
                LogPanel.Log("E: Check the accounts you want to move");
                return;
            }

            Toggle(false);

            foreach (int index in AccountsPanel.CheckedIndices)
            {
                AccountsPanel.Engine[index].Mover.RefreshRoom();
                AccountsPanel.Engine[index].Mover.ReturnToStartHandler.SetOriginal();
                ThreadEngine.DefaultInstance.Enqueue(AccountsPanel.Engine[index].Mover.Train);
            }

            // TODO this needs to go - convert to ThreadPool
            ThreadEngine.DefaultInstance.ProcessAll();

            if (returnToStart)
            {
                foreach (int index in AccountsPanel.CheckedIndices)
                {
                    AccountsPanel.Engine[index].Mover.ReturnToStartHandler.InvokeReturn();
                    // TODO not necessary to thread this - it already is threaded
                    //InvokeReturn(index);
                }
            }

            Toggle(true);
        }
예제 #2
0
        internal void DoAttackRooms(List <int> rooms)
        {
            Account mAccount = AccountsPanel.Engine.MainAccount;

            foreach (int rm in rooms)
            {
                if (!Globals.AttackMode || mAccount.Mover.Location == null)
                {
                    goto quit;
                }

                Globals.AttackOn = false;

                mAccount.Mover.PathfindTo(rm);

                if (!Globals.AttackMode)
                {
                    goto quit;
                }

                Globals.AttackOn = true;

                AccountsPanel.Engine.MainAccount.Mover.Location.Attack();
                if (!Globals.AttackOn)
                {
                    return;
                }
            }
            return;

quit:
            LogPanel.Log("Rooms coverage quit");
            StopAttacking(true);
        }
예제 #3
0
        internal void AttackMobs()
        {
            if (MobsPanel.CheckedIndices.Count < 1)
            {
                LogPanel.Log("E: Choose at least 1 mob to attack");
                return;
            }

            // sort by value - ie., sort by room number
            List <AttackHandler.MobArg> mobs = new List <AttackHandler.MobArg>();

            foreach (int i in MobsPanel.CheckedIndices)
            {
                int    id   = int.Parse(MobsPanel.Mobs[i].SubItems[1].Text);
                int    room = int.Parse(MobsPanel.Mobs[i].SubItems[2].Text);
                string name = MobsPanel.Mobs[i].SubItems[0].Text;
                AttackHandler.MobArg arg = new AttackHandler.MobArg(id, room, name);
                if (!mobs.Contains(arg))
                {
                    mobs.Add(arg);
                }
            }
            mobs.Sort(
                delegate(
                    AttackHandler.MobArg first,
                    AttackHandler.MobArg second)
            {
                return(second.RoomId.CompareTo(first.RoomId));
            }
                );

            SetUpHandler();
            AttackHandler.BeginMobs(mobs);
        }
예제 #4
0
        internal void DoAttackArea()
        {
            Globals.AttackOn = true;

            AccountsPanel.Engine.MainAccount.Mover.CoverArea();

            if (!Globals.AttackMode)
            {
                LogPanel.Log("Single-area coverage quit");
                StopAttacking(true);
            }
        }
예제 #5
0
        internal void InvokePathfind(int room)
        {
            if (AccountsPanel.CheckedIndices.Count < 1)
            {
                LogPanel.Log("E: Check the accounts you want to move");
                return;
            }
            if (!Pathfinder.Exists(room))
            {
                LogPanel.Log("E: Select a room that exists in the map database.  If you are moving to a mob, its room information may be invalid.");
                return;
            }

            InvokeBulkMove(room);
        }
예제 #6
0
        private void reloadMapDataToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Toggle(false);
            Pathfinder.Rooms.Clear();
            Pathfinder.Mobs.Clear();
            Pathfinder.Spawns.Clear();
            Pathfinder.Adventures.Clear();

            LogPanel.Log("Downloading map data...");
            ThreadEngine.DefaultInstance.DoParameterized(Pathfinder.BuildMap, true);

            LogPanel.Log("Rebuilding views...");
            BuildViews();

            LogPanel.Log("Done.");
            Toggle(true);
        }
예제 #7
0
        internal void DoAttackMultiAreas(Dictionary <int, string> rooms)
        {
            // TODO shouldn't need room name as string...

            Account       mAccount = AccountsPanel.Engine.MainAccount;
            List <string> done     = new List <string>();

            foreach (int rm in rooms.Keys)
            {
                if (!Globals.AttackMode || mAccount.Mover.Location == null)
                {
                    goto quit;
                }

                if (done.Contains(rooms[rm]))
                {
                    continue;
                }

                done.Add(rooms[rm]);

                Globals.AttackOn = false;

                mAccount.Mover.PathfindTo(rm);

                if (!Globals.AttackMode)
                {
                    goto quit;
                }

                Globals.AttackOn = true;

                AccountsPanel.Engine.MainAccount.Mover.CoverArea();

                if (!Globals.AttackOn || !Globals.AttackMode)
                {
                    goto quit;
                }
            }
            return;

quit:
            LogPanel.Log("Multi-area coverage quit");
            StopAttacking(true);
        }
예제 #8
0
        internal void AttackAreas()
        {
            if (RoomsPanel.CheckedRooms.Count < 1)
            {
                LogPanel.Log("E: Choose at least 1 area to cover");
                return;
            }

            Dictionary <int, string> rooms = new Dictionary <int, string>();

            foreach (int i in RoomsPanel.CheckedIndices)
            {
                rooms.Add(int.Parse(RoomsPanel.Rooms[i].SubItems[1].Text), RoomsPanel.Rooms[i].Text);
            }

            SetUpHandler();
            AttackHandler.BeginMultiArea(rooms);
        }
예제 #9
0
        internal void DoAttackMobs(List <AttackHandler.MobArg> mobs)
        {
            Account mAccount = AccountsPanel.Engine.MainAccount;

            foreach (AttackHandler.MobArg arg in mobs)
            {
                if (!Globals.AttackMode || mAccount.Mover.Location == null)
                {
                    goto quit;
                }

                Globals.AttackOn = false;

                mAccount.Mover.PathfindTo(arg.RoomId);

                if (!Globals.AttackMode)
                {
                    goto quit;
                }

                Globals.AttackOn = true;

                if (arg.Id < 0)
                {
                    // userspawn
                    AccountsPanel.Engine.MainAccount.Mover.Location.AttackMob(arg.Name);
                }
                else
                {
                    AccountsPanel.Engine.MainAccount.Mover.Location.AttackMob(arg.Id);
                }
                if (!Globals.AttackOn)
                {
                    return;
                }
            }
            return;

quit:
            LogPanel.Log("Mob coverage quit");
            StopAttacking(true);
        }
예제 #10
0
        private void CoreUI_Load(object sender, EventArgs e)
        {
            StartDialog ff = new StartDialog();

            ff.ShowDialog();
            ff.Dispose();
            if (Globals.Terminate)
            {
                Application.Exit();
            }

            BuildViews();
            RegistryUtil.Load();
            IniWriter.Get();
            SyncSettings();
            MobsPanel.CalcMobRage();
            ChatPanel.Init();

            LogPanel.Log("Started.");
            LogPanel.LogAttack("No attacks yet...");
        }
예제 #11
0
 private void clearLogToolStripMenuItem_Click(object sender, EventArgs e)
 {
     LogPanel.Clear();
 }
예제 #12
0
 private void exportLogToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Toggle(false);
     LogPanel.Export();
     Toggle(true);
 }
예제 #13
0
        public CoreUI()
        {
            InitializeComponent();

            // silver vs2008 toolstrip look
            TanColorTable colorTable = new TanColorTable();

            colorTable.UseSystemColors = true;
            toolStrip.Renderer         = new ToolStripProfessionalRenderer(colorTable);

            // fill panels
            AccountsPanel      = new AccountsPanel(this);
            AccountsPanel.Dock = DockStyle.Fill;
            splitLeftRight.Panel1.Controls.Add(AccountsPanel);

            LogPanel      = new LogPanel();
            LogPanel.Dock = DockStyle.Fill;
            splitTopBottom.Panel1.Controls.Add(LogPanel);

            mAttackPanel      = new AttackPanel(this);
            mAttackPanel.Dock = DockStyle.Fill;
            tabs.TabPages[TABINDEX_ATTACK].Controls.Add(mAttackPanel);

            /*
             * MainPanel = new MainPanel(this);
             * MainPanel.Dock = DockStyle.Fill;
             * splitLeftRight2.Panel1.Controls.Add(MainPanel);
             */

            mFiltersPanel      = new FiltersPanel(this);
            mFiltersPanel.Dock = DockStyle.Fill;
            tabs.TabPages[TABINDEX_FILTERS].Controls.Add(mFiltersPanel);

            RoomsPanel      = new RoomsPanel(this);
            RoomsPanel.Dock = DockStyle.Fill;
            tabs.TabPages[TABINDEX_ROOMS].Controls.Add(RoomsPanel);

            MobsPanel      = new MobsPanel(this);
            MobsPanel.Dock = DockStyle.Fill;
            tabs.TabPages[TABINDEX_MOBS].Controls.Add(MobsPanel);

            RaidsPanel      = new RaidsPanel(this);
            RaidsPanel.Dock = DockStyle.Fill;
            tabs.TabPages[TABINDEX_RAIDS].Controls.Add(RaidsPanel);

            SpawnsPanel      = new SpawnsPanel(this);
            SpawnsPanel.Dock = DockStyle.Fill;
            tabs.TabPages[TABINDEX_SPAWNS].Controls.Add(SpawnsPanel);

            mTrainPanel      = new TrainPanel(this);
            mTrainPanel.Dock = DockStyle.Fill;
            tabs.TabPages[TABINDEX_TRAINER].Controls.Add(mTrainPanel);

            mTalkPanel      = new TalkPanel(this);
            mTalkPanel.Dock = DockStyle.Fill;
            tabs.TabPages[TABINDEX_TALK].Controls.Add(mTalkPanel);

            ChatPanel      = new ChatUI(this);
            ChatPanel.Dock = DockStyle.Fill;
            tabs.TabPages[TABINDEX_CHAT].Controls.Add(ChatPanel);

            Instance = this;
            Settings = ConfigSerializer.ReadFile("config.xml");

            this.Text = "Typpo's DC Tool - [www.typpo.us] - v" + Version.Id;

            foreach (string s in Server.NamesList)
            {
                ListViewGroup grp = new ListViewGroup(s);
                AccountsPanel.Groups.Add(grp);
            }
        }
예제 #14
0
파일: CoreUI.cs 프로젝트: typpo/outwar-dca
        public CoreUI()
        {
            InitializeComponent();

            // silver vs2008 toolstrip look
            TanColorTable colorTable = new TanColorTable();
            colorTable.UseSystemColors = true;
            toolStrip.Renderer = new ToolStripProfessionalRenderer(colorTable);

            // fill panels
            AccountsPanel = new AccountsPanel(this);
            AccountsPanel.Dock = DockStyle.Fill;
            splitLeftRight.Panel1.Controls.Add(AccountsPanel);

            LogPanel = new LogPanel();
            LogPanel.Dock = DockStyle.Fill;
            splitTopBottom.Panel1.Controls.Add(LogPanel);

            mAttackPanel = new AttackPanel(this);
            mAttackPanel.Dock = DockStyle.Fill;
            tabs.TabPages[TABINDEX_ATTACK].Controls.Add(mAttackPanel);

            /*
            MainPanel = new MainPanel(this);
            MainPanel.Dock = DockStyle.Fill;
            splitLeftRight2.Panel1.Controls.Add(MainPanel);
            */

            mFiltersPanel = new FiltersPanel(this);
            mFiltersPanel.Dock = DockStyle.Fill;
            tabs.TabPages[TABINDEX_FILTERS].Controls.Add(mFiltersPanel);

            RoomsPanel = new RoomsPanel(this);
            RoomsPanel.Dock = DockStyle.Fill;
            tabs.TabPages[TABINDEX_ROOMS].Controls.Add(RoomsPanel);

            MobsPanel = new MobsPanel(this);
            MobsPanel.Dock = DockStyle.Fill;
            tabs.TabPages[TABINDEX_MOBS].Controls.Add(MobsPanel);

            RaidsPanel = new RaidsPanel(this);
            RaidsPanel.Dock = DockStyle.Fill;
            tabs.TabPages[TABINDEX_RAIDS].Controls.Add(RaidsPanel);

            SpawnsPanel = new SpawnsPanel(this);
            SpawnsPanel.Dock = DockStyle.Fill;
            tabs.TabPages[TABINDEX_SPAWNS].Controls.Add(SpawnsPanel);

            mTrainPanel = new TrainPanel(this);
            mTrainPanel.Dock = DockStyle.Fill;
            tabs.TabPages[TABINDEX_TRAINER].Controls.Add(mTrainPanel);

            mTalkPanel = new TalkPanel(this);
            mTalkPanel.Dock = DockStyle.Fill;
            tabs.TabPages[TABINDEX_TALK].Controls.Add(mTalkPanel);

            ChatPanel = new ChatUI(this);
            ChatPanel.Dock = DockStyle.Fill;
            tabs.TabPages[TABINDEX_CHAT].Controls.Add(ChatPanel);

            Instance = this;
            Settings = ConfigSerializer.ReadFile("config.xml");

            this.Text = "Typpo's DC Tool - [www.typpo.us] - v" + Version.Id;

            foreach (string s in Server.NamesList)
            {
                ListViewGroup grp = new ListViewGroup(s);
                AccountsPanel.Groups.Add(grp);
            }
        }