コード例 #1
0
ファイル: Usefuls.cs プロジェクト: zneel/TheNoobBot
        public static string GetClientLanguage()
        {
            string randomString = Others.GetRandomString(Others.Random(5, 10));
            string result       = Lua.LuaDoString(randomString + " =  GetLocale();", randomString);

            return(result);
        }
コード例 #2
0
ファイル: Bot.cs プロジェクト: zneel/TheNoobBot
        public static List <string> ExtractAllPathsTaxi()
        {
            string result = Others.GetRandomString(Others.Random(4, 10));

            Lua.LuaDoString(result + "= \"\"; nb = NumTaxiNodes(); for i=1,nb do n = TaxiNodeName(i); x,y = TaxiNodePosition(i); " + result + " = " + result +
                            ".. n .. \"#\" .. x .. \"^\" .. y  .. \"@\" .. GetNumRoutes(i) .. \"~\" .. TaxiNodeGetType(i) .. \"|\" end");
            string allPaths  = Lua.GetLocalizedText(result);
            var    ListPaths = new List <String>();

            for (int i = 0; i < allPaths.Split('|').Length - 1; i++)
            {
                ListPaths.Add(allPaths.Split('|')[i]);
            }
            var    listPathFinal = new List <string>();
            string lowerValue    = "";

            while (ListPaths.Count > 0)
            {
                foreach (string listPath in ListPaths)
                {
                    if (lowerValue == "")
                    {
                        lowerValue = listPath;
                    }
                    else if (Others.ToSingle(listPath.Split('^')[1].Split('@')[0].Trim()) < Others.ToSingle(lowerValue.Split('^')[1].Split('@')[0].Trim()))
                    {
                        lowerValue = listPath;
                    }
                }
                ListPaths.Remove(lowerValue);
                listPathFinal.Add(lowerValue);
                lowerValue = "";
            }
            return(listPathFinal); // listPathFinal;
        }
コード例 #3
0
ファイル: ProspectingState.cs プロジェクト: zneel/TheNoobBot
        public override void Run()
        {
            _lastTimeRunning = Others.Times;
            MovementManager.StopMove();
            Thread.Sleep(500);
            Tasks.MountTask.DismountMount();
            Logging.Write("Prospecting in progress");
            Timer timer = new Timer(15 * 60 * 1000);

            // Prospecting
            while (Prospecting.NeedRun(nManagerSetting.CurrentSetting.MineralsToProspect) && Products.Products.IsStarted &&
                   Usefuls.InGame &&
                   !ObjectManager.ObjectManager.Me.InCombat && !ObjectManager.ObjectManager.Me.IsDeadMe &&
                   !timer.IsReady)
            {
                Thread.Sleep(200);
                Prospecting.Pulse(nManagerSetting.CurrentSetting.MineralsToProspect);
                Thread.Sleep(750);
                while (ObjectManager.ObjectManager.Me.IsCast && Products.Products.IsStarted && Usefuls.InGame &&
                       !ObjectManager.ObjectManager.Me.InCombat && !ObjectManager.ObjectManager.Me.IsDeadMe &&
                       !timer.IsReady)
                {
                    Thread.Sleep(100);
                }

                Thread.Sleep(Others.Random(600, 1600) + Usefuls.Latency);
            }
        }
コード例 #4
0
ファイル: Remote.cs プロジェクト: zneel/TheNoobBot
        private void ThreadBotRemote()
        {
            try
            {
                _sessionKey = Others.Random(0, 999999);
                while (true)
                {
                    try
                    {
                        while (!RemoteActive)
                        {
                            Thread.Sleep(1000 * 3);
                            _firstActive = false;
                        }
                        if (!_firstActive)
                        {
                            Logging.Write("Remote activated. Session id: " + _sessionKey);
                            _firstActive = true;
                        }

                        SendGetToServer();
                    }
                    catch (Exception e)
                    {
                        Logging.WriteError("Remote > ThreadBotRemote()#1: " + e);
                    }
                    Thread.Sleep(1000 * 5);
                }
            }
            catch (Exception e)
            {
                Logging.WriteError("Remote > ThreadBotRemote()#2: " + e);
            }
        }
コード例 #5
0
ファイル: Archaeology.cs プロジェクト: zanzo420/TheNoobBot
        private static bool IsButtonActive(string buttonName)
        {
            string randomString = Others.GetRandomString(Others.Random(4, 10));

            Lua.LuaDoString(randomString + " = " + buttonName + ":GetButtonState();");
            return(Lua.GetLocalizedText(randomString) == "NORMAL");
        }
