Diesen Error:
"C:\Users\Peynis\Documents\ISN AutoIt Studio\Projects\Yggdrasil Web-end Wrapper\Yggdrasil_Web-end_Wrapper.au3" (699) : ==> Subscript used on non-accessible variable.:
GUICreate("Text that was to big for the standard label:)", 628, 25, $aMainGUIPos[1] - $aMainGUIPos[3], $aMainGUIPos[2], $WS_BORDER, -1)
GUICreate("Text that was to big for the standard label:)", 628, 25, $aMainGUIPos^ ERROR
bekomme ich, wenn ich mein skript benutze.
Der fragliche code ist in der Zeile 655 - 724
Hier noch die tl;dr Version:
Spoiler anzeigen
Local $aMainGUIPos = WinGetPos($GUIMain)
If ... Then
GUICreate("Text that was to big for the standard label:)", 628, 75, $aMainGUIPos[1] - $aMainGUIPos[3], $aMainGUIPos[2], $WS_BORDER, -1)
EndIf
;*****************************************
;Yggdrasil_Web-end_Wrapper.au3 by Jonniy
;Erstellt mit ISN AutoIt Studio v. 0.94 BETA
;*****************************************
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiButton.au3>
#include <GuiTab.au3>
#include <GUIEdit.au3>
#include <SliderConstants.au3>
#include <GuiSlider.au3>
#include <WinHttp.au3>
#include <IE.au3>
#include <FF.au3>
#include <Array.au3>
#include <_AutoItErrorTrap.au3>
#include <FileConstants.au3>
;*****************************************
;END OF INCLUDES
;END OF INCLUDES
;*****************************************
;*****************************************
;Options & Global Variables
;Options & Global Variables
;*****************************************
#region Options & Global Variables
_AutoItErrorTrap()
Opt('GUIOnEventMode', 1)
Opt('TrayOnEventMode', 1)
Opt('TrayAutoPause', 0)
Opt('TrayMenuMode', 1)
OnAutoItExitRegister("ExitNormal")
FileInstall("C:\Users\Peynis\Documents\ISN AutoIt Studio\Projects\Yggdrasil Web-end Wrapper\Images\Divide5x328.jpg", @TempDir & "\YWWIMG1.jpg", 1)
FileInstall("C:\Users\Peynis\Documents\ISN AutoIt Studio\Projects\Yggdrasil Web-end Wrapper\Images\dummy.jpg", @TempDir & "\YWWIMG2.jpg", 1)
FileInstall("C:\Users\Peynis\Documents\ISN AutoIt Studio\Projects\Yggdrasil Web-end Wrapper\Images\YGGIcon.ico", @TempDir & "\YWWIMG3.ico", 1)
FileInstall("C:\Users\Peynis\Documents\ISN AutoIt Studio\Projects\Yggdrasil Web-end Wrapper\Images\AboutBanner.jpg", @TempDir & "\YWWIMG4.jpg", 1)
#region Global Objects
Global $oWMP = ObjCreate("WMPlayer.ocx")
#endregion Global Objects
#region Global Integers
Global $iRadioPortAACLow = 8000
Global $iCurrentVolume = $oWMP.settings.volume
Global $iChatreadCount = 30
Global $iChatFail = 0
Global $iInForeground = 1
#endregion Global Integers
#region Global Strings
Global $sSite = 'www.yggdrasilradio.net'
Global $sRadioSiteMP3 = 'www.shirayuki.org:9200'
Global $sRadioSiteAACHigh = '178.130.38.113:9100'
Global $sSearchNyaaSite = 'www.nyaa.se/?page=search&cats=3_0&filter=1&term='
Global $sSearchTTSite = 'www.tokyotosho.info/search.php?type=2&terms=xgfnfx'
Global $sSearchGoogleSite = 'www.google.de/?gws_rd=cr#fp=6fdd9ce7f33a9160&q='
Global $sSiteChatread = 'www.yggdrasilradio.net/chatread.php?n='
Global $sHTTP = 'http://'
Global $sImageDivide1 = @TempDir & "\YWWIMG1.jpg"
Global $sImageDummy = @TempDir & "\YWWIMG2.jpg"
Global $sStreaming = False
Global $sCurrentSongOldTitle = "2"
Global $sImageIcon = @TempDir & "\YWWIMG3.ico"
Global $sImageAbout = @TempDir & "\YWWIMG4.jpg"
Global $sChatFile = @TempDir & "\YWWChat.html"
Global $sDataFile = @TempDir & "\YWWData.html"
Global $sDataSite = 'www.yggdrasilradio.net/data.php'
Global $sArtSite1 = 'www.yggdrasilradio.net/images/albumart/largethumbs/'
Global $sArtSite2 = 'www.yggdrasilradio.net/images/albumart/thumbs/'
Global $sArtSite3 = 'www.yggdrasilradio.net/images/albumart/'
Global $sArtPath = @TempDir & '\YWWArt.jpg'
Global $sSiteSongInfo = "/songinfo.php?songid="
Global $sRequestLinkAnon = 'www.yggdrasilradio.dyndns.org/request?songid='
Global $sSearchLinkAnon1 = 'www.yggdrasilradio.dyndns.org/search?find='
Global $sSearchLinkAnon2 = '&mode='
Global $hFF = ""
Global $hIE = ""
#endregion Global Strings
#region Global Arrays
Global $aSoftbuttonT2[13]
Global $aModes[7] = ['', 'title', 'artist', 'album', 'keyword', 'info', 'year']
Global $aDataSplit1 = ""
#endregion Global Arrays
#region Global Things...
Global $ExtraGuiT1 = ""
#endregion Global Things...
#endregion Options & Global Variables
;*****************************************
;End of Options & Global Variables
;End of Options & Global Variables
;*****************************************
;*****************************************
;Functions
;Functions
;*****************************************
#region Functions
GUIStartUp()
TrayStartUp()
Func GUIStartUp()
; -- Created with ISN Form Studio 2 for ISN AutoIt Studio -- ;
Global $GUIMain = GUICreate("Yggdrasil Radio Wrapper by Jonniy #Single threaded!", 625, 343, -1, -1, $WS_SYSMENU + $WS_BORDER + $WS_MINIMIZE + $WS_MINIMIZEBOX, -1)
GUISetIcon($sImageIcon)
Global $htab = GUICtrlCreateTab(0, 0, 632, 22, -1, -1)
GUICtrlSetState(-1, 2048)
Global $htab1 = GUICtrlCreateTabItem("Playing")
Global $htab2 = GUICtrlCreateTabItem("Playlist")
Global $htab3 = GUICtrlCreateTabItem("Request")
Global $htab4 = GUICtrlCreateTabItem("Chat")
Global $htab5 = GUICtrlCreateTabItem("Favourites")
Global $htab6 = GUICtrlCreateTabItem("Song DB")
Global $htab7 = GUICtrlCreateTabItem("Stats")
Global $htab8 = GUICtrlCreateTabItem("Settings")
Global $htab9 = GUICtrlCreateTabItem("About")
Global $htab10 = GUICtrlCreateTabItem("")
_GUICtrlTab_SetCurFocus($htab, -1)
GUISwitch($GUIMain, _GUICtrlTab_SetCurFocus($htab, 0) & GUICtrlRead($htab, 1))
Global $hButtonStartT1 = GUICtrlCreateButton("Start", 0, 196, 100, 30, -1, -1)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUICtrlSetState(-1, $GUI_DEFBUTTON)
GUICtrlCreateTabItem("")
GUISwitch($GUIMain, _GUICtrlTab_SetCurFocus($htab, 0) & GUICtrlRead($htab, 1))
Global $hButtonStopT1 = GUICtrlCreateButton("Stop", 105, 196, 100, 30, -1, -1)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
Global $hButtonSearchT1 = GUICtrlCreateButton("Search Song", 350, 21, 100, 30, -1, -1)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
Global $hLabelSongTitleT1 = GUICtrlCreateLabel("Title", 150, 23, 200, 25, -1, -1)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, "-2")
Global $hLabelSongArtistT1 = GUICtrlCreateLabel("Aritst", 150, 55, 200, 25, -1, -1)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, "-2")
Global $hLabelSongAlbumT1 = GUICtrlCreateLabel("Album", 150, 87, 200, 25, -1, -1)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, "-2")
Global $hLabelSongLengthT1 = GUICtrlCreateLabel("Length", 150, 119, 200, 25, -1, -1)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, "-2")
Global $hLabelExtraDataT1 = GUICtrlCreateLabel("Requested|New Song|X People listening|Type: X", 7, 175, 333, 17, -1, -1)
GUICtrlSetFont(-1, 11, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, "-2")
Global $hLabelVia = GUICtrlCreateLabel("Via...", 380, 158, 50, 25, -1, -1)
GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, "-2")
Global $hLabelVolumeT1 = GUICtrlCreateLabel("Volume: " & $oWMP.settings.volume & "%", 20, 280, 105, 25, -1, -1)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, "-2")
Global $hImageSongImageT1 = GUICtrlCreatePic($sImageDummy, 0, 23, 145, 145, -1, -1)
Global $hImageDivideT1 = GUICtrlCreatePic($sImageDivide1, 348, 19, 2, 330, -1, -1)
GUISwitch($GUIMain, _GUICtrlTab_SetCurFocus($htab,
& GUICtrlRead($htab, 1))
Global $hImageAbout = GUICtrlCreatePic($sImageAbout, 0, 22, 632, 328, -1, -1)
GUISwitch($GUIMain, _GUICtrlTab_SetCurFocus($htab, 0) & GUICtrlRead($htab, 1))
GUIStartGroup()
Global $hRadioNyaaT1 = GUICtrlCreateRadio("on Nyaa!", 469, 24, 163, 20, -1, -1)
GUICtrlSetState(-1, 81)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUICtrlSetState($hRadioNyaaT1, $GUI_CHECKED)
Global $hRadioTTT1 = GUICtrlCreateRadio("on TokyoTosho!", 469, 61, 163, 20, -1, -1)
GUICtrlSetState(-1, 84)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
Global $hRadioGoogleT1 = GUICtrlCreateRadio("on Google!", 469, 94, 163, 25, -1, -1)
GUICtrlSetState(-1, 84)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUIStartGroup()
Global $hRadioIET1 = GUICtrlCreateRadio("Internet Explorer", 469, 180, 150, 20, -1, -1)
GUICtrlSetState(-1, 81)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUICtrlSetState($hRadioIET1, $GUI_CHECKED)
Global $hRadioFireFoxT1 = GUICtrlCreateRadio("FireFox", 469, 214, 150, 20, -1, -1)
GUICtrlSetState(-1, 84)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUIStartGroup()
Global $hRadioQuality1T1 = GUICtrlCreateRadio("AAC+ 48kbps", 20, 242, 97, 25, -1, -1)
GUICtrlSetState(-1, 84)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
Global $hRadioQuality2T1 = GUICtrlCreateRadio("AAC+ 58kbps", 129, 242, 97, 25, -1, -1)
GUICtrlSetState(-1, 81)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
Global $hRadioQuality3T1 = GUICtrlCreateRadio("MP3 128kbps", 241, 242, 97, 25, -1, -1)
GUICtrlSetState(-1, 84)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
Global $hSliderVolumeT1 = GUICtrlCreateSlider(135, 280, 200, 30, 0, -1)
GUICtrlSetLimit(-1, 100, 0)
GUICtrlSetData(-1, $oWMP.settings.volume)
Global $hCheckboxBrowserAttach = GUICtrlCreateCheckbox("Attach to existing Process", 380, 283, 217, 20, -1, -1)
GUICtrlSetState(-1, 84)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUISwitch($GUIMain, _GUICtrlTab_SetCurFocus($htab,
& GUICtrlRead($htab, 1))
Global $hSoftButtonLinkT9 = GUICtrlCreateButton("Yggdrasil Radio", 391, 153, 210, 50, 14, 32)
GUICtrlSetState(-1, 2640)
DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($hSoftButtonLinkT9), "UINT", $BCM_SETNOTE, "ptr*", 0, "wstr", "I'll get you directly to Yggdrasil!")
DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($hSoftButtonLinkT9), "UINT", $BCM_SETSHIELD, "ptr*", 0, "BOOL", False)
_GUICtrlTab_SetCurFocus($htab, 0)
GUISwitch($GUIMain, _GUICtrlTab_SetCurFocus($htab, 3) & GUICtrlRead($htab, 1))
Global $hInputMessageT4 = GUICtrlCreateInput("Enter your text to submit!", 0, 24, 350, 20, -1, 512)
Global $hButtonSendT4 = GUICtrlCreateButton("Send", 355, 23, 65, 20, -1, -1)
Global $hButtonUndoT4 = GUICtrlCreateButton("Undo", 422, 23, 65, 20, -1, -1)
Global $hEditChatT4 = GUICtrlCreateEdit("Chatlog :)", 0, 67, 624, 250, 192, -1)
Global $hInputChatLineT4 = GUICtrlCreateInput("Lines to fetch. Up to 199", 492, 24, 125, 20, 8192, 512)
Global $hButtonUpdateT4 = GUICtrlCreateButton("Update!", 0, 43, 619, 23, -1, -1)
_GUICtrlTab_SetCurFocus($htab, 0)
GUISetState(@SW_SHOW, $GUIMain)
GUISetState(@SW_RESTORE)
Global $sRadioSelected1T1 = $hRadioNyaaT1
Global $sRadioSelected2T1 = $hRadioIET1
Global $sRadioSelected3T1 = $hRadioQuality2T1
GUISetOnEvent($GUI_EVENT_RESTORE, 'Restore')
GUISetOnEvent($GUI_EVENT_MINIMIZE, 'Minimize')
GUISetOnEvent($GUI_EVENT_CLOSE, 'ExitNormal')
GUICtrlSetOnEvent($hButtonStartT1, "StartStream")
GUICtrlSetOnEvent($hButtonStopT1, "StopStream")
GUICtrlSetOnEvent($hButtonSearchT1, "SearchCurrentSong")
GUICtrlSetOnEvent($hSliderVolumeT1, "SetVolume")
GUICtrlSetOnEvent($hSoftButtonLinkT9, "AboutLink")
GUICtrlSetOnEvent($hCheckboxBrowserAttach, "WarnAttach")
GUICtrlSetOnEvent($hButtonUpdateT4, "ChatUpdate")
EndFunc ;==>GUIStartUp
Func TrayStartUp()
TraySetIcon($sImageIcon)
Global $hTrayItemStart = TrayCreateItem("Start")
Global $hTrayItemStop = TrayCreateItem("Stop")
Global $hTrayItemRestore = TrayCreateItem("Restore")
Global $hTrayItemExit = TrayCreateItem("Exit")
TrayCreateItem("")
Global $hTrayMenuAudio = TrayCreateMenu("Audio")
Global $hTrayItemVolumeUp = TrayCreateItem("Volume up", $hTrayMenuAudio)
Global $hTrayItemVolumeDown = TrayCreateItem("Volume down", $hTrayMenuAudio)
Global $hTrayItemMute = TrayCreateItem("Mute", $hTrayMenuAudio)
TrayItemSetOnEvent($hTrayItemStart, "StartStream")
TrayItemSetOnEvent($hTrayItemStop, "StopStream")
TrayItemSetOnEvent($hTrayItemRestore, "Restore")
TrayItemSetOnEvent($hTrayItemExit, "ExitNormal")
TrayItemSetOnEvent($hTrayItemVolumeUp, "VolumeUp20")
TrayItemSetOnEvent($hTrayItemVolumeDown, "VolumeDown20")
TrayItemSetOnEvent($hTrayItemMute, "MuteOrUnmute")
EndFunc ;==>TrayStartUp
Func StartStream()
If $sStreaming == True Then
$oWMP.Controls.Stop
EndIf
If GUICtrlRead($hRadioQuality1T1) == $GUI_CHECKED Then
$oWMP.URL = $sHTTP & $sSite & ":" & $iRadioPortAACLow
Global $sStreaming = True
TrayItemSetState($hTrayItemStart, $GUI_CHECKED)
TrayItemSetState($hTrayItemStop, $GUI_UNCHECKED)
ElseIf GUICtrlRead($hRadioQuality2T1) == $GUI_CHECKED Then
$oWMP.URL = $sHTTP & $sRadioSiteAACHigh
Global $sStreaming = True
TrayItemSetState($hTrayItemStart, $GUI_CHECKED)
TrayItemSetState($hTrayItemStop, $GUI_UNCHECKED)
ElseIf GUICtrlRead($hRadioQuality3T1) == $GUI_CHECKED Then
$oWMP.URL = $sHTTP & $sRadioSiteMP3
Global $sStreaming = True
TrayItemSetState($hTrayItemStart, $GUI_CHECKED)
TrayItemSetState($hTrayItemStop, $GUI_UNCHECKED)
EndIf
EndFunc ;==>StartStream
Func StopStream()
$oWMP.Controls.Stop
Global $sStreaming = False
GUICtrlSetData($hLabelSongAlbumT1, "Album")
GUICtrlSetFont($hLabelSongAlbumT1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetData($hLabelSongArtistT1, "Artist")
GUICtrlSetFont($hLabelSongArtistT1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetData($hLabelSongLengthT1, "Length")
GUICtrlSetFont($hLabelSongLengthT1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetData($hLabelSongTitleT1, "Title")
GUICtrlSetFont($hLabelSongTitleT1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetData($hLabelExtraDataT1, "Requested|New Song|X People listening|Type: X")
GUICtrlSetImage($hImageSongImageT1, $sImageDummy)
TrayItemSetState($hTrayItemStart, $GUI_UNCHECKED)
TrayItemSetState($hTrayItemStop, $GUI_CHECKED)
EndFunc ;==>StopStream
Func WarnAttach()
If GUICtrlRead($hCheckboxBrowserAttach) == $GUI_CHECKED Then
MsgBox(0, "Mhm.", "On some machines, attaching doesn't work!")
EndIf
EndFunc ;==>WarnAttach
Func SetVolume()
$oWMP.settings.volume = GUICtrlRead($hSliderVolumeT1)
GUICtrlSetData($hLabelVolumeT1, "Volume: " & $oWMP.settings.volume & "%")
EndFunc ;==>SetVolume
Func ShowItemMsgT4()
Local $sText1 = _GUICtrlListView_GetItemText($hListViewChatT4, GUICtrlRead($hListViewChatT4))
Local $sText2 = _GUICtrlListView_GetItemText($hListViewChatT4, GUICtrlRead($hListViewChatT4), 1)
Local $sText3 = _GUICtrlListView_GetItemText($hListViewChatT4, GUICtrlRead($hListViewChatT4), 2)
Local $sText4 = _GUICtrlListView_GetItemText($hListViewChatT4, GUICtrlRead($hListViewChatT4), 3)
MsgBox(0, "Output", $sText1 & "|" & $sText2 & "|" & $sText3 & "|" & $sText4)
EndFunc ;==>ShowItemMsgT4
Func CopyItemT4()
Local $sText1 = _GUICtrlListView_GetItemText($hListViewChatT4, GUICtrlRead($hListViewChatT4))
Local $sText2 = _GUICtrlListView_GetItemText($hListViewChatT4, GUICtrlRead($hListViewChatT4), 1)
Local $sText3 = _GUICtrlListView_GetItemText($hListViewChatT4, GUICtrlRead($hListViewChatT4), 2)
Local $sText4 = _GUICtrlListView_GetItemText($hListViewChatT4, GUICtrlRead($hListViewChatT4), 3)
ClipPut($sText1 & "|" & $sText2 & "|" & $sText3 & "|" & $sText4)
EndFunc ;==>CopyItemT4
Func OpenLinkT4()
If StringInStr("#LINK#", _GUICtrlListView_GetItemText($hListViewChatT4, GUICtrlRead($hListViewChatT4), 3)) == 0 Then
MsgBox(0, "Huh?", "There is no link in this item!")
Else
_IECreate(StringSplit(_GUICtrlListView_GetItemText($hListViewChatT4, GUICtrlRead($hListViewChatT4), 3), "#")[2])
EndIf
EndFunc ;==>OpenLinkT4
Func GetSongImage($iSongId, $sSongImagePath)
FileDelete($sArtPath)
InetGet($sHTTP & $sArtSite1 & $iSongId & ".jpg", $sArtPath)
If FileExists($sArtPath) == 0 Then
InetGet($sHTTP & $sArtSite2 & $iSongId & ".jpg", $sArtPath)
If FileExists($sArtPath) == 0 Then
If StringInStr($sSongImagePath, "*./", 1) <> 0 Then
InetGet($sHTTP & $sArtSite3 & StringTrimLeft($sSongImagePath, "3"), $sArtPath)
ElseIf StringInStr($sSongImagePath, "*", 1) <> 0 Then
InetGet($sHTTP & $sArtSite3 & StringTrimLeft($sSongImagePath, "1"), $sArtPath)
Else
InetGet($sHTTP & $sArtSite3 & $sSongImagePath, $sArtPath)
EndIf
If FileExists($sArtPath) == 0 Then
GUICtrlSetImage($hImageSongImageT1, $sImageDummy)
EndIf
Else
GUICtrlSetImage($hImageSongImageT1, $sArtPath)
EndIf
Else
GUICtrlSetImage($hImageSongImageT1, $sArtPath)
EndIf
EndFunc ;==>GetSongImage
Func GetLoginCookies()
EndFunc ;==>GetLoginCookies
Func GetSongInfo()
InetGet($sHTTP & $sDataSite, $sDataFile)
Local $hDataFile = FileOpen($sDataFile)
FileSetPos($hDataFile, 0, $FILE_BEGIN)
Local $sDataFileRaw = FileRead($hDataFile)
Local $aDataSplit1 = StringSplit($sDataFileRaw, "|")
FileClose($hDataFile)
FileDelete($sDataFile)
Return $aDataSplit1
EndFunc ;==>GetSongInfo
Func ChatUpdate()
Local $iChatreadCount = GUICtrlRead($hInputChatLineT4)
If $iChatreadCount == "Lines to fetch. Up to 199" Then
InetGet($sHTTP & $sSiteChatread & $iChatreadCount, @TempDir & "\YWWChat.html")
Local $hChatFile = FileOpen($sChatFile)
Local $sChatFileLine1 = FileReadLine($hChatFile, "1")
Local $aChatFileLine1Split1 = StringSplit($sChatFileLine1, " ", 1)
Local $aChatFileLine1Split2 = StringSplit(StringTrimLeft($aChatFileLine1Split1[1], 1), "::", 1)
Local $aChatFileLine1Split3 = StringSplit($aChatFileLine1Split2[2], "|")
_GUICtrlEdit_BeginUpdate($hEditChatT4)
_GUICtrlEdit_SetText($hEditChatT4, "")
_GUICtrlEdit_AppendText($hEditChatT4, "Yggdrasil MOTD: " & $aChatFileLine1Split2[1] & " From: " & $aChatFileLine1Split3[1] & @CRLF & @CRLF)
_GUICtrlEdit_AppendText($hEditChatT4, $aChatFileLine1Split3[2] & " " & StringTrimRight($aChatFileLine1Split1[2], 4) & @CRLF)
FileSetPos($hChatFile, 0, $FILE_BEGIN)
Local $sFileData = FileRead($hChatFile)
Local $sFileData1 = StringReplace($sFileData, $sChatFileLine1, "")
For $i = 2 To $iChatreadCount Step 1
Local $sCurrentLine = FileReadLine($hChatFile, $i)
If StringInStr($sCurrentLine, "|<span class=", 1) <> 0 Then
ExitLoop
Else
_GUICtrlEdit_AppendText($hEditChatT4, StringTrimRight(StringReplace($sCurrentLine, " ", "1"), 4) & @CRLF)
EndIf
Next
_GUICtrlEdit_EndUpdate($hEditChatT4)
FileDelete($hChatFile)
Else
For $i = 65 To 90 Step 1
If StringInStr($iChatreadCount, Chr($i)) <> 0 Then
MsgBox(0, "Damn.", "No alphabetical-characters allowed!")
ExitLoop
EndIf
Next
If $iChatreadCount > 199 Then
MsgBox(0, "Damn.", "Only 199 lines are fetchable!")
Else
InetGet($sHTTP & $sSiteChatread & $iChatreadCount, @TempDir & "\YWWChat.html")
Local $hChatFile = FileOpen($sChatFile)
Local $sChatFileLine1 = FileReadLine($hChatFile, "1")
Local $aChatFileLine1Split1 = StringSplit($sChatFileLine1, " ", 1)
Local $aChatFileLine1Split2 = StringSplit(StringTrimLeft($aChatFileLine1Split1[1], 1), "::", 1)
Local $aChatFileLine1Split3 = StringSplit($aChatFileLine1Split2[2], "|")
_GUICtrlEdit_BeginUpdate($hEditChatT4)
_GUICtrlEdit_SetText($hEditChatT4, "")
_GUICtrlEdit_AppendText($hEditChatT4, "Yggdrasil MOTD: " & $aChatFileLine1Split2[1] & " From: " & $aChatFileLine1Split3[1] & @CRLF & @CRLF)
_GUICtrlEdit_AppendText($hEditChatT4, $aChatFileLine1Split3[2] & " " & StringTrimRight($aChatFileLine1Split1[2], 4) & @CRLF)
FileSetPos($hChatFile, 0, $FILE_BEGIN)
Local $sFileData = FileRead($hChatFile)
Local $sFileData1 = StringReplace($sFileData, $sChatFileLine1, "")
For $i = 2 To $iChatreadCount Step 1
Local $sCurrentLine = FileReadLine($hChatFile, $i)
If StringInStr($sCurrentLine, "|<span class=", 1) <> 0 Then
ExitLoop
Else
_GUICtrlEdit_AppendText($hEditChatT4, StringTrimRight(StringReplace($sCurrentLine, " ", "1"), 4) & @CRLF)
EndIf
Next
_GUICtrlEdit_EndUpdate($hEditChatT4)
FileDelete($hChatFile)
EndIf
EndIf
EndFunc ;==>ChatUpdate
Func Restore()
$iInForeground = 1
GUISetState(@SW_RESTORE, $GUIMain)
GUISetState(@SW_RESTORE, $ExtraGuiT1)
EndFunc ;==>Restore
Func Minimize()
$iInForeground = 0
GUISetState(@SW_MINIMIZE, $GUIMain)
GUISetState(@SW_MINIMIZE, $ExtraGuiT1)
EndFunc ;==>Minimize
Func MuteOrUnmute()
If TrayItemGetText($hTrayItemMute) == "Mute" Then
Global $iCurrentVolume = $oWMP.settings.volume
$oWMP.settings.volume = 0
GUICtrlSetData($hLabelVolumeT1, "Volume: Mute")
TrayItemSetText($hTrayItemMute, "Unmute")
Else
$oWMP.settings.volume = $iCurrentVolume
GUICtrlSetData($hLabelVolumeT1, "Volume: " & $iCurrentVolume)
TrayItemSetText($hTrayItemMute, "Mute")
EndIf
EndFunc ;==>MuteOrUnmute
Func VolumeUp20()
$oWMP.settings.volume = $oWMP.settings.volume + 20
Global $iCurrentVolume = $oWMP.settings.volume
GUICtrlSetData($hLabelVolumeT1, "Volume: " & $iCurrentVolume & "%")
GUICtrlSetData($hSliderVolumeT1, $iCurrentVolume)
TrayItemSetState($hTrayItemVolumeUp, $GUI_UNCHECKED)
EndFunc ;==>VolumeUp20
Func VolumeDown20()
$oWMP.settings.volume = $oWMP.settings.volume - 20
Global $iCurrentVolume = $oWMP.settings.volume
GUICtrlSetData($hLabelVolumeT1, "Volume: " & $iCurrentVolume & "%")
GUICtrlSetData($hSliderVolumeT1, $iCurrentVolume)
TrayItemSetState($hTrayItemVolumeDown, $GUI_UNCHECKED)
EndFunc ;==>VolumeDown20
Func SearchCurrentSong()
If GUICtrlRead($hRadioFireFoxT1) == $GUI_CHECKED Then
Local $iBrowser = 1
ElseIf GUICtrlRead($hRadioIET1) == $GUI_CHECKED Then
Local $iBrowser = 2
EndIf
If GUICtrlRead($hRadioNyaaT1) == $GUI_CHECKED Then
Local $iSite = 1
ElseIf GUICtrlRead($hRadioGoogleT1) == $GUI_CHECKED Then
Local $iSite = 2
ElseIf GUICtrlRead($hRadioTTT1) == $GUI_CHECKED Then
Local $iSite = 3
EndIf
If GUICtrlRead($hCheckboxBrowserAttach) == $GUI_CHECKED Then
Local $iAttachIE = 1
Local $iAttachFF = 2
Else
Local $iAttachIE = 0
Local $iAttachFF = 0
EndIf
If $iBrowser == 2 Then
If $iSite == 1 Then
Global $hIE = _IECreate($sSearchNyaaSite & GetSongInfo()[2], $iAttachIE)
ElseIf $iSite == 2 Then
Global $hIE = _IECreate($sSearchGoogleSite & GetSongInfo()[2], $iAttachIE)
ElseIf $iSite == 3 Then
Global $hIE = _IECreate($sSearchTTSite & GetSongInfo()[2], $iAttachIE)
EndIf
Else
If $iSite == 1 Then
Global $hFF = _FFStart($sHTTP & $sSearchNyaaSite & GetSongInfo()[2], Default, $iAttachFF)
ElseIf $iSite == 2 Then
Global $hFF = _FFStart($sHTTP & $sSearchGoogleSite & GetSongInfo()[2], Default, $iAttachFF)
ElseIf $iSite == 3 Then
Global $hFF = _FFStart($sHTTP & $sSearchTTSite & GetSongInfo()[2], Default, $iAttachFF)
EndIf
EndIf
EndFunc ;==>SearchCurrentSong
Func AboutLink()
_IECreate($sSite)
EndFunc ;==>AboutLink
Func ExitNormal()
$oWMP.Controls.Stop
GUIDelete(-1)
Exit
EndFunc ;==>ExitNormal
Func _ReduceMemory() ;by John Taylor (jftuga)
Local $ai_GetCurrentProcessId = DllCall('kernel32.dll', 'int', 'GetCurrentProcessId')
Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $ai_GetCurrentProcessId[0])
Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
Return $ai_Return[0]
EndFunc ;==>_ReduceMemory
#endregion Functions
;*****************************************
;End of Functions
;End of Functions
;*****************************************
;*****************************************
;While loop
;While loop
;*****************************************
#region While loop
While 1
Sleep(700)
_ReduceMemory()
Local $hCurrentTab = GUICtrlRead($htab, 1)
If $sStreaming == True Then
Local $aSongProps = GetSongInfo()
If $aSongProps[1] <> $sCurrentSongOldTitle Then
TrayTip("Now playing...", $aSongProps[2], 2000)
EndIf
EndIf
Switch $iInForeground
Case 1
Switch $hCurrentTab
Case $htab1
Switch $sStreaming
Case True
Local $aSongProps = GetSongInfo()
If $aSongProps[1] <> $sCurrentSongOldTitle Then
GUICtrlSetImage($hImageSongImageT1, $sImageDummy)
GetSongImage($aSongProps[1], $aSongProps[12])
Global $sCurrentSongOldTitle = $aSongProps[1]
Local $iExtraWindow1 = 0
Local $iExtraWindow2 = 0
Local $iExtraWindow3 = 0
If $aSongProps[6] <> "" Then
Local $sDataSet1 = "Requested|"
Else
Local $sDataSet1 = ""
EndIf
If $aSongProps[9] <> "Y" Then
Local $sDataSet2 = ""
Else
Local $sDataSet2 = "New Song!|"
EndIf
GUICtrlSetData($hLabelExtraDataT1, $sDataSet1 & $sDataSet2 & "Listeners: " & $aSongProps[7] & "|" & $aSongProps[8])
GUICtrlSetData($hLabelSongLengthT1, $aSongProps[5])
If StringLen($aSongProps[4]) == 16 Or StringLen($aSongProps[4]) == 17 Then
GUICtrlSetFont($hLabelSongAlbumT1, 13, 400, 0, "MS Sans Serif")
GUICtrlSetData($hLabelSongAlbumT1, $aSongProps[4])
ElseIf StringLen($aSongProps[4]) == 18 Or StringLen($aSongProps[4]) == 19 Or StringLen($aSongProps[4]) == 20 Or StringLen($aSongProps[4]) == 21 Then
GUICtrlSetFont($hLabelSongAlbumT1, 11, 400, 0, "MS Sans Serif")
GUICtrlSetData($hLabelSongAlbumT1, $aSongProps[4])
ElseIf StringLen($aSongProps[4]) == 22 Or StringLen($aSongProps[4]) == 23 Or StringLen($aSongProps[4]) == 24 Or StringLen($aSongProps[4]) == 25 Then
GUICtrlSetFont($hLabelSongAlbumT1, 9, 400, 0, "MS Sans Serif")
GUICtrlSetData($hLabelSongAlbumT1, $aSongProps[4])
ElseIf StringLen($aSongProps[4]) >= 26 Then
GUICtrlSetFont($hLabelSongAlbumT1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetData($hLabelSongAlbumT1, "TL;Look below.:)")
Local $iExtraWindow1 = 1
Else
GUICtrlSetFont($hLabelSongAlbumT1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetData($hLabelSongAlbumT1, $aSongProps[4])
EndIf
If StringLen($aSongProps[3]) == 16 Or StringLen($aSongProps[3]) == 17 Then
GUICtrlSetFont($hLabelSongArtistT1, 13, 400, 0, "MS Sans Serif")
GUICtrlSetData($hLabelSongArtistT1, $aSongProps[3])
ElseIf StringLen($aSongProps[3]) == 18 Or StringLen($aSongProps[3]) == 19 Or StringLen($aSongProps[3]) == 20 Or StringLen($aSongProps[3]) == 21 Then
GUICtrlSetFont($hLabelSongArtistT1, 11, 400, 0, "MS Sans Serif")
GUICtrlSetData($hLabelSongArtistT1, $aSongProps[3])
ElseIf StringLen($aSongProps[3]) == 22 Or StringLen($aSongProps[3]) == 23 Or StringLen($aSongProps[3]) == 24 Or StringLen($aSongProps[3]) == 25 Then
GUICtrlSetFont($hLabelSongArtistT1, 9, 400, 0, "MS Sans Serif")
GUICtrlSetData($hLabelSongArtistT1, $aSongProps[3])
ElseIf StringLen($aSongProps[3]) >= 26 Then
GUICtrlSetFont($hLabelSongArtistT1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetData($hLabelSongArtistT1, "TL;Look below.:)")
Local $iExtraWindow2 = 1
Else
GUICtrlSetFont($hLabelSongArtistT1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetData($hLabelSongArtistT1, $aSongProps[3])
EndIf
If StringLen($aSongProps[2]) == 16 Or StringLen($aSongProps[2]) == 17 Then
GUICtrlSetFont($hLabelSongTitleT1, 13, 400, 0, "MS Sans Serif")
GUICtrlSetData($hLabelSongTitleT1, $aSongProps[2])
ElseIf StringLen($aSongProps[2]) == 18 Or StringLen($aSongProps[2]) == 19 Or StringLen($aSongProps[2]) == 20 Or StringLen($aSongProps[2]) == 21 Then
GUICtrlSetFont($hLabelSongTitleT1, 11, 400, 0, "MS Sans Serif")
GUICtrlSetData($hLabelSongTitleT1, $aSongProps[2])
ElseIf StringLen($aSongProps[2]) == 22 Or StringLen($aSongProps[2]) == 23 Or StringLen($aSongProps[2]) == 24 Or StringLen($aSongProps[2]) == 25 Then
GUICtrlSetFont($hLabelSongTitleT1, 9, 400, 0, "MS Sans Serif")
GUICtrlSetData($hLabelSongTitleT1, $aSongProps[2])
ElseIf StringLen($aSongProps[2]) >= 26 Then
GUICtrlSetFont($hLabelSongTitleT1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetData($hLabelSongTitleT1, "TL;Look below.:)")
Local $iExtraWindow3 = 1
Else
GUICtrlSetFont($hLabelSongTitleT1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetData($hLabelSongTitleT1, $aSongProps[2])
EndIf
If $iExtraWindow1 = 1 Or $iExtraWindow2 = 1 Or $iExtraWindow3 = 1 Then
ConsoleWrite("@@-16-@@" & @CRLF)
GUIDelete($ExtraGuiT1)
Local $aMainGUIPos = WinGetPos($GUIMain)
If $iExtraWindow1 = 1 And $iExtraWindow2 = 1 And $iExtraWindow3 = 1 Then
ConsoleWrite("@@-17-@@" & @CRLF)
GUICreate("Text that was to big for the standard label:)", 628, 75, $aMainGUIPos[1] - $aMainGUIPos[3], $aMainGUIPos[2], $WS_BORDER, -1)
GUICtrlCreateLabel($aSongProps[2], 0, 0, 628, 25, -1, -1)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, "-2")
GUICtrlCreateLabel($aSongProps[3], 0, 25, 628, 25, -1, -1)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, "-2")
GUICtrlCreateLabel($aSongProps[4], 0, 50, 635, 25, -1, -1)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, "-2")
GUISetState(@SW_RESTORE, $ExtraGuiT1)
ElseIf $iExtraWindow3 = 1 And $iExtraWindow2 = 1 And $iExtraWindow1 = 0 Then
ConsoleWrite("@@-18-@@" & @CRLF)
GUICreate("Text that was to big for the standard label:)", 628, 50, $aMainGUIPos[1] - $aMainGUIPos[3], $aMainGUIPos[2], $WS_BORDER, -1)
GUICtrlCreateLabel($aSongProps[2], 0, 0, 628, 25, -1, -1)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, "-2")
GUICtrlCreateLabel($aSongProps[3], 0, 25, 628, 25, -1, -1)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, "-2")
GUISetState(@SW_RESTORE, $ExtraGuiT1)
ElseIf $iExtraWindow3 = 1 And $iExtraWindow2 = 0 And $iExtraWindow1 = 0 Then
ConsoleWrite("@@-19-@@" & @CRLF)
GUICreate("Text that was to big for the standard label:)", 628, 25, $aMainGUIPos[1] - $aMainGUIPos[3], $aMainGUIPos[2], $WS_BORDER, -1)
GUICtrlCreateLabel($aSongProps[2], 0, 0, 628, 25, -1, -1)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, "-2")
GUISetState(@SW_RESTORE, $ExtraGuiT1)
ElseIf $iExtraWindow3 = 0 And $iExtraWindow2 = 1 And $iExtraWindow1 = 0 Then
ConsoleWrite("@@-20-@@" & @CRLF)
GUICreate("Text that was to big for the standard label:)", 628, 25, $aMainGUIPos[1] - $aMainGUIPos[3], $aMainGUIPos[2], $WS_BORDER, -1)
GUICtrlCreateLabel($aSongProps[3], 0, 0, 628, 25, -1, -1)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, "-2")
GUISetState(@SW_RESTORE, $ExtraGuiT1)
ElseIf $iExtraWindow3 = 0 And $iExtraWindow2 = 0 And $iExtraWindow1 = 1 Then
ConsoleWrite("@@-21-@@" & @CRLF)
GUICreate("Text that was to big for the standard label:)", 628, 25, $aMainGUIPos[1] - $aMainGUIPos[3], $aMainGUIPos[2], $WS_BORDER, -1)
GUICtrlCreateLabel($aSongProps[4], 0, 0, 628, 25, -1, -1)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, "-2")
GUISetState(@SW_RESTORE, $ExtraGuiT1)
ElseIf $iExtraWindow3 = 0 And $iExtraWindow2 = 1 And $iExtraWindow1 = 1 Then
ConsoleWrite("@@-22-@@" & @CRLF)
GUICreate("Text that was to big for the standard label:)", 628, 50, $aMainGUIPos[1] - $aMainGUIPos[3], $aMainGUIPos[2], $WS_BORDER, -1)
GUICtrlCreateLabel($aSongProps[3], 0, 0, 628, 25, -1, -1)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, "-2")
GUICtrlCreateLabel($aSongProps[4], 0, 25, 628, 25, -1, -1)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, "-2")
ElseIf $iExtraWindow3 = 1 And $iExtraWindow2 = 0 And $iExtraWindow1 = 1 Then
ConsoleWrite("@@-23-@@" & @CRLF)
GUICreate("Text that was to big for the standard label:)", 628, 50, $aMainGUIPos[1] - $aMainGUIPos[3], $aMainGUIPos[2], $WS_BORDER, -1)
GUICtrlCreateLabel($aSongProps[2], 0, 0, 628, 25, -1, -1)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, "-2")
GUICtrlCreateLabel($aSongProps[4], 0, 25, 628, 25, -1, -1)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, "-2")
EndIf
EndIf
EndIf
EndSwitch
Case $htab2
Switch $sStreaming
Case True
If IsArray($aSongProps) == 1 Then
For $i = 0 To 246 Step 1
$aSongProps[$i] = ""
Next
Local $aSongProps = GetSongInfo()
Else
Local $aSongProps = GetSongInfo()
EndIf
If $aSongProps[1] <> $sCurrentSongOldTitle Then
Global $sCurrentSongOldTitle = $aSongProps[1]
For $i = 1 To 12 Step 1
MsgBox(0, "", "4 " & $i)
GUICtrlSetData($aSoftbuttonT2[$i], $aSongProps[2 + 12 * $i])
DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[$i]), "UINT", $BCM_SETNOTE, "ptr*", 0, "wstr", "From: " & $aSongProps[4 + 12 * $i])
DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[$i]), "UINT", $BCM_SETSHIELD, "ptr*", 0, "BOOL", False)
Next
EndIf
EndSwitch
Case $htab3
Case $htab4
Case $htab5
Case $htab6
Case $htab7
Case $htab8
Case $htab9
Case $htab10
EndSwitch
EndSwitch
WEnd
#endregion While loop
[/autoit]Greets,
Jonniy
Edit BugFix: Spoiler gesetzt.