Jump to content

Subscript used on non-accessible variable


 Share

Go to solution Solved by BrewManNH,

Recommended Posts

So yeah, that's basically my problem. I've never had this error before, and I don't even know what it means, because I tryed declaring the array in Global and (beforehand) local. Both didn't help.
Error:
 

(776) : ==> 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

COMPLETE code: It's also here:https://mega.co.nz/#!gtdHEaiD!df5WNkD1N-bEpz4QAO-yXTT0OHFtnJgOg0AnniZOcgI (ISN AutoIt Studio format.)
 

;*****************************************
;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 = 20
Global $iChatFail = 0
Global $iInForeground = 1
#endregion Global Integers

#region Global Strings
Global $sSite = 'yggdrasilradio.net'
Global $sRadioSiteMP3 = 'shirayuki.org:9200'
Global $sRadioSiteAACHigh = '178.130.38.113:9100'
Global $sSearchNyaaSite = 'nyaa.se/?page=search&cats=3_0&filter=1&term='
Global $sSearchTTSite = 'tokyotosho.info/search.php?type=2&terms=xgfnfx'
Global $sSearchGoogleSite = 'google.de/?gws_rd=cr#fp=6fdd9ce7f33a9160&q='
Global $sSiteChatread = '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 $sImageTrayIcon = @TempDir & "\YWWIMG3.ico"
Global $sImageAbout = @TempDir & "\YWWIMG4.jpg"
Global $sChatFile = @TempDir & "\YWWChat.html"
Global $sDataFile = @TempDir & "\YWWData.html"
Global $sDataSite = 'yggdrasilradio.net/data.php'
Global $sArtSite1 = 'yggdrasilradio.net/images/albumart/largethumbs/'
Global $sArtSite2 = 'yggdrasilradio.net/images/albumart/thumbs/'
Global $sArtSite3 = 'yggdrasilradio.net/images/albumart/'
Global $sArtPath = @TempDir & '\YWWArt.jpg'
Global $sSiteSongInfo = "/songinfo.php?songid="
Global $sRequestLinkAnon = 'yggdrasilradio.dyndns.org/request?songid='
Global $sSearchLinkAnon1 = 'http://yggdrasilradio.dyndns.org/search?find='
Global $sSearchLinkAnon2 = '&mode='
#endregion Global Strings

#region Global Arrays
Global $aSoftbuttonT2[13]
Global $aModes[7] = ['', 'title', 'artist', 'album', 'keyword', 'info', 'year']
Global $aSongProps = ""
Global $aDataSplit1 = ""
#endregion Global Arrays

#region Global Things...
Global $ExtraGuiT1 = ""
#endregion