コード例 #6
0
        public static bool CheckItemStats(string link)
        {
            string randomString = Others.GetRandomString(Others.Random(4, 10));
            string command      = randomString + "='' ";

            command += "stats=GetItemStats(\"" + link + "\"); ";
            command += "for key,value in pairs(stats) do ";
            command += randomString + "=" + randomString + " .. key .. '^' .. value .. '^' ";
            command += "end;";
            Lua.LuaDoString(command);
            string sResult = Lua.GetLocalizedText(randomString);

            string[] itemStatsArray = sResult.Split('^');
            int      index          = 0;
            bool     valid          = true;

            while (index < itemStatsArray.Length - 1)
            {
                string name = itemStatsArray[index];
                //string value = itemStatsArray[index+1];
                Enums.WoWStatistic Stat = ConvertToStatistic(name);
                if (Stat != Enums.WoWStatistic.None && !EquipmentAndStats.InternalEquipementStats.Contains(Stat))
                {
                    valid = false;
                }
                //Logging.WriteDebug(name + "=" + value);
                index += 2;
            }
            return(valid);
        }
コード例 #7
0
 private void Translate()
 {
     AlteracValleyLabel.Text       = nManager.Translate.Get(nManager.Translate.Id.QueueAlteracValley);
     WarsongGulchLabel.Text        = nManager.Translate.Get(nManager.Translate.Id.QueueWarsongGulch);
     ArathiBasinLabel.Text         = nManager.Translate.Get(nManager.Translate.Id.QueueArathiBasin);
     EyeoftheStormLabel.Text       = nManager.Translate.Get(nManager.Translate.Id.QueueEyeoftheStorm);
     StrandoftheAncientsLabel.Text = nManager.Translate.Get(nManager.Translate.Id.QueueStrandoftheAncients);
     IsleofConquestLabel.Text      = nManager.Translate.Get(nManager.Translate.Id.QueueIsleofConquest);
     TwinPeaksLabel.Text           = nManager.Translate.Get(nManager.Translate.Id.QueueTwinPeaks);
     BattleforGilneasLabel.Text    = nManager.Translate.Get(nManager.Translate.Id.QueueBattleforGilneas);
     TempleOfKotmoguLabel.Text     = nManager.Translate.Get(nManager.Translate.Id.QueueTempleofKotmogu);
     SilvershardMinesLabel.Text    = nManager.Translate.Get(nManager.Translate.Id.QueueSilvershardMines);
     RandomBattlegroundLabel.Text  = nManager.Translate.Get(nManager.Translate.Id.QueueRandomBattleground);
     AlteracValley.Text            = nManager.Translate.Get(nManager.Translate.Id.AlteracValley);
     WarsongGulch.Text             = nManager.Translate.Get(nManager.Translate.Id.WarsongGulch);
     ArathiBasin.Text               = nManager.Translate.Get(nManager.Translate.Id.ArathiBasin);
     EyeoftheStorm.Text             = nManager.Translate.Get(nManager.Translate.Id.EyeoftheStorm);
     StrandoftheAncients.Text       = nManager.Translate.Get(nManager.Translate.Id.StrandoftheAncients);
     IsleofConquest.Text            = nManager.Translate.Get(nManager.Translate.Id.IsleofConquest);
     TwinPeaks.Text                 = nManager.Translate.Get(nManager.Translate.Id.TwinPeaks);
     BattleforGilneas.Text          = nManager.Translate.Get(nManager.Translate.Id.BattleforGilneas);
     TempleofKotmogu.Text           = nManager.Translate.Get(nManager.Translate.Id.TempleofKotmogu);
     SilvershardMines.Text          = nManager.Translate.Get(nManager.Translate.Id.SilvershardMines);
     RandomBattleground.Text        = nManager.Translate.Get(nManager.Translate.Id.RandomBattleground);
     RequeueAfterXMinutesLabel.Text = nManager.Translate.Get(nManager.Translate.Id.RequeueAfterXMinutes);
     SaveButton.Text                = nManager.Translate.Get(nManager.Translate.Id.Save_and_Close);
     MainHeader.TitleText           = nManager.Translate.Get(nManager.Translate.Id.Settings_Battlegrounder) + " - " + Information.MainTitle;
     this.Text = Others.GetRandomString(Others.Random(4, 10));
 }
