'// Powered by xKLONx =) '// Variables Public Usrname '// Имя пользователя, для которого была использована команда /stats Public WhisperMessage '// Последнее личное сообщение от пользователя Public InfoMessage '// Последнее информационное сообщение с battle.net(синее) Public ErrorMessage '// Последнее сообщение об ошибке с battle.net(красное) Public TalkMessage '// Последнее сообщение пользователя Public EmoteMessage '// Последнее сообщение пользователя /emote(серое) Public OrigStatString '// Информация о последнем зашедшем на канал пользователе Public ChnlName '// Название текущего канала(?) Public TalkUsername Public solopr Public eer Public statread, solowins, sololosses, soloprocent, ffawins, ffalosses, ffaprocent, teamwins, _ teamlosses, teamprocent, teamlevel, sololevel, ffalevel, fiks
'// Function GetStat(Statstring, Value) Dim Product, StatArray, StatArray2(50), SaveStatString StatArray = Split(Statstring, " ") Product = Left(Statstring, 4) GetStat = "" Select Case Product Case "3RAW" If Len(Statstring) = 4 And Value <> 0 Then Exit Function End If Select Case Value Case 0 GetStat = "WarCraft III: Reign of Chaos" Case 1 GetStat = StatArray(2) Case 2 Select Case Mid(StatArray(1), 2, 1) Case "H" GetStat = "Human" Case "O" GetStat = "Orc" Case "U" GetStat = "Undead" Case "N" GetStat = "Night Elf" Case "R" GetStat = "Random" End Select Case 3 Select Case Mid(StatArray(1), 2, 1) Case "H" Select Case Mid(StatArray(1), 1, 1) Case 1 GetStat = "Peon" Case 2 GetStat = "Footman" Case 3 GetStat = "Knight" Case 4 GetStat = "Archmage" Case 5 GetStat = "Medivh" End Select Case "O" Select Case Mid(StatArray(1), 1, 1) Case 1 GetStat = "Peon" Case 2 GetStat = "Grunt" Case 3 GetStat = "Tauren" Case 4 GetStat = "Far Seer" Case 5 GetStat = "Thrall" End Select Case "U" Select Case Mid(StatArray(1), 1, 1) Case 1 GetStat = "Peon" Case 2 GetStat = "Ghoul" Case 3 GetStat = "Abomination" Case 4 GetStat = "Lich" Case 5 GetStat = "Tichondrius" End Select Case "U" Select Case Mid(StatArray(1), 1, 1) Case 1 GetStat = "Peon" Case 2 GetStat = "Archer" Case 3 GetStat = "Druid of the Claw" Case 4 GetStat = "Priestess of the Moon" Case 5 GetStat = "Furion Stomrage" End Select Case "R" Select Case Mid(StatArray(1), 1, 1) Case 1 GetStat = "Peon" Case 2 GetStat = "Green Dragon Whelp" Case 3 GetStat = "Blue Dragon" Case 4 GetStat = "Red Dragon" Case 5 GetStat = "Deathwing" End Select End Select Case 4 If UBound(StatArray) > 2 Then GetStat = StrReverse(StatArray(3)) End If End Select Case "PX3W" If Len(Statstring) = 4 And Value <> 0 Then Exit Function End If Select Case Value Case 0 GetStat = "WarCraft III: The Frozen Throne" Case 1 GetStat = StatArray(2) Case 2 Select Case Mid(StatArray(1), 2, 1) Case "H" GetStat = "Human" Case "O" GetStat = "Orc" Case "U" GetStat = "Undead" Case "N" GetStat = "Night Elf" Case "R" GetStat = "Random" Case "D" GetStat = "Tournament" End Select Case 3 Select Case Mid(StatArray(1), 2, 1) Case "H" Select Case Mid(StatArray(1), 1, 1) Case 1 GetStat = "Peon" Case 2 GetStat = "Rifleman" Case 3 GetStat = "Sorceress" Case 4 GetStat = "Spellbreaker" Case 5 GetStat = "Blood Mage" Case 6 GetStat = "Jaina" End Select Case "O" Select Case Mid(StatArray(1), 1, 1) Case 1 GetStat = "Peon" Case 2 GetStat = "Troll headhunter" Case 3 GetStat = "Shaman" Case 4 GetStat = "Spirit Walker" Case 5 GetStat = "Shadow hunter" Case 6 GetStat = "Rexxar" End Select Case "U" Select Case Mid(StatArray(1), 1, 1) Case 1 GetStat = "Peon" Case 2 GetStat = "Crypt Fiend" Case 3 GetStat = "Banshee" Case 4 GetStat = "Destroyer" Case 5 GetStat = "Crypt Lord" Case 6 GetStat = "Sylvanas" End Select Case "N" Select Case Mid(StatArray(1), 1, 1) Case 1 GetStat = "Peon" Case 2 GetStat = "Huntress" Case 3 GetStat = "Druid of the Talon" Case 4 GetStat = "Dryad" Case 5 GetStat = "Keeper of the Grove" Case 6 GetStat = "Maiev" End Select Case "R" Select Case Mid(StatArray(1), 1, 1) Case 1 GetStat = "Peon" Case 2 GetStat = "Myrmidon" Case 3 GetStat = "Siren" Case 4 GetStat = "Dragon Turtle" Case 5 GetStat = "Sea Witch" Case 6 GetStat = "Illidan" End Select Case "D" Select Case Mid(StatArray(1), 1, 1) Case 1 GetStat = "Peon" Case 2 GetStat = "Felguard" Case 3 GetStat = "infernal" Case 4 GetStat = "Doomguard" Case 5 GetStat = "Pit Lord" Case 6 GetStat = "Archimonde" End Select End Select Case 4 If UBound(StatArray) > 2 Then GetStat = StrReverse(StatArray(3)) End If End Select Case "LTRD", "RHSD" Select Case Value Case 0 Select Case Product Case "LTRD" GetStat = "Diablo" Case "RHSD" GetStat = "Diablo: Shareware" End Select Case 1 GetStat = StatArray(1) Case 2 GetStat = StatArray(2) Case 3 Select Case StatArray(2) Case 0 GetStat = "Warrior" Case 1 GetStat = "Rogue" Case 2 GetStat = "Sorceror" End Select Case 4 GetStat = StatArray(4) Case 5 GetStat = StatArray(5) Case 6 GetStat = StatArray(6) Case 7 GetStat = StatArray(7) Case 8 GetStat = StatArray(8) Case 9 If UBound(StatArray) <> 9 Then GetStat = True Else GetStat = False End If End Select Case "RATS", "PXES", "RTSJ", "NB2W" Select Case Value Case 0 Select Case Product Case "RATS" GetStat = "Starcraft" Case "PXES" GetStat = "Starcraft: Brood War" Case "RTSJ" GetStat = "Starcraft: Japanese" Case "NB2W" GetStat = "Warcraft II: Battle.net Edition" End Select Case 1 GetStat = StatArray(3) Case 2 If StatArray(1) <> "0" Then GetStat = StatArray(1) End If Case 3 If StatArray(5) <> "0" Then GetStat = StatArray(5) End If Case 4 If StatArray(2) <> "0" Then GetStat = StatArray(2) End If Case 5 If StatArray(4) = 1 Then GetStat = True Else GetStat = False End If Case 6 If UBound(StatArray) <> 9 Then GetStat = "True" Else GetStat = "False" End If End Select Case "RHSS" If Value = 0 Then GetStat = "Starcraft: Shareware" End If Case "TAHC" If Value = 0 Then GetStat = "Chat Bot" End If Case "PX2D", "VD2D" Select Case Value Case 0 Select Case Product Case "PX2D" GetStat = "Diablo II: Lord of Destruction" Case "VD2D" GetStat = "Diablo II" End Select Case 1 If Len(Statstring) = 4 Then GetStat = True Else GetStat = False End If Case 2 GetStat = Mid(Statstring, 5, InStr(5, Statstring, ",") - 5) Case 3 GetStat = Mid(Statstring, InStr(5, Statstring, ",") + 1, InStr(InStr(5, Statstring, ",") + 1, Statstring, ",") - InStr(5, Statstring, ",") - 1) End Select Case Else If Value = 0 Then GetStat = "Unknown" End If End Select End Function
'// Sub Event_Load() sctimer.Enabled = False sctimer.Interval = 45000 AddChat vbGreen, "Канальный.Автоприглашалка" eer = 0: statread = True End Sub
'// Sub Event_ServerInfo(Message) InfoMessage = Message If InStr(Message, "- Ladder ") > 0 Then UserStatArray = Split(Message, " ") Laddername = UserStatArray(2) ldrlen = Len(UserStatArray(2)) Select Case Mid(UserStatArray(2), 1, ldrlen) Case "SOLO," ladder = "SOLO" If InStr(Message, ", Level ") > 0 Then lvllen = Len(UserStatArray(4)) Level = Left(UserStatArray(4), lvllen - 1) End If If InStr(Message, ", Wins ") > 0 Then winlen = Len(UserStatArray(6)) wins = Left(UserStatArray(6), winlen - 1) End If If InStr(Message, ", Losses ") > 0 Then lsslen = Len(UserStatArray(8)) losses = Left(UserStatArray(8), lsslen) End If Case "TEAM," ladder = "TEAM" If InStr(Message, ", Level ") > 0 Then lvllen = Len(UserStatArray(4)) Level = Left(UserStatArray(4), lvllen - 1) End If If InStr(Message, ", Wins ") > 0 Then winlen = Len(UserStatArray(6)) wins = Left(UserStatArray(6), winlen - 1) End If If InStr(Message, ", Losses ") > 0 Then lsslen = Len(UserStatArray(8)) losses = Left(UserStatArray(8), lsslen) End If Case "FFA" ladder = "FFA" If InStr(Message, ", Level ") > 0 Then lvllen = Len(UserStatArray(5)) Level = Left(UserStatArray(5), lvllen - 1) End If If InStr(Message, ", Wins ") > 0 Then winlen = Len(UserStatArray(7)) wins = Left(UserStatArray(7), winlen - 1) End If If InStr(Message, ", Losses ") > 0 Then lsslen = Len(UserStatArray(9)) losses = Left(UserStatArray(9), lsslen) End If Case Else ladder = "Unknown": Level = "Unknown": wins = "Unknown": losses = "Unknown" End Select End If wins = Int(wins): losses = Int(losses) If losses <> 0 And wins <> 0 Then procent = Int(wins / (wins + losses) * 1000) procent = procent / 10 End If Level = Int(Level) If ladder = "SOLO" Then sololevel = Level solowins = wins: sololosses = losses soloprocent = procent End If If ladder = "FFA" Then ffalevel = Level ffawins = wins: ffalosses = losses ffaprocent = procent End If If ladder = "TEAM" Then teamlevel = Level teamwins = wins: teamlosses = losses teamprocent = procent End If If InStr(Message, "- Ladder ") > 0 And fiks Then Call Inviter End Sub
'// Sub Event_ServerError(Message) ErrorMessage = Message If InStr(Message, "The invitation failed.") > 0 Then AddQ "Opps.. the invitation failed." AddQ "Try again!" statread = True End If If InStr(Message, "Too many server requests") > 0 Then AddQ "Sry батла глючит напиши ещё :(" statread = True End If If InStr(Message, "No stats on record") > 0 Then AddQ Usrname & " ты не подходиш..." statread = True End If End Sub
'// Sub Inviter() If sololevel >= 10 And soloprocent >= 51.5 And statread = False Then AddQ "hmm " & soloprocent & "% not so bad ^-_-^" AddQ "Welcome !! :D" Command BotVars.Username, ".invite " & Usrname, 0 statread = True fiks = False Else If teamlvl >= 15 And teamprocent >= 51.5 And sololevel >= 3 And soloprocent >= 51.5 And statread = False Then Command BotVars.Username, ".invite " & Usrname, 0 AddQ "Welcome !! :D" statread = True: fiks = False Else If ffalevel > 10 And ffaprocent > 51 And statread = False Then Command BotVars.Username, ".invite " & Usrname, 0 AddQ "Welcome !! :D" statread = True: fiks = False Else AddQ Usrname & " ты не подходиш..." statread = True: fiks = False End If End If End If End Sub
'// Fires when a user on battle.net talks. '// Срабатывает когда пользователь на battle.net говорит. Sub Event_UserTalk(Username, Flags, Message, Ping) Dim myAccess, myFlags GetDBentry Username, myAccess, myFlags TalkUsername = Username: TalkMessage = Message clan = GetInternalDataByUsername(Username, 0) If LCase(Message) = "join" And statread Then If clan = "" Then AddQ "Check stats..." AddQ "W8 plz..." AddQ "/stats " & Username & " w3xp" Usrname = Username statread = False fiks = True sololevel = 0: teamlevel = 0: ffalevel = 0 solowins = 0: teamwins = 0: ffawins = 0 sololosses = 0: teamlosses = 0: ffalosses = 0 soloprocent = 0: teamprocent = 0: ffaprocent = 0 Else AddQ Username & " ты должен сначала выйти из " & clan End If End If If InStr(LCase(Message), "пинг") > 0 Then AddQ "" & Username & ", ваш пинг " & Ping & "" End If If LCase(Message) = ".whoami" And myAccess <= 0 Then AddQ "Pease shit is you !!!" End If If InStr(LCase(Message), "время") > 0 Then AddQ "" & Time & "" End If If InStr(LCase(Message), ".banme") > 0 Then AddQ "/ban " & Username & " U say ban u..." End If If InStr(LCase(Message), ".kickme") > 0 Then AddQ "/kick " & Username & " U say kick u..." End If End Sub
'// Fires when a user speaks with /emote. '// Срабатывает когда пользователь говорит с /emote (/me ?) Sub Event_UserEmote(Username, Flags, Message) EmoteMessage = Message 'AddChat vbRed, "Пользователь "&Username&" что-то хочет урод !!!" End Sub
'// Fires when a whisper is recieved. '// Срабатывает когда принято личное сообщение Sub Event_WhisperFromUser(Username, Flags, Message) WhisperMessage = Message If LCase(Message) = "join" Then AddQ "/stats " & Username & " w3xp" End Sub
'// Sub Event_UserJoins(Username, Flags, Message, Ping, Product, Level, OriginalStatstring) OrigStatString = OriginalStatstring game = GetStat(OriginalStatstring, 0) ChnlName = ChannelName Level = GetStat(OriginalStatstring, 1) Level = Int(Level) race = GetStat(OriginalStatstring, 2) Icon = GetStat(OriginalStatstring, 3) clan = GetStat(OriginalStatstring, 4) stat = "Игра: " & game & ", уровень: " & Level & ", лучшая раса: " & race & ", иконка: " & Icon & ", клан: " & clan & "" If clan = "" And Level > 3 Then AddQ "Хочеш войти в клан просто напиши join" End Sub
'// Sub Event_UserLeaves(Username, Flags) ' End Sub
'// Sub Event_FlagUpdate(Username, NewFlags, Ping) ' End Sub
'// Sub Event_LoggedOn(Username, Product) AddChat vbYellow, "Successful Login at " & Product & " !!!" End Sub
'// Sub Event_UserInChannel(Username, Flags, Message, Ping, Product) ' End Sub
'// Flags in this case stores the channel's flags. '// Флаги в этом случае хранят флаги канала(Я не понял это). Sub Event_ChannelJoin(ChannelName, Flags) ChnlName = ChannelName End Sub
Sub sc_Timer() flnum = 5 say0 = "/me Xo4EIII B good KJIaH go KaHaJI clan CTT" say1 = "/me Xo4EIII B good KJIaH go KaHaJI clan CTT" say2 = "Хочеш в клан го канал clan CTT" say3 = "Пинг не скажу хочеш узнать пинг зайди на clan CTT" say4 = "/me Xo4EIII B good KJIaH go KaHaJI clan CTT" If eer = 0 Then AddQ "" & say0 & "" End If If eer = 1 Then AddQ "" & say1 & "" End If If eer = 2 Then AddQ "" & say2 & "" End If If eer = 3 Then AddQ "" & say3 & "" End If If eer = 4 Then AddQ "" & say4 & "" End If If eer = 5 Then AddQ "" & say5 & "" End If eer = eer + 1 If eer = flnum Then eer = 0 End If End Sub
'// Executes after the user presses ENTER in the Send box on the bot. Text will always be processed by the bot and sent to battle.net before arriving here. '// Исполняется после того как пользователь нажмёт ENTER в боте. Текст всегда будет обрабатываться ботом и отправляться на Battle.net перед передачей сюда. Sub Event_PressedEnter(Text) 'Addchat vbBrown, "Нажата клавиша Enter." End Sub
'// Executes when the bot recieves a Profile return from the server. KeyName will be one of the following: '// Выполняется когда бот принимает профиль возвращенный сервером. keyName будет одним из следующего: ' Profile\Sex ' Profile\Location ' Profile\Description '// KeyValue will contain the value of that profile key as a string. '// keyValue содержит значение ключей как строку. Sub Event_KeyReturn(KeyName, KeyValue) 'AddChat vbRed, ""&KeyName&" "&KeyValue&"" End Sub
'// Executes when the bot is closed. You can use this sub to write things to disk before the bot shuts down. '// Выполняется когда бота закрывают. Вы можете использовать это для записи на диск перед тем как бот закончит работу. Sub Event_Close() AddChat vbGreen, "StealthBot shutdown !!!" End Sub |