#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)
    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, 8) & 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, 8) & 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)
    GUISwitch($GUIMain, _GUICtrlTab_SetCurFocus($htab, 3) & GUICtrlRead($htab, 1))
    $hEditChatT4 = GUICtrlCreateEdit("Chatlog :)", 0, 65, 619, 255, -1, -1)
    GUISwitch($GUIMain, _GUICtrlTab_SetCurFocus($htab, 1) & GUICtrlRead($htab, 1))
    $aSoftbuttonT2[1] = GUICtrlCreateButton("A sec...", 0, 22, 206, 63, 14, -1)
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[1]), "UINT", $BCM_SETNOTE, "ptr*", 0, "wstr", "This text will Change soon!")
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[1]), "UINT", $BCM_SETSHIELD, "ptr*", 0, "BOOL", False)
    $aSoftbuttonT2[2] = GUICtrlCreateButton("A sec...", 0, 90, 206, 62, 14, -1)
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[2]), "UINT", $BCM_SETNOTE, "ptr*", 0, "wstr", "This text will Change soon!")
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[2]), "UINT", $BCM_SETSHIELD, "ptr*", 0, "BOOL", False)
    $aSoftbuttonT2[3] = GUICtrlCreateButton("A sec...", 0, 157, 206, 62, 14, -1)
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[3]), "UINT", $BCM_SETNOTE, "ptr*", 0, "wstr", "This text will Change soon!")
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[3]), "UINT", $BCM_SETSHIELD, "ptr*", 0, "BOOL", False)
    $aSoftbuttonT2[4] = GUICtrlCreateButton("A sec...", 0, 226, 206, 63, 14, -1)
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[4]), "UINT", $BCM_SETNOTE, "ptr*", 0, "wstr", "This text will Change soon!")
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[4]), "UINT", $BCM_SETSHIELD, "ptr*", 0, "BOOL", False)
    $aSoftbuttonT2[5] = GUICtrlCreateButton("A sec...", 206, 22, 206, 63, 14, -1)
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[5]), "UINT", $BCM_SETNOTE, "ptr*", 0, "wstr", "This text will Change soon!")
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[5]), "UINT", $BCM_SETSHIELD, "ptr*", 0, "BOOL", False)
    $aSoftbuttonT2[6] = GUICtrlCreateButton("A sec...", 208, 91, 206, 63, 14, -1)
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[6]), "UINT", $BCM_SETNOTE, "ptr*", 0, "wstr", "This text will Change soon!")
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[6]), "UINT", $BCM_SETSHIELD, "ptr*", 0, "BOOL", False)
    $aSoftbuttonT2[7] = GUICtrlCreateButton("A sec...", 208, 157, 206, 63, 14, -1)
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[7]), "UINT", $BCM_SETNOTE, "ptr*", 0, "wstr", "This text will Change soon!")
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[7]), "UINT", $BCM_SETSHIELD, "ptr*", 0, "BOOL", False)
    $aSoftbuttonT2[8] = GUICtrlCreateButton("A sec...", 208, 226, 206, 65, 14, -1)
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[8]), "UINT", $BCM_SETNOTE, "ptr*", 0, "wstr", "This text will Change soon!")
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[8]), "UINT", $BCM_SETSHIELD, "ptr*", 0, "BOOL", False)
    $aSoftbuttonT2[11] = GUICtrlCreateButton("A sec...", 415, 157, 206, 65, 14, -1)
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[11]), "UINT", $BCM_SETNOTE, "ptr*", 0, "wstr", "This text will Change soon!")
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[11]), "UINT", $BCM_SETSHIELD, "ptr*", 0, "BOOL", False)
    $aSoftbuttonT2[12] = GUICtrlCreateButton("A sec...", 415, 226, 206, 65, 14, -1)
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[12]), "UINT", $BCM_SETNOTE, "ptr*", 0, "wstr", "This text will Change soon!")
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[12]), "UINT", $BCM_SETSHIELD, "ptr*", 0, "BOOL", False)
    $aSoftbuttonT2[9] = GUICtrlCreateButton("A sec...", 415, 22, 206, 65, 14, -1)
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[9]), "UINT", $BCM_SETNOTE, "ptr*", 0, "wstr", "This text will Change soon!")
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[9]), "UINT", $BCM_SETSHIELD, "ptr*", 0, "BOOL", False)
    $aSoftbuttonT2[10] = GUICtrlCreateButton("A sec...", 415, 91, 206, 65, 14, -1)
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[10]), "UINT", $BCM_SETNOTE, "ptr*", 0, "wstr", "This text will Change soon!")
    DllCall("user32.dll", "UINT", "SendMessage", "handle", GUICtrlGetHandle($aSoftbuttonT2[10]), "UINT", $BCM_SETSHIELD, "ptr*", 0, "BOOL", False)
    _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")
    GUICtrlSetOnEvent($aSoftbuttonT2[1], "PlaylistLink1")
    GUICtrlSetOnEvent($aSoftbuttonT2[2], "PlaylistLink2")
    GUICtrlSetOnEvent($aSoftbuttonT2[3], "PlaylistLink3")
    GUICtrlSetOnEvent($aSoftbuttonT2[4], "PlaylistLink4")
    GUICtrlSetOnEvent($aSoftbuttonT2[5], "PlaylistLink5")
    GUICtrlSetOnEvent($aSoftbuttonT2[6], "PlaylistLink6")
    GUICtrlSetOnEvent($aSoftbuttonT2[7], "PlaylistLink7")
    GUICtrlSetOnEvent($aSoftbuttonT2[8], "PlaylistLink8")
    GUICtrlSetOnEvent($aSoftbuttonT2[9], "PlaylistLink9")
    GUICtrlSetOnEvent($aSoftbuttonT2[10], "PlaylistLink10")
    GUICtrlSetOnEvent($aSoftbuttonT2[11], "PlaylistLink11")
    GUICtrlSetOnEvent($aSoftbuttonT2[12], "PlaylistLink12")
EndFunc   ;==>GUIStartUp