コード例 #8
0
        public static void ConsumeQuestsCompletedRequest()
        {
            FinishedQuestSet.Clear();
            string luaTable     = Others.GetRandomString(Others.Random(4, 10));
            string luaResultStr = Others.GetRandomString(Others.Random(4, 10));
            string command      = "";

            command += "local " + luaTable + " = GetQuestsCompleted() ";
            command += "if " + luaTable + " == nil then " + luaResultStr + " = \"NIL\" else ";
            command += luaResultStr + " = \"\" ";
            command += "for key,value in pairs(" + luaTable + ") do "; // value is "true" always
            command += luaResultStr + " = " + luaResultStr + " .. \"^\" .. key ";
            command += "end end";
            Lua.LuaDoString(command);
            string sResult = Lua.GetLocalizedText(luaResultStr);

            if (sResult == "NIL")
            {
                return;
            }
            foreach (string strQuestId in sResult.Split('^'))
            {
                if (strQuestId != string.Empty)
                {
                    FinishedQuestSet.Add(Others.ToInt32(strQuestId));
                }
            }
        }
コード例 #9
0
        public static String GetActiveTitle(int index)
        {
            string randomString = Others.GetRandomString(Others.Random(4, 10));

            Lua.LuaDoString(randomString + " = GetActiveTitle(" + index + ")");
            return(Lua.GetLocalizedText(randomString));
        }
コード例 #10
0
        public static bool ItemIsInBag(string name)
        {
            try
            {
                string randomString = Others.GetRandomString(Others.Random(4, 10));

                string scriptLua = "local c,l,r,_=0 ";
                scriptLua = scriptLua + randomString + " = \"False\" ";
                scriptLua = scriptLua + "for b=0,4 do ";
                scriptLua = scriptLua + "for s=1,40 do  ";
                scriptLua = scriptLua + "local l=GetContainerItemLink(b,s) ";
                scriptLua = scriptLua + "if l then namei,_,r=GetItemInfo(l) ";
                scriptLua = scriptLua + "if namei == " + name + " then ";
                scriptLua = scriptLua + randomString + " = \"True\" ";
                scriptLua = scriptLua + " end ";
                scriptLua = scriptLua + "end ";
                scriptLua = scriptLua + "end ";
                scriptLua = scriptLua + "end ";


                lock (Locker)
                {
                    Lua.LuaDoString(scriptLua);
                    return(Lua.GetLocalizedText(randomString) == "True");
                }
            }
            catch (Exception exception)
            {
                Logging.WriteError("ItemIsInBag(string name): " + exception);
                return(false);
            }
        }
コード例 #11
0
ファイル: Program.cs プロジェクト: zneel/TheNoobBot
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            var account = Others.GetProcessOwner(Process.GetCurrentProcess().Id);
            var botFile = Others.ReadFileAllLines(Application.StartupPath + "\\Data\\Launcher.txt")[0].Trim();

            if (File.Exists(botFile))
            {
                string random = Others.GetRandomString(Others.Random(4, 10));
                string tnbExe = random + ".exe";
                var    sw     = new StreamWriter(Application.StartupPath + "\\Data\\Launcher.txt");
                sw.WriteLine(tnbExe);
                sw.Close();
                File.Move(botFile, tnbExe);
                if (File.Exists(botFile + ".config"))
                {
                    File.Move(botFile + ".config", tnbExe + ".config");
                }
                Others.AddFileSecurity(tnbExe, account, FileSystemRights.ReadData, AccessControlType.Allow);
                Others.RemoveFileSecurity(tnbExe, account, FileSystemRights.ReadData, AccessControlType.Deny);
                Process.Start(tnbExe);
                Process.GetCurrentProcess().Kill();
            }
            MessageBox.Show("Please do not modify the name of the executable by yourself. Restore the original name or re-download the software.");
            Process.GetCurrentProcess().Kill();
        }
コード例 #12
0
ファイル: WoWPlayer.cs プロジェクト: zneel/TheNoobBot
 public WoWSpecialization WowSpecialization(bool doOutput = false)
 {
     try
     {
         string specInfo = Others.GetRandomString(Others.Random(4, 10));
         Lua.LuaDoString(
             "if GetSpecialization() ~= nil and GetSpecializationInfo(GetSpecialization()) ~= nil then id,name,description,icon,role,primary = GetSpecializationInfo(GetSpecialization()) " +
             specInfo + " = id .. \"^\" .. name .. \"^\" .. role .. \"^\" .. primary else " + specInfo + " = 0 end");
         string[] specInfos = Lua.GetLocalizedText(specInfo).Split('^');
         if (specInfos.Count() != 4)
         {
             if (doOutput)
             {
                 Logging.WriteDebug("WoW Specialization not found");
             }
             return(WoWSpecialization.None);
         }
         if (doOutput)
         {
             Logging.WriteDebug("WoW Specialization found: " + WowClass + " " + specInfos[1] + ", role: " + specInfos[2]);
         }
         WoWSpecialization rWoWSpecialization = (WoWSpecialization)Others.ToInt32(specInfos[0]);
         return(rWoWSpecialization);
     }
     catch (Exception e)
     {
         Logging.WriteError("WoWPlayer > WoWSpecialization: " + e);
     }
     return(WoWSpecialization.None);
 }
