To be used for archiving purposes only. No new posts will be made. View Scope's Farewell Message
Private Sub tmrIdle_Timer()If GetINI(ProfileToLoad, "EnableIdle", vbNullString, App.Path & "\Profiles.ini") = "1" Then If (GetTickCount - IdleTime) = GetINI(ProfileToLoad, "IdleInterval", vbNullString, App.Path & "\Profiles.ini") * 60000 Then Select Case GetINI(ProfileToLoad, "IdleType", vbNullString, App.Path & "\Profiles.ini") Case "Msg" If Len(GetINI(ProfileToLoad, "IdleMsg", vbNullString, App.Path & "\Profiles.ini")) >= 255 Then AddChat vbRed, "Your idle message is too long. Please shorten it by ", vbWhite, Len(GetINI(ProfileToLoad, "IdleMsg", vbNullString, App.Path & "\Profiles.ini")) / 255, vbRed, " character(s)." IdleTime = GetTickCount() Exit Sub Else Connection.s0x0E GetINI(ProfileToLoad, "IdleMsg", vbNullString, App.Path & "\Profiles.ini") IdleTime = GetTickCount() End If Case "Mp3" Connection.s0x0E "/me [Winamp] " & modWinamp.GetSong & " - KrewBot " & App.Major & "." & App.Minor & "." & App.Revision IdleTime = GetTickCount() Case "Version" Connection.s0x0E "/me KrewBot " & App.Major & "." & App.Minor & "." & App.Revision IdleTime = GetTickCount() End Select End IfElseIf GetINI(ProfileToLoad, "EnableIdle", vbNullString, App.Path & "\Profiles.ini") <> "1" Then tmrIdle.Enabled = FalseEnd IfEnd Sub
Private Sub tmrIdle_Timer()If GetINI(ProfileToLoad, "EnableIdle", vbNullString, App.Path & "\Profiles.ini") = "1" And IsConnected = True Then Dim i As Integer For i = 0 To GetINI(ProfileToLoad, "IdleInterval", vbNullString, App.Path & "\Profiles.ini") IdleTriggers = IdleTriggers + 1 If IdleTriggers > GetINI(ProfileToLoad, "IdleInterval", vbNullString, App.Path & "\Profiles.ini") Then IdleTriggers = 1 End If Next i If IdleTriggers = GetINI(ProfileToLoad, "IdleInterval", vbNullString, App.Path & "\Profiles.ini") Then Select Case GetINI(ProfileToLoad, "IdleType", vbNullString, App.Path & "\Profiles.ini") Case "Msg" If Len(GetINI(ProfileToLoad, "IdleMsg", vbNullString, App.Path & "\Profiles.ini")) >= 255 Then AddChat vbRed, "Your idle message is too long. Please shorten it by ", vbWhite, Len(GetINI(ProfileToLoad, "IdleMsg", vbNullString, App.Path & "\Profiles.ini")) / 255, vbRed, " character(s)." IdleTriggers = 1 Exit Sub Else Connection.s0x0E GetINI(ProfileToLoad, "IdleMsg", vbNullString, App.Path & "\Profiles.ini") IdleTriggers = 1 End If Case "Mp3" Connection.s0x0E "/me [Winamp] " & modWinamp.GetSong & " - KrewBot " & App.Major & "." & App.Minor & "." & App.Revision IdleTriggers = 1 Case "Version" Connection.s0x0E "/me KrewBot " & App.Major & "." & App.Minor & "." & App.Revision IdleTriggers = 1 End Select End IfEnd IfEnd Sub
Private Sub chopQueue(ByRef theText As String)Dim textPrefix As String 'AWhisper = "/w " 'ASpace = " " If AscW(theText) = 47 Then '47 / If Len(theText) > 4 And Left$(LCase$(theText), 3) = AWhisper Then textPrefix = Left$(theText, InStr(4, theText, ASpace)) 'set prefix theText = Mid$(theText, (Len(textPrefix) + 1)) 'cuts past the prefix End If 'if string is longer than 4 chars and is a whisper store the /w name part 'if left is a / End If Do Until LenB(theText) = 0 Add_to_Queue textPrefix & Left$(theText, (220 - Len(textPrefix))) 'queues item theText = Mid$(theText, (221 - Len(textPrefix))) 'parses next Loop 'add to queue End Sub'makes sure they dont send really long strings
'declaresPrivate Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPrivate Declare Function GetWindowText Lib "user32.dll" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As LongPrivate Const WM_USER As Long = &H400Private Const IPC_UPDTITLE As Long = &HF3'for mp3 idlePublic Sub GetSong(ByRef Index As Integer, ByRef echoCommand As Boolean)Dim iTunes_hWnd As Long, theSong As StringDim Winamp_hWnd As Long iTunes_hWnd = FindWindow("iTunes", vbNullString) Winamp_hWnd = FindWindow("Winamp v1.x", vbNullString) If Winamp_hWnd = 0 And iTunes_hWnd = 0 Then Exit Sub 'if 0 then winamp isnt open If Winamp_hWnd <> 0 Then 'if winamp SendMessage Winamp_hWnd, WM_USER, 0, IPC_UPDTITLE 'i believe this forces winamp to update its title 'not sure if it actually works Dim windowText As String windowText = Space(256) GetWindowText Winamp_hWnd, windowText, 256 'len txt 'get window caption windowText = Left(windowText, InStr(windowText, vbNullChar) - 1) If LenB(windowText) = 0 Or InStrB(windowText, " - Winamp") = 0 Then Exit Sub 'winamp is open but no songs are selected theSong = windowText GoTo GetSong_End End If If iTunes_hWnd <> 0 Then 'if itunes Set iTunes = New iTunesApp Dim Track As IITTrack ' Set Track = iTunes.CurrentTrack If Track Is Nothing Then Set iTunes = Nothing Exit Sub End If 'exit if nothign is playing theSong = Track.Index & ". " & Track.Artist & " - " & Track.Name & " - iTunes" GoTo GetSong_End End If GetSong_End: Set iTunes = Nothing 'unset QueueString theSong End Sub
[09:39:13 PM] «[].[].[].[].@USEast» Do you know what the best letters of the alphabet are?[09:39:21 PM] «DeCi@USEast» h e n r y
Ben is correct, Winamp 5 works the same as old winamp API, so all your older code will still work. But winamp sucks, Im trying to figure out how to control iTunes from my bot.
Set iTunes = New iTunesApp