Esempio n. 1
0
        private Dictionary <string, object> BuildCharInfo()
        {
            var charinfo = new Dictionary <string, object>();

            charinfo.Add("#CHARPOSX", EUOInterpreter.GetVariable <string>("#CHARPOSX"));
            charinfo.Add("#CHARPOSY", EUOInterpreter.GetVariable <string>("#CHARPOSY"));
            charinfo.Add("#CHARPOSZ", EUOInterpreter.GetVariable <string>("#CHARPOSZ"));
            charinfo.Add("#CHARDIR", EUOInterpreter.GetVariable <string>("#CHARDIR"));
            charinfo.Add("#CHARSTATUS", EUOInterpreter.GetVariable <string>("#CHARSTATUS"));;
            charinfo.Add("#CHARID", EUOInterpreter.GetVariable <string>("#CHARID"));
            charinfo.Add("#CHARTYPE", EUOInterpreter.GetVariable <string>("#CHARTYPE"));
            charinfo.Add("#CHARGHOST", EUOInterpreter.GetVariable <string>("#CHARGHOST"));
            charinfo.Add("#CHARBACKPACKID", EUOInterpreter.GetVariable <string>("#CHARBACKPACKID"));
            return(charinfo);
        }
Esempio n. 2
0
        private Dictionary <string, object> BuildLastInfo()
        {
            var last = new Dictionary <string, object>();

            last.Add("#LOBJECTID", EUOInterpreter.GetVariable <string>("#LOBJECTID"));
            last.Add("#LOBJECTTYPE", EUOInterpreter.GetVariable <string>("#LOBJECTTYPE"));
            last.Add("#LTARGETID", EUOInterpreter.GetVariable <string>("#LTARGETID"));
            last.Add("#LTARGETTYPE", EUOInterpreter.GetVariable <string>("#LTARGETTYPE"));
            last.Add("#LTARGETX", EUOInterpreter.GetVariable <string>("#LTARGETX"));
            last.Add("#LTARGETY", EUOInterpreter.GetVariable <string>("#LTARGETY"));
            last.Add("#LTARGETZ", EUOInterpreter.GetVariable <string>("#LTARGETZ"));
            last.Add("#LTARGETKIND", EUOInterpreter.GetVariable <string>("#LTARGETKIND"));
            last.Add("#LTARGETTILE", EUOInterpreter.GetVariable <string>("#LTARGETTILE"));
            last.Add("#LSKILL", EUOInterpreter.GetVariable <string>("#LSKILL"));
            last.Add("#LSPELL", EUOInterpreter.GetVariable <string>("#LSPELL"));

            last.Add("#LGUMPBUTTON", EUOInterpreter.GetVariable <string>("#LGUMPBUTTON"));

            return(last);
        }