コード例 #13
0
 private void Translate()
 {
     recordWayB.Text       = nManager.Translate.Get(nManager.Translate.Id.Record_Way);
     saveB.Text            = nManager.Translate.Get(nManager.Translate.Id.Save);
     labelX1.Text          = nManager.Translate.Get(nManager.Translate.Id.Separation_distance_record) + ":";
     delB.Text             = nManager.Translate.Get(nManager.Translate.Id.Del);
     delBlackRadius.Text   = nManager.Translate.Get(nManager.Translate.Id.Del);
     addBlackB.Text        = nManager.Translate.Get(nManager.Translate.Id.Add_this_position_to_Black_list_Radius);
     addNpcB.Text          = nManager.Translate.Get(nManager.Translate.Id.Add_Target_to_Npc_list);
     delNpcB.Text          = nManager.Translate.Get(nManager.Translate.Id.Del);
     loadB.Text            = nManager.Translate.Get(nManager.Translate.Id.Load);
     nameNpcTb.Text        = nManager.Translate.Get(nManager.Translate.Id.Name);
     addByNameNpcB.Text    = nManager.Translate.Get(nManager.Translate.Id.Add_by_Name_to_Npc_list);
     ListOfZonesLabel.Text = nManager.Translate.Get(nManager.Translate.Id.List_Zones) + ":";
     addZoneB.Text         = nManager.Translate.Get(nManager.Translate.Id.Add_Zone);
     delZoneB.Text         = nManager.Translate.Get(nManager.Translate.Id.Del_Zone);
     ZoneNameLabel.Text    = nManager.Translate.Get(nManager.Translate.Id.Zone_Name) + ":";
     ZoneMinLevel.Text     = nManager.Translate.Get(nManager.Translate.Id.Player_Lvl) + " " +
                             nManager.Translate.Get(nManager.Translate.Id.Min);
     ZoneMaxLevelLabel.Text   = nManager.Translate.Get(nManager.Translate.Id.Max);
     TargetMaxLevelLabel.Text = nManager.Translate.Get(nManager.Translate.Id.Max);
     TargetMinLevelLabel.Text = nManager.Translate.Get(nManager.Translate.Id.Target_Lvl) + " " +
                                nManager.Translate.Get(nManager.Translate.Id.Min);
     addTargetEntryB.Text = nManager.Translate.Get(nManager.Translate.Id.Add_Target);
     labelX8.Text         = nManager.Translate.Get(nManager.Translate.Id.Target_Ids);
     MainHeader.TitleText = nManager.Translate.Get(nManager.Translate.Id.Profile_Creator) + " - " + Information.MainTitle;
     this.Text            = Others.GetRandomString(Others.Random(4, 10));
 }
コード例 #14
0
ファイル: SpellManager.cs プロジェクト: zneel/TheNoobBot
        public static bool IsSpellUsableLUA(Spell spell)
        {
            try
            {
                if (IsSpellOnCooldown(spell.Id, spell.CategoryId, spell.StartRecoveryCategoryId))
                {
                    return(false);
                }

                if (IsSpellOnCooldown(spell.Ids, spell.CategoryId, spell.StartRecoveryCategoryId))
                {
                    return(false); // Some spell like Ascendance that has multiples Ids would fails the "Id" check.
                }
                // We only need LUA to check for ressources now.

                string luaVarUsable    = Others.GetRandomString(Others.Random(4, 10));
                string luaVarNoMana    = Others.GetRandomString(Others.Random(4, 10));
                string luaResultUsable = Others.GetRandomString(Others.Random(4, 10));

                string luaCode = luaVarUsable + "," + luaVarNoMana + "=IsUsableSpell(\"" + spell.NameInGame + "\"); ";
                luaCode += "if " + luaVarUsable + " and not " + luaVarNoMana + " then ";
                luaCode += luaResultUsable + "=\"1\" ";
                luaCode += "end ";

                Lua.LuaDoString(luaCode, false, false);
                string ret = Lua.GetLocalizedText(luaResultUsable);

                return(ret == "1");
            }
            catch (Exception exception)
            {
                Logging.WriteError("public static bool IsSpellUsableLUA(Spell spell): " + exception);
                return(false);
            }
        }