Func TrayStartUp()
    TraySetIcon($sImageTrayIcon)
    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")
    TraySetOnEvent($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")
    GUICtrlSetData($hLabelSongArtistT1, "Artist")
    GUICtrlSetData($hLabelSongLengthT1, "Length")
    GUICtrlSetData($hLabelSongTitleT1, "Title")
    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 PlaylistLink1()

EndFunc   ;==>PlaylistLink1

Func PlaylistLink2()

EndFunc   ;==>PlaylistLink2

Func PlaylistLink3()

EndFunc   ;==>PlaylistLink3

Func PlaylistLink4()

EndFunc   ;==>PlaylistLink4

Func PlaylistLink5()

EndFunc   ;==>PlaylistLink5

Func PlaylistLink6()

EndFunc   ;==>PlaylistLink6

Func PlaylistLink7()

EndFunc   ;==>PlaylistLink7

Func PlaylistLink8()

EndFunc   ;==>PlaylistLink8

Func PlaylistLink9()

EndFunc   ;==>PlaylistLink9

Func PlaylistLink10()

EndFunc   ;==>PlaylistLink10

Func PlaylistLink11()

EndFunc   ;==>PlaylistLink11

Func PlaylistLink12()

EndFunc   ;==>PlaylistLink12

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 GetSubDomain()
    
EndFunc   ;==>GetSubDomain

Func GetSongInfo()
    InetGet($sHTTP & $sDataSite, $sDataFile)
    
    Local $hDataFile = FileOpen($sDataFile)
    FileSetPos($hDataFile, 0, $FILE_BEGIN)
    Local $sDataFileRaw = FileRead($hDataFile)
    If IsArray($aDataSplit1) == 1 Then
        For $i = 0 To 246 Step 1
            _ArrayDelete($aDataSplit1, $i)
        Next
        $aDataSplit1 = StringSplit($sDataFileRaw, "|")
    Else
        $aDataSplit1 = StringSplit($sDataFileRaw, "|")
    EndIf
    FileClose($hDataFile)
    FileDelete($sDataFile)
    
    Return $aDataSplit1
EndFunc   ;==>GetSongInfo

Func ChatUpdate()
    Local $sChatFail = 0
    
    For $i = 65 To 90 Step 1
        If StringInStr(GUICtrlRead($hInputChatLineT4), Chr($i)) <> 0 Then
            MsgBox(0, "Damn.", "No alphabetical-characters allowed!")
            Local $iChatFail = 1
            ExitLoop
        EndIf
    Next
    
    If $iChatreadCount > 199 Then
        MsgBox(0, "Damn.", "Only 199 lines are fetchable!")
        Local $iChatFail = 1
    ElseIf $iChatFail = 0 Then
        Global $iChatreadCount = GUICtrlRead($hInputChatLineT4)
        InetGet($sHTTP & $sSiteChatread & $iChatreadCount, @TempDir & "\YWWChat.html")
        
        Local $hChatFile = FileOpen($sChatFile)
        Local $sChatFileLine1 = FileReadLine($hChatFile, "1")
        Local $aChatFileLine1Split1 = StringSplit($sChatFileLine1, "&nbsp;", 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, "&nbsp;", "1"), 4) & @CRLF)
            EndIf
        Next
        _GUICtrlEdit_EndUpdate($hEditChatT4)
        FileDelete($hChatFile)
    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

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
        $iAttachIE = 1
        $iAttachFF = 2
    Else
        $iAttachIE = 0
        $iAttachFF = 0
    EndIf

    If $iBrowser == 2 Then
        If $iSite == 1 Then
            _IECreate($sSearchNyaaSite & $aSongProps[0], $iAttachIE)
        ElseIf $iSite == 2 Then
            _IECreate($sSearchGoogleSite & $aSongProps[0], $iAttachIE)
        ElseIf $iSite == 3 Then
            _IECreate($sSearchTTSite & $aSongProps[0], $iAttachIE)
        EndIf
    Else
        If $iSite == 1 Then
            _FFStart($sSearchNyaaSite & $aSongProps[0], Default, $iAttachFF)
        ElseIf $iSite == 2 Then
            _FFStart($sSearchGoogleSite & $aSongProps[0], Default, $iAttachFF)
        ElseIf $iSite == 3 Then
            _FFStart($sSearchTTSite & $aSongProps[0], 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
        If IsArray($aSongProps) == 1 Then
            For $i = 0 To 246 Step 1
                _ArrayDelete($aSongProps, $i)
            Next
            Global $aSongProps = GetSongInfo()
            ;_ArrayDisplay($aSongProps)
        Else
            Global $aSongProps = GetSongInfo()
        EndIf
        
        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
                    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
                            ConsoleWrite("@@-1-@@" & @CRLF)
                            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
                            ConsoleWrite("@@-2-@@" & @CRLF)
                            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
                            ConsoleWrite("@@-3-@@" & @CRLF)
                            GUICtrlSetFont($hLabelSongAlbumT1, 9, 400, 0, "MS Sans Serif")
                            GUICtrlSetData($hLabelSongAlbumT1, $aSongProps[4])
                        ElseIf StringLen($aSongProps[4]) >= 26 Then
                            ConsoleWrite("@@-4-@@" & @CRLF)
                            GUICtrlSetFont($hLabelSongAlbumT1, 14, 400, 0, "MS Sans Serif")
                            GUICtrlSetData($hLabelSongAlbumT1, "TL;Look below.:)")
                            Local $iExtraWindow1 = 1
                        Else
                            ConsoleWrite("@@-5-@@" & @CRLF)
                            GUICtrlSetFont($hLabelSongAlbumT1, 14, 400, 0, "MS Sans Serif")
                            GUICtrlSetData($hLabelSongAlbumT1, $aSongProps[4])
                        EndIf
                        
                        If StringLen($aSongProps[3]) == 16 Or StringLen($aSongProps[3]) == 17 Then
                            ConsoleWrite("@@-6-@@" & @CRLF)
                            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
                            ConsoleWrite("@@-7-@@" & @CRLF)
                            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
                            ConsoleWrite("@@-8-@@" & @CRLF)
                            GUICtrlSetFont($hLabelSongArtistT1, 9, 400, 0, "MS Sans Serif")
                            GUICtrlSetData($hLabelSongArtistT1, $aSongProps[3])
                        ElseIf StringLen($aSongProps[3]) >= 26 Then
                            ConsoleWrite("@@-9-@@" & @CRLF)
                            GUICtrlSetFont($hLabelSongArtistT1, 14, 400, 0, "MS Sans Serif")
                            GUICtrlSetData($hLabelSongArtistT1, "TL;Look below.:)")
                            Local $iExtraWindow2 = 1
                        Else
                            ConsoleWrite("@@-10-@@" & @CRLF)
                            GUICtrlSetFont($hLabelSongArtistT1, 14, 400, 0, "MS Sans Serif")
                            GUICtrlSetData($hLabelSongArtistT1, $aSongProps[3])
                        EndIf
                        
                        If StringLen($aSongProps[2]) == 16 Or StringLen($aSongProps[2]) == 17 Then
                            ConsoleWrite("@@-11-@@" & @CRLF)
                            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
                            ConsoleWrite("@@-12-@@" & @CRLF)
                            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
                            ConsoleWrite("@@-13-@@" & @CRLF)
                            GUICtrlSetFont($hLabelSongTitleT1, 9, 400, 0, "MS Sans Serif")
                            GUICtrlSetData($hLabelSongTitleT1, $aSongProps[2])
                        ElseIf StringLen($aSongProps[2]) >= 26 Then
                            ConsoleWrite("@@-14-@@" & @CRLF)
                            GUICtrlSetFont($hLabelSongTitleT1, 14, 400, 0, "MS Sans Serif")
                            GUICtrlSetData($hLabelSongTitleT1, "TL;Look below.:)")
                            Local $iExtraWindow3 = 1
                        Else
                            ConsoleWrite("@@-15-@@" & @CRLF)
                            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
                        $aSongProps = GetSongInfo()
                    Else
                        $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

Thanks for your help & have a good day. Yours sincerely, -Jonniy-  

Link to comment
Share on other sites

It's probably because you're declaring global variables in a function, that is a big no-no. Declare your global variables before you start accessing the functions, preferably at the top of your script. You also forgot to #include the GUILIstView UDF.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • Solution

I'm not sure why you won't declare them where you should declare them, but conditionally declaring a variable is going to end up causing problems many many times. If you are going to use Global variables, declare all of them at the top of your script before you ever use them. You have numerous instances in your script where you're declaring controls in a function as global variables, and then using them in another section of your code. I had to disable Au3Check to get that script to run at all, and for an example, click the Search Song button, you get another undeclared variable error.

You should definitely rewrite this script because you need to figure out the flow of the code from the top to the bottom and where ever there's a button to be pushed.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • 2 years later...

hi, I'm new here and I don't understand much in computer languages. my problem is for my clash of clans gamebot.it works fine when I open it but when it opens the bluestacks and try to open the coc a message appears

AutoIt Error

Line 34560 (File gamebot.exe)

Error: Subscript used on non-accessible variable.

please need help on how to fix this.thanks

Link to comment
Share on other sites

  • Developers

hi, I'm new here and I don't understand much in computer languages. my problem is for my clash of clans gamebot.it works fine when I open it but when it opens the bluestacks and try to open the coc a message appears

AutoIt Error

Line 34560 (File gamebot.exe)

Error: Subscript used on non-accessible variable.

please need help on how to fix this.thanks

@mackelion,

Welcome to the AutoIt forum. :)

Unfortunately you appear to have missed the Forum rules on your way in. (there is also a link link in my signature) 
Please read them now particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. :naughty:

See you soon with a legitimate question I hope. :)

 

@AutoBert, Seems you need a refresher course as well. Fine pointing to the rules, but do NOT give an answer to the questions please.

Jos

 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...