Esempio n. 3
0
        private void UpdateVars()
        {
            try
            {
                //txtDebug.Text = "CurrentLine: " + Parser?.CurrentLine ?? "0";
                Dictionary <string, object> charinfo = new Dictionary <string, object>();
                if (!Engine.IsInstalled || World.Player == null)
                {
                    return;
                }

                charinfo.Add("#CHARPOSX", World.Player.Position.X);
                charinfo.Add("#CHARPOSY", World.Player.Position.Y);
                charinfo.Add("#CHARPOSZ", World.Player.Position.Z);
                charinfo.Add("#CHARDIR", World.Player.Direction);
                charinfo.Add("#CHARSTATUS", World.Player.GetStatusCode());
                charinfo.Add("#CHARID", World.Player.Serial);
                charinfo.Add("#CHARTYPE", World.Player.Body);
                charinfo.Add("#CHARGHOST", World.Player.IsGhost);
                charinfo.Add("#CHARBACKPACKID", uintToEUO(World.Player?.Backpack?.Serial ?? 0));

                Dictionary <string, object> last = new Dictionary <string, object>();
                last.Add("#LOBJECTID", EUOInterpreter.GetVariable <string>("#LOBJECTID"));
                last.Add("#LOBJECTTYPE", EUOInterpreter.GetVariable <string>("#LOBJECTTYPE"));
                last.Add("#LTARGETID", EUOInterpreter.GetVariable <string>("#LTARGETID"));
                last.Add("#LTARGETX", EUOInterpreter.GetVariable <string>("#LTARGETX"));
                last.Add("#LTARGETY", EUOInterpreter.GetVariable <string>("#LTARGETY"));
                last.Add("#LTARGETZ", EUOInterpreter.GetVariable <string>("#LTARGETZ"));
                last.Add("#LTARGETKIND", EUOInterpreter.GetVariable <string>("#LTARGETKIND"));
                last.Add("#LTARGETTILE", EUOInterpreter.GetVariable <string>("#LTARGETTILE"));
                last.Add("#LSKILL", EUOInterpreter.GetVariable <string>("#LSKILL"));
                last.Add("#LSPELL", EUOInterpreter.GetVariable <string>("#LSPELL"));



                Dictionary <string, object> find = new Dictionary <string, object>();
                find.Add("#FINDID", EUOInterpreter.GetVariable <string>("#findid"));
                find.Add("#FINDTYPE", EUOInterpreter.GetVariable <string>("#FINDTYPE"));
                find.Add("#FINDX", EUOInterpreter.GetVariable <string>("#FINDX"));
                find.Add("#FINDY", EUOInterpreter.GetVariable <string>("#FINDY"));
                find.Add("#FINDZ", EUOInterpreter.GetVariable <string>("#FINDZ"));
                find.Add("#FINDDIST", EUOInterpreter.GetVariable <string>("#FINDZ"));
                find.Add("#FINDKIND", EUOInterpreter.GetVariable <string>("#FINDZ"));
                find.Add("#FINDSTACK", EUOInterpreter.GetVariable <string>("#FINDZ"));
                find.Add("#FINDBAGID", EUOInterpreter.GetVariable <string>("#FINDZ"));
                find.Add("#FINDMOD", EUOInterpreter.GetVariable <string>("#FINDZ"));
                find.Add("#FINDREP", EUOInterpreter.GetVariable <string>("#FINDZ"));
                find.Add("#FINDCOL", EUOInterpreter.GetVariable <string>("#FINDZ"));
                find.Add("#FINDINDEX", EUOInterpreter.GetVariable <string>("#FINDZ"));
                find.Add("#FINDCNT", EUOInterpreter.GetVariable <string>("#FINDZ"));


                foreach (TreeNode n in treeVarTree.Nodes)
                {
                    if (n.Text == "Last Action")
                    {
                        UpdateChildren((TreeNode)n, last);
                    }
                    if (n.Text == "Character Info")
                    {
                        UpdateChildren((TreeNode)n, charinfo);
                    }
                    if (n.Text == "Find Item")
                    {
                        UpdateChildren((TreeNode)n, find);
                    }
                }
            }catch (Exception e)
            {
                Debugger.Break();
                Console.WriteLine(e.Message);
            }
        }
Esempio n. 4
0
 public override object GetValue()
 {
     return(EUOInterpreter.GetVariable <string>(value.ToLowerInvariant()));
 }
Esempio n. 5
0
        public override bool Execute()
        {
            if (DEBUG)
            {
                Console.WriteLine($"Executing Event: {EventType} ");
            }
            switch (EventType)
            {
            case "macro":
                switch ((int)Params[0].GetValue())
                {
                case 13:
                    ClientCommunication.SendToServer(new UseSkill((int)Params[1].GetValue()));
                    break;

                case 15:
                    World.Player.LastSpell = (int)Params[1].GetValue();
                    ClientCommunication.CastSpell((int)Params[1].GetValue());
                    break;

                case 16:
                    ClientCommunication.CastSpell(World.Player.LastSpell);
                    break;

                case 17:
                    var obj = Utility.EUO2StealthID(EUOInterpreter.GetVariable <string>("#lobjectid"));
                    ClientCommunication.SendToServer(new DoubleClick(obj));

                    break;

                case 22:
                    var targ = Utility.EUO2StealthID(EUOInterpreter.GetVariable <string>("#ltargetid"));
                    EUOVars.SendTargetLast();
                    break;

                case 23:
                    Targeting.Target(World.Player.Serial);
                    break;
                }
                break;

            case "gump":
            {
                switch (Params[0].GetValue().ToString())
                {
                case "wait":
                {
                    int timeout = 10000;
                    if (Params.Count > 1)
                    {
                        timeout = Params[1].GetValueInt();
                    }
                    int max = timeout / 250;
                    int cnt = 0;
                    while (!World.Player.HasGump && cnt++ < max)
                    {
                        Thread.Sleep(250);
                    }
                    if (!World.Player.HasGump)
                    {
                        World.Player?.SendMessage("Gump not found");
                    }
                }
                break;

                case "last":
                    if (World.Player?.HasGump == true)
                    {
                        World.Player?.LastGumpResponseAction?.Perform();
                    }
                    else
                    {
                        World.Player?.SendMessage("Gump not found");
                    }
                    break;

                case "button":
                    int button = Params[1].GetValueInt();
                    World.Player.LastGumpResponseAction = new GumpResponseAction(button, new int[] { }, new GumpTextEntry[] { });
                    if (World.Player?.HasGump == true)
                    {
                        World.Player?.LastGumpResponseAction?.Perform();
                    }
                    else
                    {
                        World.Player?.SendMessage("Gump not found");
                    }
                    break;
                }
            }
            break;

            case "contextmenu":
                uint   serial = Utility.EUO2StealthID(Params[0].GetValue().ToString());
                ushort index  = (ushort)Params[1].GetValueInt();
                ClientCommunication.SendToServer(new ContextMenuRequest(serial));
                ClientCommunication.SendToServer(new ContextMenuResponse(serial, index));
                break;
            }
            return(base.Execute());
        }