コード例 #15
0
ファイル: SpellManager.cs プロジェクト: zneel/TheNoobBot
        public static bool SpellHasCharges(uint spellId)
        {
            string randomStringResult = Others.GetRandomString(Others.Random(4, 10));
            string ret = Lua.LuaDoString("_, " + randomStringResult + " = GetSpellCharges(" + spellId + ")", randomStringResult);

            return(Others.ToInt32(ret) > 0);
        }
コード例 #16
0
ファイル: Gossip.cs プロジェクト: zneel/TheNoobBot
        public static List <Taxi> GetAllTaxisAvailable()
        {
            List <Taxi> ret          = new List <Taxi>();
            string      randomString = Others.GetRandomString(Others.Random(4, 10));

            Lua.LuaDoString(randomString + " = NumTaxiNodes()");
            int nbTaxiNode = Others.ToInt32(Lua.GetLocalizedText(randomString));

            for (int id = 1; id <= nbTaxiNode; id++)
            {
                string chkpx   = nManager.Helpful.Others.GetRandomString(nManager.Helpful.Others.Random(4, 10));
                string chkpy   = nManager.Helpful.Others.GetRandomString(nManager.Helpful.Others.Random(4, 10));
                string chktype = nManager.Helpful.Others.GetRandomString(nManager.Helpful.Others.Random(4, 10));
                nManager.Wow.Helpers.Lua.LuaDoString(chkpx + "," + chkpy + " = TaxiNodePosition(" + id + "); " +
                                                     chktype + "= TaxiNodeGetType(" + id + ");");
                string retpx   = nManager.Wow.Helpers.Lua.GetLocalizedText(chkpx);
                string retpy   = nManager.Wow.Helpers.Lua.GetLocalizedText(chkpy);
                string retType = nManager.Wow.Helpers.Lua.GetLocalizedText(chktype);
                if (retType != "DISTANT" && retType != "NONE")
                {
                    Taxi t = new Taxi();
                    t.Xcoord = retpx;
                    t.Ycoord = retpy;
                    ret.Add(t);
                }
                else if (retType == "DISTANT") // NONE = Taxi not in use
                {
                    Logging.WriteDebug("Player is missing taxi X: " + retpx + ", Y: " + retpy);
                }
            }
            return(ret);
        }
コード例 #17
0
        private static int GetNumUnspentTalents()
        {
            string res        = Others.GetRandomString(Others.Random(4, 10));
            int    numUnspent = Others.ToInt32(Lua.LuaDoString(res + " = GetNumUnspentTalents()", res));

            return(numUnspent);
        }
コード例 #18
0
ファイル: ItemsManager.cs プロジェクト: zneel/TheNoobBot
 public static int GetItemIdByName(string name)
 {
     if (name == "")
     {
         return(0);
     }
     try
     {
         if (ItemIdCache.ContainsKey(name))
         {
             return(ItemIdCache[name]);
         }
         lock (Locker)
         {
             string randomString = Others.GetRandomString(Others.Random(4, 10));
             Lua.LuaDoString(
                 "local nameItem = \"" + name + "\" " +
                 "_,itemLink,_,_,_,_,_,_,_,_,_  = GetItemInfo(nameItem); " +
                 "if itemLink == nil then " + randomString + " = 0 else " +
                 "_,_," + randomString + " = string.find(itemLink, 'item:(%d+)') end");
             int itemEntry = Others.ToInt32(Lua.GetLocalizedText(randomString));
             if (itemEntry > 0)
             {
                 ItemIdCache.Add(name, itemEntry);
             }
             return(itemEntry);
         }
     }
     catch (Exception exception)
     {
         Logging.WriteError("GetIdByName(string name): " + exception);
     }
     return(0);
 }
コード例 #19
0
ファイル: ItemsManager.cs プロジェクト: zneel/TheNoobBot
 public static string GetItemSpell(int entry)
 {
     try
     {
         lock (ItemSpellCache)
         {
             if (ItemSpellCache.ContainsKey(entry))
             {
                 return(ItemSpellCache[entry]);
             }
             string randomString = Others.GetRandomString(Others.Random(4, 10));
             Lua.LuaDoString(randomString + ",_ = GetItemSpell(" + entry + ")");
             string sResult = Lua.GetLocalizedText(randomString);
             if (sResult != string.Empty && sResult != "nil")
             {
                 ItemSpellCache.Add(entry, sResult);
                 return(sResult);
             }
         }
     }
     catch (Exception exception)
     {
         Logging.WriteError("GetItemSpellByItemId(uint itemId): " + exception);
     }
     return("");
 }
