示例#1
0
        private static int FuncBody(IntPtr parLuaState)
        {
            if (Lua.ArgsCount(parLuaState) != 1 || !Lua.IsString(parLuaState, 1))
            {
                Lua.Print("Usage is UseObject(\\\"name\\\")");
                return(0);
            }
            string wObject = Lua.ToString(parLuaState, 1);

            if (!ObjectManager.EnumObjects())
            {
                return(0);
            }
            WoWGameObject obj = ObjectManager.Objects.OfType <WoWGameObject>()
                                .Where(i => i.Name == wObject)
                                .OrderBy(i => i.DistanceTo(ObjectManager.Player))
                                .FirstOrDefault();

            if (obj == null)
            {
                return(0);
            }
            obj.Interact(false);
            return(0);
        }
示例#2
0
        private static int FuncBody(IntPtr parLuaState)
        {
            if (Lua.ArgsCount(parLuaState) != 1 || !Lua.IsString(parLuaState, 1))
            {
                Lua.Print("Will remove a bar profile. Usage is RemoveBars(\\\"x\\\")");
                return(0);
            }
            string profName = Lua.ToString(parLuaState, 1);
            string path     = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            string file     = path + "\\Bars.ini";

            if (!File.Exists(file))
            {
                return(0);
            }
            List <string> profiles = File.ReadAllText(file).Split(new string[] { Environment.NewLine }, StringSplitOptions.None).ToList();

            profiles.RemoveAll(i => i.Contains(profName) && i.Contains(ObjectManager.Player.Name));
            File.Delete(file);
            foreach (string str in profiles)
            {
                if (String.IsNullOrEmpty(str))
                {
                    continue;
                }
                File.AppendAllText(file, str + Environment.NewLine);
            }
            Lua.Print("Removed profile with name " + profName + " if it existed");
            return(0);
        }
示例#3
0
        private static int FuncBody(IntPtr parLuaState)
        {
            if (Lua.ArgsCount(parLuaState) != 0)
            {
                return(0);
            }

            if (!enabled)
            {
                Lua.Print("Starting to loot all corpses in range");
                if (ObjectManager.EnumObjects())
                {
                    List <WoWUnit> mobs = ObjectManager.Mobs;
                    lootableUnits = mobs.OfType <WoWUnit>()
                                    .Where(i => i.CanBeLooted &&
                                           i.DistanceTo(ObjectManager.Player) < 4.20f)
                                    .OrderBy(i => i.DistanceTo(ObjectManager.Player))
                                    .ToList();
                    lootCounter = 0;
                    lootOpen    = false;
                    enabled     = true;
                    Wait.Remove("LootOpenBlacklist");
                    Wait.Remove("LootClickBlacklist");
                    AntiWarden.HookWardenMemScan.GetHack("LootPatch").Apply();
                    if (AutoLoot.enabled)
                    {
                        OnRightClickUnitHook.Remove();
                        OnRightClickObjectHook.Remove();
                    }
                    DirectX.RunInEndScene(EndScene);
                }
            }
            return(0);
        }
示例#4
0
        private static int FuncBody(IntPtr parLuaState)
        {
            if (!enabled)
            {
                if (Lua.ArgsCount(parLuaState) != 1 || !Lua.IsString(parLuaState, 1))
                {
                    Lua.Print("Usage is UseItem(\\\"name\\\")");
                    return(0);
                }
                string item = Lua.ToString(parLuaState, 1);

                if (!ObjectManager.EnumObjects())
                {
                    return(0);
                }
                target = ObjectManager.Target;
                if (target == null)
                {
                    return(0);
                }

                if (ObjectManager.Player.Inventory.ItemCount(item) == 0)
                {
                    return(0);
                }
                ObjectManager.Player.Inventory.UseItem(item);
                enabled = true;
                DirectX.RunInEndScene(EndScene);
                Wait.Remove("GrenadeTimeout");
            }
            return(0);
        }
示例#5
0
        private static int FuncBody(IntPtr parLuaState)
        {
            if (!enabled)
            {
                if (Lua.ArgsCount(parLuaState) != 1 || !Lua.IsString(parLuaState, 1))
                {
                    Lua.Print("Usage is UseSpell(\\\"name\\\")");
                    return(0);
                }
                string spell = Lua.ToString(parLuaState, 1);

                if (!ObjectManager.EnumObjects())
                {
                    return(0);
                }
                target = ObjectManager.Target;
                if (target == null)
                {
                    return(0);
                }

                Functions.DoString("CastSpellByName('" + spell + "');");
                enabled = true;
                DirectX.RunInEndScene(EndScene);
                Wait.Remove("SpellTimeout");
            }
            return(0);
        }
示例#6
0
 private static int FuncBody(IntPtr parLuaState)
 {
     if (Lua.ArgsCount(parLuaState) != 0)
     {
         return(0);
     }
     Lua.Print("Thanks(), NoClip1(), NoClip2(), NoClip3(), UseItem(\\\"x\\\"), Loot(), UseSpell(\\\"x\\\"), UseObject(\\\"x\\\"), Interact(), AutoLoot(), SaveBars(\\\"x\\\"), LoadBars(\\\"x\\\"), RemoveBars(\\\"x\\\")");
     return(0);
 }
示例#7
0
        private static int FuncBody(IntPtr parLuaState)
        {
            if (Lua.ArgsCount(parLuaState) != 0)
            {
                return(0);
            }
            Lua.Welcome();

            return(0);
        }