Esempio n. 6
0
        private void UpdateVars()
        {
            btnPause.Checked = false;
            btnStop.Checked  = false;

            if (Interpreter != null)
            {
                btnPause.Enabled = Interpreter.Running;
                btnStop.Enabled  = Interpreter.Running;
                btnPlay.Enabled  = !Interpreter.Running;

                btnPlay.Checked = Interpreter.Running;
            }
            else
            {
                btnPause.Enabled = false;
                btnStop.Enabled  = false;
                btnPlay.Enabled  = true;

                btnPlay.Checked = false;
            }
            this.Text = $"CEasyUO {Assembly.GetExecutingAssembly().GetName().Version} - {(m_FilePath ?? "New")}";

            try
            {
                //txtDebug.Text = "CurrentLine: " + Parser?.CurrentLine ?? "0";
                if (!Engine.IsInstalled || World.Player == null)
                {
                    return;
                }

                Dictionary <string, object> charinfo = BuildCharInfo();


                Dictionary <string, object> last = BuildLastInfo();

                Dictionary <string, object> container = new Dictionary <string, object>();
                container.Add("#GUMPPOSX", EUOInterpreter.GetVariable <string>("#GUMPPOSX"));
                container.Add("#GUMPPOSY", EUOInterpreter.GetVariable <string>("#GUMPPOSY"));
                container.Add("#GUMPSIZEX", EUOInterpreter.GetVariable <string>("#GUMPSIZEX"));
                container.Add("#GUMPSIZEY", EUOInterpreter.GetVariable <string>("#GUMPSIZEY"));
                container.Add("#CONTKIND", EUOInterpreter.GetVariable <string>("#CONTKIND"));
                container.Add("#CONTID", EUOInterpreter.GetVariable <string>("#CONTID"));
                container.Add("#CONTTYPE", EUOInterpreter.GetVariable <string>("#CONTTYPE"));
                container.Add("#CONTHP", "N/A");

                container.Add("#GUMPSERIAL", EUOInterpreter.GetVariable <string>("#GUMPSERIAL"));
                container.Add("#GUMPTYPE", EUOInterpreter.GetVariable <string>("#GUMPTYPE"));

                Dictionary <string, object> find = new Dictionary <string, object>();
                find.Add("#FINDID", EUOInterpreter.GetVariable <string>("#findid"));
                find.Add("#FINDTYPE", EUOInterpreter.GetVariable <string>("#FINDTYPE"));
                find.Add("#FINDX", EUOInterpreter.GetVariable <string>("#FINDX"));
                find.Add("#FINDY", EUOInterpreter.GetVariable <string>("#FINDY"));
                find.Add("#FINDZ", EUOInterpreter.GetVariable <string>("#FINDZ"));
                find.Add("#FINDDIST", EUOInterpreter.GetVariable <string>("#FINDZ"));
                find.Add("#FINDKIND", EUOInterpreter.GetVariable <string>("#FINDZ"));
                find.Add("#FINDSTACK", EUOInterpreter.GetVariable <string>("#FINDZ"));
                find.Add("#FINDBAGID", EUOInterpreter.GetVariable <string>("#FINDZ"));
                find.Add("#FINDMOD", EUOInterpreter.GetVariable <string>("#FINDZ"));
                find.Add("#FINDREP", EUOInterpreter.GetVariable <string>("#FINDZ"));
                find.Add("#FINDCOL", EUOInterpreter.GetVariable <string>("#FINDZ"));
                find.Add("#FINDINDEX", EUOInterpreter.GetVariable <string>("#FINDZ"));
                find.Add("#FINDCNT", EUOInterpreter.GetVariable <string>("#FINDZ"));


                Dictionary <string, object> status = new Dictionary <string, object>();
                status.Add("#CHARNAME", EUOInterpreter.GetVariable <string>("#CHARNAME"));
                status.Add("#SEX", EUOInterpreter.GetVariable <string>("#SEX"));
                status.Add("#STR", EUOInterpreter.GetVariable <string>("#STR"));
                status.Add("#DEX", EUOInterpreter.GetVariable <string>("#DEX"));
                status.Add("#INT", EUOInterpreter.GetVariable <string>("#INT"));
                status.Add("#HITS", EUOInterpreter.GetVariable <string>("#HITS"));
                status.Add("#MAXHITS", EUOInterpreter.GetVariable <string>("#MAXHITS"));
                status.Add("#MANA", EUOInterpreter.GetVariable <string>("#MANA"));
                status.Add("#MAXMANA", EUOInterpreter.GetVariable <string>("#MAXMANA"));
                status.Add("#STAMINA", EUOInterpreter.GetVariable <string>("#STAMINA"));
                status.Add("#MAXSTAM", EUOInterpreter.GetVariable <string>("#MAXSTAM"));
                status.Add("#MAXSTATS", EUOInterpreter.GetVariable <string>("#MAXSTATS"));
                status.Add("#LUCK", EUOInterpreter.GetVariable <string>("#LUCK"));
                status.Add("#WEIGHT", EUOInterpreter.GetVariable <string>("#WEIGHT"));
                status.Add("#MAXWEIGHT", EUOInterpreter.GetVariable <string>("#MAXWEIGHT"));
                status.Add("#MINDMG", EUOInterpreter.GetVariable <string>("#MINDMG"));
                status.Add("#MAXDMG", EUOInterpreter.GetVariable <string>("#MAXDMG"));
                status.Add("#GOLD", EUOInterpreter.GetVariable <string>("#GOLD"));
                status.Add("#FOLLOWERS", EUOInterpreter.GetVariable <string>("#FOLLOWERS"));
                status.Add("#MAXFOL", EUOInterpreter.GetVariable <string>("#MAXFOL"));
                status.Add("#AR", EUOInterpreter.GetVariable <string>("#AR"));
                status.Add("#FR", EUOInterpreter.GetVariable <string>("#FR"));
                status.Add("#CR", EUOInterpreter.GetVariable <string>("#CR"));
                status.Add("#PR", EUOInterpreter.GetVariable <string>("#PR"));
                status.Add("#ER", EUOInterpreter.GetVariable <string>("#ER"));

                Dictionary <string, object> extended = new Dictionary <string, object>();
                extended.Add("#JOURNAL", EUOInterpreter.GetVariable <string>("#JOURNAL"));
                extended.Add("#JCOLOR", EUOInterpreter.GetVariable <string>("#JCOLOR"));
                extended.Add("#JINDEX", EUOInterpreter.GetVariable <string>("#JINDEX"));
                extended.Add("#SYSMSG", EUOInterpreter.GetVariable <string>("#SYSMSG"));
                extended.Add("#TARGCURS", EUOInterpreter.GetVariable <string>("#TARGCURS"));
                extended.Add("#CURSKIND", EUOInterpreter.GetVariable <string>("#CURSKIND"));
                extended.Add("#PROPERTY", EUOInterpreter.GetVariable <string>("#PROPERTY"));

                Dictionary <string, object> results = new Dictionary <string, object>();
                results.Add("#RESULT", EUOInterpreter.GetVariable <string>("#RESULT"));
                results.Add("#STRRES", EUOInterpreter.GetVariable <string>("#STRRES"));
                results.Add("#MENURES", EUOInterpreter.GetVariable <string>("#MENURES"));
                results.Add("#DISPRES", EUOInterpreter.GetVariable <string>("#DISPRES"));

                foreach (TreeNode n in treeVarTree.Nodes)
                {
                    if (n.Text == "Last Action")
                    {
                        UpdateChildren((TreeNode)n, last);
                    }
                    if (n.Text == "Character Info")
                    {
                        UpdateChildren((TreeNode)n, charinfo);
                    }
                    if (n.Text == "Find Item")
                    {
                        UpdateChildren((TreeNode)n, find);
                    }
                    if (n.Text == "Status Bar")
                    {
                        UpdateChildren((TreeNode)n, status);
                    }
                    if (n.Text == "Container Info")
                    {
                        UpdateChildren((TreeNode)n, container);
                    }
                    if (n.Text == "Result Variables")
                    {
                        UpdateChildren((TreeNode)n, results);
                    }
                    if (n.Text == "Extended Info")
                    {
                        UpdateChildren((TreeNode)n, extended);
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message + e.StackTrace);
            }
        }