Code:'bestinchannel '1.0 'Improved by t[x]aS@DrOiD 'Scripted/Writen By: 'Battle.NET West Account: ToughLuv 'aKa TutMatt on stealthbot Forums 'Improved by t[x]aS@DrOiD dim Users(40) dim txtgate txtgate = "Northrend" 'txtgate = "Azeroth" 'txtgate = "Lordaeron" '----------------------------------------------------------------- 'Do Not Edit Below This Line '----------------------------------------------------------------- Sub bestinchannel_event_UserTalk(Username, Flags, Message, Ping) If left(lcase(message),14) = botvars.trigger & "bestinchannel" Then Call ssc.GetDBEntry(username, Access, Flags) if Access < 70 then exit sub addq "/emote **** Searching The Best of " & GetInternalUserCount() & " [ " & myChannel & " ] **** " call best(username, ping) End If End Sub Sub bestinchannel_Event_WhisperFromUser(Username, Flags, Message) Call bestinchannel_event_UserTalk(Username, Flags, Message, -4) End Sub Sub bestinchannel_Event_PressedEnter(Text) Call bestinchannel_event_UserTalk(Username, 0, Text, -3) End Sub '----------------------------------------------------------------- Sub best(username, htr) If scinet.stillexecuting Then addq "/emote ******** I'm BuSy ********" Exit Sub End If Txttotal = GetInternalUserCount() For i = 1 to 40 Users(i) = "" next For i = 1 to GetInternalUserCount() Users(i) = GetNameByPosition(i) next For i = 1 to 40 if users(i) <> "" then name = users(i) content = scinet.openurl("http://www.battle.net/war3/ladder/war3-player-profile.aspx?Gateway="& txtgate & "&PlayerName="&name) addchat vbred, i if i = 3 then addq "/emote *** Working... [ " & TxtPorcent(i,Txttotal) & " % DoNe ] ...Wait plz... " if i = 8 then addq "/emote *** Working... [ " & TxtPorcent(i,Txttotal) & " % DoNe ] ...Wait plz... " if i = 14 then addq "/emote *** Working... [ " & TxtPorcent(i,Txttotal) & " % DoNe ] ...Wait plz... " if i = 19 then addq "/emote *** Working... [ " & TxtPorcent(i,Txttotal) & " % DoNe ] ...Wait plz... " if i = 25 then addq "/emote *** Working... [ " & TxtPorcent(i,Txttotal) & " % DoNe ] ...Wait plz... " if i = 29 then addq "/emote *** Working... [ " & TxtPorcent(i,Txttotal) & " % DoNe ] ...Wait plz... " if i = 34 then addq "/emote *** Working... [ " & TxtPorcent(i,Txttotal) & " % DoNe ] ...Wait plz... " if i = 38 then addq "/emote *** Working... [ " & TxtPorcent(i,Txttotal) & " % DoNe ] ...Wait plz... " 'if i = 36 then addq "/emote *** Working... [ " & TxtPorcent(i,Txttotal) & " % DoNe ] ...Wait plz... " pos1 = instr(content, "Total") pos1 = instr(pos1,content,"rankingRow") pos1 = instr(pos1, content, ">")+1 pos2 = instr(pos1, content, "<") wins = mid(content, pos1, pos2-pos1) pos1 = instr(pos1, content, "%")-15 pos1 = instr(pos1, content, ">")+1 pos2 = instr(pos1, content, "<")-2 percent = mid(content, pos1, pos2-pos1) if wins > 100 then If int(wins) > mostwins Then mostwins = int(wins) tp = csng(percent) winname = name Elseif int(wins) = mostwins Then If csng(percent) > tp Then winname = name ElseIf csng(percent) = tp Then winname = winname & ", " & name End If End If if isnumeric(percent) then If CSng(percent) > mostpercent Then mostpercent = CSng(percent) tw = wins Bestname = name Elseif CSng(percent) = mostpercent Then If wins > tw Then Bestname = name ElseIf wins = tw Then bestname = bestname & ", " & name End If End If end if end if end if Next addchat vbred, "Mas Wins: " & winname & " " & wins & " " & tp addchat vbgreen,"El Mejor: " & bestname & " " & tw & " " & mostpercent If mostwins = 0 Then Select Case Ping Case -4 addq "/w " & username & " Everyone in this channel have no wins" Case -3 addchat vbgreen, "Everyone in this channel have no wins" Case Else addq "Everyone in this channel have no wins" End Select Exit Sub End If x = split(winname) If ubound(x) =0 Then tp = left(tp,2) & "." & mid(tp,3) message = "/emote [ " & winname & " ] has the most wins in the channel (" & mostwins & " wins) (" & tp & " %)" Elseif ubound(x) > 0 Then tp = left(tp,2) & "." & mid(tp,3) message = "/emote [ " & winname & " ] have the most wins in the channel (" & mostwins & " wins) (" & tp & " %)" End If x = split(bestname) If ubound(x) = 0 Then mostpercent = left(mostpercent,2) & "." & mid(mostpercent,3) if mostpercent = "10.000" then mostpercent = "100" message2 = "/emote [ " & bestname &" ] Is the best for me in the channel (" & mostpercent & " %) (" & tw & " wins)" Elseif ubound(x) > 0 Then mostpercent = left(mostpercent,2) & "." & mid(mostpercent,3) message2 = "/emote [ " & bestname &" ] have the best % in the channel (" & mostpercent & " %) (" & tw & " wins)" End If Select Case htr Case -4 addq "/w " & username & " " & message addq "/w " & username & " " & message2 Case -3 addchat vbgreen, message addchat vbgreen, message2 Case Else addq message addq message2 End Select End Sub function TxtPorcent(i,txttotal) TxtPorcent = i * 100/Txttotal TxtPorcent = left(TxtPorcent,5) end function


LinkBack URL
About LinkBacks
Reply With Quote
![Send a message via MSN to Alt-F[4]](http://www.d3scene.com/forum/images/misc/im_msn.gif)

For me it works sometimes...
... 1 time -.-