示例#8
0
        private static int FuncBody(IntPtr parLuaState)
        {
            if (Lua.ArgsCount(parLuaState) != 0)
            {
                return(0);
            }

            Lua.Print("Thanks for using my framework! If you want to assist me I would be glad if you visit my page at http://zzukbot.com!");

            return(0);
        }
示例#9
0
        private static int FuncBody(IntPtr parLuaState)
        {
            if (Lua.ArgsCount(parLuaState) != 1 || !Lua.IsString(parLuaState, 1))
            {
                Lua.Print("Usage is SaveBars(\\\"x\\\")");
                return(0);
            }
            string profName = Lua.ToString(parLuaState, 1);
            string path     = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            string file     = path + "\\Bars.ini";

            if (!File.Exists(file))
            {
                File.Create(file).Dispose();
            }
            List <string> profiles = File.ReadAllLines(file).ToList();
            string        final    = ObjectManager.Player.Name + "|" + profName + "|";
            uint          barSlot  = 0x00BC6980;

            for (int i = 0; i < 109; i++)
            {
                try
                {
                    final += Memory.Reader.Read <uint>((IntPtr)barSlot).ToString() + "|";
                }
                catch
                {
                    final += "0|";
                }
                barSlot = barSlot + 0x4;
            }
            profiles.RemoveAll(i => i.Contains(profName) && i.Contains(ObjectManager.Player.Name));
            profiles.Add(final);


            File.Delete(file);
            foreach (string str in profiles)
            {
                if (String.IsNullOrEmpty(str))
                {
                    continue;
                }
                File.AppendAllText(file, str + Environment.NewLine);
            }
            Lua.Print("Saved current bar setup with name " + profName);
            return(0);
        }
示例#10
0
        private static int FuncBody(IntPtr parLuaState)
        {
            if (Lua.ArgsCount(parLuaState) != 0)
            {
                Lua.Print("Usage is Interact()");
                return(0);
            }

            if (!ObjectManager.EnumObjects())
            {
                return(0);
            }
            WoWUnit target = ObjectManager.Target;

            target?.Interact(false);

            return(0);
        }
示例#11
0
        private static int FuncBody(IntPtr parLuaState)
        {
            if (Lua.ArgsCount(parLuaState) != 1 || !Lua.IsString(parLuaState, 1))
            {
                Lua.Print("Usage is LoadBars(\\\"x\\\")");
                return(0);
            }
            string profName = Lua.ToString(parLuaState, 1);
            string path     = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            string file     = path + "\\Bars.ini";

            if (!File.Exists(file))
            {
                Lua.Print("No bar profile has been saved so far!");
                return(0);
            }
            List <string> profiles = File.ReadAllText(file).Split(new string[] { Environment.NewLine }, StringSplitOptions.None).ToList();
            uint          barSlot  = 0x00BC6980;
            string        profile  = profiles.OfType <string>().Where(i => i.Contains(profName) && i.Contains(ObjectManager.Player.Name)).FirstOrDefault();

            if (String.IsNullOrEmpty(profile))
            {
                Lua.Print("Profile with name " + profName + " doesnt exist yet!");
                return(0);
            }

            Functions.DoString(
                "for i=1,109 do PickupAction(i) ClearCursor() end");


            string[] parts = profile.Split('|');
            for (int i = 0; i < 109; i++)
            {
                Memory.Reader.Write <uint>((IntPtr)barSlot, Convert.ToUInt32(parts[2 + i]));
                barSlot = barSlot + 0x4;
            }

            Functions.DoString(
                "for i=1,109 do PickupAction(i) PlaceAction(i) end");


            Lua.Print("Loaded profile " + profName);;
            return(0);
        }
示例#12
0
        private static int FuncBody(IntPtr parLuaState)
        {
            if (Lua.ArgsCount(parLuaState) != 0)
            {
                return(0);
            }

            if (!enabled)
            {
                AntiWarden.HookWardenMemScan.GetHack("Collision3").Apply();
                Lua.Print("Noclip with mailboxes etc. enabled!");
                enabled = true;
            }
            else
            {
                AntiWarden.HookWardenMemScan.GetHack("Collision3").Remove();
                Lua.Print("Noclip with mailboxes etc. disabled!");
                enabled = false;
            }

            return(0);
        }
示例#13
0
        private static int FuncBody(IntPtr parLuaState)
        {
            try
            {
                if (Lua.ArgsCount(parLuaState) != 0)
                {
                    return(0);
                }

                if (enabled)
                {
                    enabled = false;
                    OnRightClickUnitHook.Remove();
                    OnRightClickObjectHook.Remove();
                    Lua.Print("Autoloot disabled");
                }
                else
                {
                    enabled = true;
                    OnRightClickUnitHook.Apply();
                    OnRightClickObjectHook.Apply();
                    Lua.Print("Autoloot enabled");
                }

                string    path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
                XDocument doc  = XDocument.Load(path + "\\Settings.xml");
                doc.Element("Settings").Element("AutoLoot").Value = enabled.ToString();
                doc.Save(path + ".\\Settings.xml");
            }
            catch
            {
                MessageBox.Show("Settings.xml is broken or non-existent. Please delete it and relaunch the hack!");
                Process.GetCurrentProcess().Kill();
            }

            return(0);
        }