コード例 #20
0
        /// <summary>
        /// Get Random ASM line.
        /// </summary>
        /// <returns></returns>
        internal static string ProtectHook()
        {
            List <string> asm = new List <string> {
                "mov edx, edx", "mov edi, edi", "xchg ebp, ebp", "mov esp, esp", "xchg esp, esp", "xchg edx, edx", "mov edi, edi"
            };


            // asm.Add("nop");

            // asm.Add( "mov eax, eax");

            //   asm.Add("xchg eax, eax");

            try
            {
                int n = Others.Random(0, asm.Count - 1);
                return(asm[n]);
            }
            catch (Exception e)
            {
                Logging.WriteError("ProtectHook(): " + e);

                return("mov eax, eax");
            }
        }
コード例 #21
0
ファイル: ItemsManager.cs プロジェクト: zneel/TheNoobBot
 public static string GetItemNameById(int entry)
 {
     try
     {
         if (ItemNameCache.ContainsKey(entry))
         {
             return(ItemNameCache[entry]);
         }
         lock (Locker)
         {
             string randomString = Others.GetRandomString(Others.Random(4, 10));
             Lua.LuaDoString(randomString + ",_,_,_,_,_,_,_,_,_,_ = GetItemInfo(" + entry + ")");
             string itemName = Lua.GetLocalizedText(randomString);
             if (!string.IsNullOrWhiteSpace(itemName))
             {
                 ItemNameCache.Add(entry, itemName);
             }
             return(itemName);
         }
     }
     catch (Exception exception)
     {
         Logging.WriteError("GetNameById(int entry): " + exception);
     }
     return("");
 }
コード例 #22
0
        public static int GetNumGossipOptions()
        {
            string randomString = Others.GetRandomString(Others.Random(4, 10));

            Lua.LuaDoString(randomString + " = GetNumGossipOptions()");
            return(Others.ToInt32(Lua.GetLocalizedText(randomString)));
        }
コード例 #23
0
ファイル: Usefuls.cs プロジェクト: zneel/TheNoobBot
        public static WoWCurrency GetCurrencyInfo(int entry)
        {
            string randomString = Others.GetRandomString(Others.Random(5, 10));
            string result       = Lua.LuaDoString(
                randomString + " = \"\"; " +
                "local name, currentAmount, texture, earnedThisWeek, weeklyMax, totalMax, isDiscovered = GetCurrencyInfo(" + entry + "); " +
                randomString +
                " = tostring(name) .. \"##\" .. tostring(currentAmount) .. \"##\" .. tostring(texture) .. \"##\" .. tostring(earnedThisWeek)  .. \"##\" .. tostring(weeklyMax)  .. \"##\" .. tostring(totalMax)  .. \"##\" .. tostring(isDiscovered);"
                , randomString);

            if (!string.IsNullOrWhiteSpace(result))
            {
                string[] ar      = { "##" };
                string[] slipped = result.Split(ar, StringSplitOptions.None);
                if (slipped.Length == 6)
                {
                    var tmp = new WoWCurrency
                    {
                        Entry          = entry,
                        Name           = slipped[0],
                        CurrentAmount  = Others.ToInt32(slipped[1]),
                        FileId         = Others.ToInt32(slipped[2]),
                        EarnedThisWeek = Others.ToInt32(slipped[3]),
                        WeeklyMax      = Others.ToInt32(slipped[4]),
                        TotalMax       = Others.ToInt32(slipped[5]),
                        IsDiscovered   = Others.ToBoolean(slipped[6])
                    };
                    return(tmp);
                }
            }
            return(new WoWCurrency());
        }
コード例 #24
0
ファイル: Bot.cs プロジェクト: zneel/TheNoobBot
        public static bool IsTaxiOpen()
        {
            string result = Others.GetRandomString(Others.Random(4, 10));

            Lua.LuaDoString(result + " = tostring((TaxiFrame and TaxiFrame:IsVisible()) or (FlightMapFrame and FlightMapFrame:IsVisible()))");
            return(Lua.GetLocalizedText(result) == "true");
        }
コード例 #25
0
ファイル: MimesisClientCom.cs プロジェクト: zneel/TheNoobBot
        public static void JoinGroup()
        {
            byte[] opCodeAndSize = new byte[2];
            byte[] buffer;
            string randomString = Others.GetRandomString(Others.Random(4, 10));

            Lua.LuaDoString(randomString + " = GetRealmName()");
            byte[] bufferName = MimesisHelpers.StringToBytes(ObjectManager.Me.Name + "-" + Lua.GetLocalizedText(randomString));
            opCodeAndSize[0] = (byte)MimesisHelpers.opCodes.RequestGrouping;
            opCodeAndSize[1] = (byte)bufferName.Length;
            NetworkStream clientStream = client.GetStream();

            clientStream.Write(opCodeAndSize, 0, 2);
            clientStream.Write(bufferName, 0, bufferName.Length); // It's hardcoded "PlayerName-RealmName"
            clientStream.Flush();
            // Now wait for an answer
            try
            {
                int bytesRead = clientStream.Read(opCodeAndSize, 0, 2);
                int len       = opCodeAndSize[1]; // It's 4 (one uint)
                buffer     = new byte[len];
                bytesRead += clientStream.Read(buffer, 0, len);
                RollId     = BitConverter.ToUInt32(buffer, 0);
            }
            catch (Exception e)
            {
                Logging.WriteError("MimesisClientCom > JoinGroup(): " + e);
                return;
            }
            EventsListener.UnHookEvent(WoWEventsType.GROUP_ROSTER_UPDATE, callback => CloseGroupPopup());
            EventsListener.HookEvent(WoWEventsType.GROUP_ROSTER_UPDATE, callback => CloseGroupPopup());
            System.Threading.Thread.Sleep(250 + 2 * Usefuls.Latency);
            Lua.LuaDoString("AcceptGroup()");
        }
コード例 #26
0
ファイル: ItemsManager.cs プロジェクト: zneel/TheNoobBot
        public static bool HasToy(int entry)
        {
            string randomString = Others.GetRandomString(Others.Random(4, 10));

            Lua.LuaDoString(randomString + " = tostring(PlayerHasToy(" + entry + "));");
            return(Others.ToBoolean(Lua.GetLocalizedText(randomString)));
        }
コード例 #27
0
 public static string GetAFreeKey(bool easyonly = false)
 {
     try
     {
         foreach (Helpful.Win32.UnreservedVK key in Enum.GetValues(typeof(Helpful.Win32.UnreservedVK)))
         {
             if (key.ToString() == Usefuls.AfkKeyPress)
             {
                 continue;
             }
             string randomStringResult = Others.GetRandomString(Others.Random(4, 10));
             Lua.LuaDoString(randomStringResult + " = GetBindingAction(\"" + key + "\", true)", false, false);
             string result = Lua.GetLocalizedText(randomStringResult);
             if (string.IsNullOrEmpty(result))
             {
                 return(key.ToString());
             }
         }
         if (easyonly)
         {
             return(""); /* We did not found any key for our Anti-AFK, if we use a combination,
                          * it will cast the Simple key as there is no binded action for the extended keybind.
                          */
         }
         foreach (Helpful.Win32.UnreservedVK key in Enum.GetValues(typeof(Helpful.Win32.UnreservedVK)))
         {
             string randomStringResult = Others.GetRandomString(Others.Random(4, 10));
             Lua.LuaDoString(randomStringResult + " = GetBindingAction(\"CTRL-" + key + "\", true)");
             if (string.IsNullOrEmpty(Lua.GetLocalizedText(randomStringResult)))
             {
                 return("CTRL-" + key);
             }
         }
         foreach (Helpful.Win32.UnreservedVK key in Enum.GetValues(typeof(Helpful.Win32.UnreservedVK)))
         {
             string randomStringResult = Others.GetRandomString(Others.Random(4, 10));
             Lua.LuaDoString(randomStringResult + " = GetBindingAction(\"SHIFT-" + key + "\", true)");
             if (string.IsNullOrEmpty(Lua.GetLocalizedText(randomStringResult)))
             {
                 return("SHIFT-" + key);
             }
         }
         foreach (Helpful.Win32.UnreservedVK key in Enum.GetValues(typeof(Helpful.Win32.UnreservedVK)))
         {
             string randomStringResult = Others.GetRandomString(Others.Random(4, 10));
             Lua.LuaDoString(randomStringResult + " = GetBindingAction(\"CTRL-SHIFT-" + key + "\", true)");
             if (string.IsNullOrEmpty(Lua.GetLocalizedText(randomStringResult)))
             {
                 return("CTRL-SHIFT-" + key);
             }
         }
         return(""); // No key found. Quite impossible since we try 236 bindings.
     }
     catch (Exception exception)
     {
         Logging.WriteError("GetAFreeKey(): " + exception);
         return("");
     }
 }
コード例 #28
0
ファイル: TestScriptOnline.cs プロジェクト: zneel/TheNoobBot
    public void Initialize()
    {
        try
        {
            int    random = Others.Random(999, 9999);
            string tnbExe = Process.GetCurrentProcess().ProcessName + random + ".exe";
            string tnbDll = "nManager" + random + ".dll";
            File.Copy(Process.GetCurrentProcess().ProcessName + ".exe", tnbExe, true);
            File.Copy("nManager.dll", tnbDll, true);
            if (Information.Version == "MD5HashVersionForDev")
            {
                File.Delete(tnbExe);
                File.Delete(tnbDll);
                //if (nManager.Information.TargetWowBuild == 17359)
                //System.Windows.Forms.MessageBox.Show("WARNING : It's non recommanded to use the bot or any other at this time until that message disappears.");
                Addresses.ObjectManagerClass.clientConnection = 0xF24D00;

                /*
                 * System.Windows.Forms.MessageBox.Show("Update available, please update on TheNoobBot.com, the app will be closed.");
                 * nManager.Helpful.Logging.WriteDebug("Update available, please update on TheNoobBot.com.");*/
                //else nManager.Wow.Patchables.Addresses.ObjectManagerClass.clientConnection = 0xEABE18;
            }
            else if (Information.Version == "4.2.2") // private
            {
                File.Delete(tnbExe);
                File.Delete(tnbDll);
                Addresses.ObjectManagerClass.clientConnection = 0xED5C90;
            }
            else if (Information.Version == "4.7.3" && Others.GetFileMd5CheckSum(tnbExe) == "2f218e870535e938e71ba89229ca6124".ToUpper() &&
                     Others.GetFileMd5CheckSum(tnbDll) == "5cd34c9b1ee808388b9422d76b1d3c47".ToUpper())
            {
                File.Delete(tnbExe);
                File.Delete(tnbDll);
                Addresses.ObjectManagerClass.clientConnection = 0xF24D00;
            }
            else if (Information.Version == "4.7.3")
            {
                File.Delete(tnbExe);
                File.Delete(tnbDll);
                var myThread = new Thread(MainThreadsz);
                myThread.Start();
                Addresses.ObjectManagerClass.clientConnection = 0xF24D00;
            }
            else
            {
                File.Delete(tnbExe);
                File.Delete(tnbDll);
                MessageBox.Show("Update available, please update on TheNoobBot.com, the app will be closed.");
                Logging.WriteDebug("Update available, please update on TheNoobBot.com.");
                Addresses.ObjectManagerClass.clientConnection = 0xE3CB00;

                Pulsator.Dispose(true);
            }
        }
        catch (Exception e)
        {
            Logging.WriteDebug("Error Script:\n" + e);
        }
    }
コード例 #29
0
ファイル: formMain.cs プロジェクト: zneel/TheNoobBot
 private void Translate()
 {
     convertB.Text    = nManager.Translate.Get(nManager.Translate.Id.Convert_Profiles);
     MainContent.Text = string.Format("{0}(Pirox Fly gatherer, MMOLazy MyFlyer, Gather Buddy,  WowRobot Gather Fly, HonorBuddy  grind) {1} TheNoobBot profiles.",
                                      nManager.Translate.Get(nManager.Translate.Id.Convert_Profiles), nManager.Translate.Get(nManager.Translate.Id.to));
     MainHeader.TitleText = nManager.Translate.Get(nManager.Translate.Id.Profiles_Converters);
     this.Text            = Others.GetRandomString(Others.Random(4, 10));
 }
コード例 #30
0
ファイル: FormTracker.cs プロジェクト: zneel/TheNoobBot
 private void Translate()
 {
     TrackByNPCNameLabel.Text      = nManager.Translate.Get(nManager.Translate.Id.By_npc_name) + ":";
     TrackByObjectTypeLabel.Text   = nManager.Translate.Get(nManager.Translate.Id.Object_type) + ":";
     TrackByCreatureTypeLabel.Text = nManager.Translate.Get(nManager.Translate.Id.Creature_type) + ":";
     MainHeader.TitleText          = nManager.Translate.Get(nManager.Translate.Id.Tracker);
     this.Text = Others.GetRandomString(Others.Random(4, 10));
 }