Hacking App to download covers for nand

JoostinOnline

Certified Crash Test Dummy
Member
Joined
Apr 2, 2011
Messages
11,005
Trophies
1
Location
The Twilight Zone
Website
www.hacksden.com
XP
4,338
Country
United States
He wants to make a program that searches a NAND dump for all installed channels, then downloads covers for each of them so they can be used with Triforce or something.

How the f... did you understand thats what he wanted lol
Can I have your dictionary?
Pretty sure he wants a Windows based manager for channels installed on a virtual NAND (e.g. for use with *NEEK or Tiiforce or something) that can download covers from the internet to display in said manager.
From now on your job is to translate what spayrosam says, lol.
 

spayrosam

Well-Known Member
OP
Member
Joined
Jun 2, 2009
Messages
756
Trophies
0
Location
Gafsa
Website
Visit site
XP
309
Country
nanddumpcoversdownloade.png

I have done so!
Download covers for titles installed on a virtual NAND B-)
 

twig123

Well-Known Member
Member
Joined
Apr 4, 2009
Messages
261
Trophies
1
XP
257
Country
United States
Hmm... I understood everything spayrosam was saying ;)
I tried downloading all my EmuNand channel covers through WiiFlow, but it downloads a few and then locks up.
Those devs need to fix that, but it would be awesome to have an offline tool to do the same thing!

@spayrosam - Your Nand Covers Downloader looks awesome (sorta like a ShowMiiNand tool, but with options to download cover art!). I'm giddy to try this, so let us know when you are ready for a public release.
 

VashTS

Beat it, son
Member
Joined
Mar 14, 2009
Messages
4,307
Trophies
1
Age
39
Location
Upstate NY
XP
3,735
Country
United States
i like this tool. if it could have an install feature it would be even better ;) thanks spayrosam, i like your work even though some of it is crazy ideas of yours!
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,646
Country
France
Thanks for the tool.
Installing channels would be great too (a ShowMiiWads clone), and maybe even with an option for Dump type (neek/bootmii, or d2x)
d2x are not escaping non FAT32 characters the same way than other dump managers or emulators.


Also, I guess you should ask to use Wiitdb, it will be better for the Gametdb admin ;)
You may even have your program listed on Gametdb website then.
 

spayrosam

Well-Known Member
OP
Member
Joined
Jun 2, 2009
Messages
756
Trophies
0
Location
Gafsa
Website
Visit site
XP
309
Country
NCD Source code.
Build it if yoe get an Error!
Code:
#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Version=beta
#AutoIt3Wrapper_icon=icon.ico
#AutoIt3Wrapper_outfile=Nand Covers Downloader.exe
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_Comment=MNand Covers Downloader
#AutoIt3Wrapper_Res_Description=Nand Covers Downloader
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_ProductVersion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=Copyright © 2011 Spayrosam (Samir.L)
#AutoIt3Wrapper_Res_Field=CompanyName|Spayrosam
#AutoIt3Wrapper_Res_Field=ProductName|Nand Covers Downloader
#AutoIt3Wrapper_Res_Field=ProductVersion|1.0.0.0
#AutoIt3Wrapper_Res_Field=Nand Covers Downloader|1.0.0.0
#AutoIt3Wrapper_Run_AU3Check=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <File.au3>
#include <Array.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <ListViewConstants.au3>
#include <Gdiplus.au3>
Local $TitleFolderState = 0, $CoverFolderState = 0, $iNumber = 0, $CancellString = " "
Global $cancelState = 0
$DataDir = @ScriptDir & "\Data"
If FileExists($DataDir) = 0 Then DirCreate($DataDir)
$GUI = GUICreate("Nand Covers Downloader", 940, 620, -1, -1)
$Settingmenu = GUICtrlCreateMenu("&Settings")
$SettingLang = GUICtrlCreateMenuItem("Langauges Stettings", $Settingmenu)
GUICtrlSetState(-1, $GUI_DEFBUTTON)
GUICtrlCreateGroup("", 5, 10, 460, 40)
$TitleFolder = GUICtrlCreateButton("Nand Path", 10, 20, 120, 25)
$TitleFolderinput = GUICtrlCreateInput("", 130, 20, 330, 25, $ES_READONLY)
GUICtrlCreateGroup("", 475, 10, 460, 40)
$CoverFolder = GUICtrlCreateButton("Covers Path", 480, 20, 120, 25)
$CoverFolderInput = GUICtrlCreateInput("", 600, 20, 330, 25, $ES_READONLY)
$LabeLLang = GUICtrlCreateLabel("Language", 10, 55, 60, 17)
$LangBox = GUICtrlCreateCombo("", 70, 52, 60, 25)
GUICtrlSetData(-1, "EN|FR|DE|ES|IT|NL|PT|US|JA|KO|ZH", "EN")
$LabelType = GUICtrlCreateLabel("Cover Type", 150, 55, 60, 17)
$CoverTypeBox = GUICtrlCreateCombo("", 210, 52, 60, 27)
GUICtrlSetData(-1, "Full|Front|3D|Disc", "Full")
$loadnand = GUICtrlCreateButton("Load nand dump", 280, 50, 155, 25)
$Initialising = GUICtrlCreateButton("Check downloads", 445, 50, 155, 25)
$StartDownload = GUICtrlCreateButton("Download Covers", 610, 50, 155, 25)
$Cancel = GUICtrlCreateButton("Cancel", 775, 50, 155, 25)
$listview = GUICtrlCreateListView("", 10, 80, 920, 450, -1, BitOR($LVS_SORTASCENDING, $LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_REGIONAL))
_GUICtrlListView_AddColumn($listview, "Folder Name", 80)
_GUICtrlListView_AddColumn($listview, "ID", 70)
_GUICtrlListView_AddColumn($listview, "Name", 200)
_GUICtrlListView_AddColumn($listview, "Type", 100)
_GUICtrlListView_AddColumn($listview, "Region", 100)
_GUICtrlListView_AddColumn($listview, "Title size (Kb)", 100)
_GUICtrlListView_AddColumn($listview, "Cover Lang", 100)
_GUICtrlListView_AddColumn($listview, "Covers Size (Kb)", 100)
_GUICtrlListView_AddColumn($listview, "State", 100)
_GUICtrlListView_AddColumn($listview, "", 0)
_GUICtrlListView_AddColumn($listview, "", 0)
Local $contextmenu = GUICtrlCreateContextMenu($listview)
Local $OpentitleFolder = GUICtrlCreateMenuItem("Open title folder", $contextmenu)
Local $Deletetitle = GUICtrlCreateMenuItem("Delete", $contextmenu)
$State = GUICtrlCreateLabel("State", 10, 545, 920, 25, BitOR($SS_CENTER, $SS_CENTERIMAGE))
$progress = GUICtrlCreateProgress(10, 570, 920, 20)
GUISetState(@SW_SHOW, $GUI)
$SettingsGui = GUICreate("", 145, 320, 10, 50, $WS_POPUP, BitOR($WS_EX_DLGMODALFRAME, $WS_EX_MDICHILD), $GUI)
GUICtrlCreateGroup("Preferred region order", 5, 5, 135, 280)
$LangOption = GUICtrlCreateListView('', 10, 20, 125, 260)
$LangOptionHandle = GUICtrlGetHandle($LangOption)
_GUICtrlListView_AddColumn($LangOption, "Region", 120)
GUICtrlCreateListViewItem("EN", $LangOption)
GUICtrlCreateListViewItem("FR", $LangOption)
GUICtrlCreateListViewItem("DE", $LangOption)
GUICtrlCreateListViewItem("ES", $LangOption)
GUICtrlCreateListViewItem("IT", $LangOption)
GUICtrlCreateListViewItem("NL", $LangOption)
GUICtrlCreateListViewItem("PT", $LangOption)
GUICtrlCreateListViewItem("US", $LangOption)
GUICtrlCreateListViewItem("JA", $LangOption)
GUICtrlCreateListViewItem("KO", $LangOption)
GUICtrlCreateListViewItem("ZH", $LangOption)
$LangSave = GUICtrlCreateButton("Save", 10, 290, 125, 25)
GUISetState(@SW_HIDE, $SettingsGui)
GUIRegisterMsg($WM_NOTIFY, '_DragListView')
GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $SettingLang
GUISetState(@SW_SHOW, $SettingsGui)
Case $LangSave
GUISetState(@SW_HIDE, $SettingsGui)
Case $OpentitleFolder
$Select = _GUICtrlListView_GetSelectedIndices($listview, True)
If $Select[0] > 0 Then
If _GUICtrlListView_GetItemText($listview, $Select[1], 0) <> "" Then
ShellExecute(GUICtrlRead($TitleFolderinput) & "\title\" & _GUICtrlListView_GetItemText($listview, $Select[1], 10) & "\" & _GUICtrlListView_GetItemText($listview, $Select[1], 0))
EndIf
EndIf
Case $Deletetitle
$Select = _GUICtrlListView_GetSelectedIndices($listview, True)
If $Select[0] > 0 Then
If _GUICtrlListView_GetItemText($listview, $Select[1], 0) <> "" Then
If MsgBox(36, "Delete Title", "Are you sure you want to remove : " & _GUICtrlListView_GetItemText($listview, $Select[1], 2) & "!", Default, $GUI) = 6 Then
If WinExists(GUICtrlRead($TitleFolderinput) & "\title\" & _GUICtrlListView_GetItemText($listview, $Select[1], 10) & "\" & _GUICtrlListView_GetItemText($listview, $Select[1], 0)) Then
WinClose(_GUICtrlListView_GetItemText($listview, $Select[1], 0))
EndIf
DirRemove(GUICtrlRead($TitleFolderinput) & "\title\" & _GUICtrlListView_GetItemText($listview, $Select[1], 10) & "\" & _GUICtrlListView_GetItemText($listview, $Select[1], 0), 1)
FileDelete(GUICtrlRead($TitleFolderinput) & "\ticket\" & _GUICtrlListView_GetItemText($listview, $Select[1], 10) & "\" & _GUICtrlListView_GetItemText($listview, $Select[1], 0) & ".tik")
_GUICtrlListView_DeleteItem(GUICtrlGetHandle($listview), $Select[1])
EndIf
EndIf
EndIf
Case $loadnand
_GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($listview))
$cancelState = 0
_Main()
Case $TitleFolder
Local $path = FileSelectFolder("Choose a folder. (Nand)", @ScriptDir, 1, "", $GUI)
If @error <> 1 Then
If StringRegExpReplace($path, "^.*\\(.*)$", "$1") = "Nand" Then
$TitleFolderState = 1
_GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($listview))
GUICtrlSetData($TitleFolderinput, $path)
Else
$TitleFolderState = 0
GUICtrlSetData($TitleFolderinput, "")
MsgBox(48, "Wrong folder!", "Navigate to 'Nand' folder (USB\nand)")
EndIf
Else
$TitleFolderState = 0
MsgBox(48, "Wrong folder!", "Navigate to 'Nand' folder (USB\nand)")
EndIf
Case $CoverFolder
_SaveFolder()
Case $LangBox
If FileExists($DataDir & "\title_" & GUICtrlRead($LangBox) & ".ini") = 0 Then
$DownloadtitleSize = InetGetSize("http://www.gametdb.com/titles.txt?LANG=" & GUICtrlRead($LangBox))
$Downloadtitle = InetGet("http://www.gametdb.com/titles.txt?LANG=" & GUICtrlRead($LangBox), $DataDir & "\title_" & GUICtrlRead($LangBox) & ".ini", 1, 1)
Do
$aInfo = InetGetInfo($Downloadtitle)
$iPercent = Round($aInfo[0] / $DownloadtitleSize * 100, 1)
GUICtrlSetData($progress, $iPercent)
GUICtrlSetData($State, "Download " & GUICtrlRead($LangBox) & " title" & StringFormat("%s / %s", $aInfo[0], $DownloadtitleSize))
Until $aInfo[2]
Sleep(250)
If $aInfo[3] Then GUICtrlSetData($progress, 100)
InetClose($Downloadtitle)
EndIf
Case $Initialising
$cancelState = 0
$CountTitle = _GUICtrlListView_GetItemCount($listview) - 1
For $Del = 0 To $CountTitle
_GUICtrlListView_SetItemText($listview, $Del, "", 6)
_GUICtrlListView_SetItemText($listview, $Del, "", 7)
_GUICtrlListView_SetItemText($listview, $Del, "", 8)
_GUICtrlListView_SetItemText($listview, $Del, "", 9)
Next
Local $TotalDownload = 0
For $CnT = 0 To $CountTitle
If $cancelState = 1 Then
$CancellString = "Check downloads"
ExitLoop
EndIf
GetCovers(_GUICtrlListView_GetItemText($listview, $CnT, 1), $CountTitle, $CnT)
Next
Case $StartDownload
Local $TotalDownload = 0, $TotalSize = 0
$cancelState = 0
$CountTitle = _GUICtrlListView_GetItemCount($listview) - 1
Local $TotalDownload = 0
For $CnT = 0 To $CountTitle
If _GUICtrlListView_GetItemText($listview, $CnT, 7) > 0 Then
$TotalSize += _GUICtrlListView_GetItemText($listview, $CnT, 7)
$TotalDownload += 1
EndIf
Next
If GUICtrlRead($CoverTypeBox) = "Full" Then
$TypeDown = "coverfullHQ"
ElseIf GUICtrlRead($CoverTypeBox) = "Front" Then
$TypeDown = "cover"
ElseIf GUICtrlRead($CoverTypeBox) = "3D" Then
$TypeDown = "cover3D"
ElseIf GUICtrlRead($CoverTypeBox) = "Disc" Then
$TypeDown = "disc"; disccustom
EndIf
If MsgBox(4, "Info", "Size of remote files: " & $TotalSize & " Kb" & @CR & "Total Download: " & $TotalDownload & @CR & "Download now?", Default, $GUI) = 6 Then
For $CnT = 0 To $CountTitle
If $cancelState = 1 Then
$CancellString = "Download covers"
ExitLoop
EndIf
If _GUICtrlListView_GetItemText($listview, $CnT, 7) <> 0 Then
Local $CoverUrl = "http://art.gametdb.com/wii/" & $TypeDown & "/" & _GUICtrlListView_GetItemText($listview, $CnT, 6) & "/" & _GUICtrlListView_GetItemText($listview, $CnT, 9) & ".png"
If GUICtrlRead($CoverFolderInput) = "" Then
_SaveFolder()
Else
Local $CoverUrlSaveFile = GUICtrlRead($CoverFolderInput) & "\" & StringLeft(_GUICtrlListView_GetItemText($listview, $CnT, 1), 4) & ".png"
DownloadCovers($CoverUrl, $CoverUrlSaveFile, $CountTitle, $CnT)
EndIf
Else
_GUICtrlListView_SetItemText($listview, $CnT, "****", 8)
EndIf
GUICtrlSetData($progress, $CnT * 100 / $CountTitle)
Next
EndIf
EndSwitch
WEnd
Func _SaveFolder()
Local $SaveFolder = FileSelectFolder("Choose a folder. (Covers)", @ScriptDir, 1)
If @error <> 1 Then
$CoverFolderState = 1
GUICtrlSetData($CoverFolderInput, $SaveFolder)
Else
$CoverFolderState = 0
GUICtrlSetData($CoverFolderInput, "")
EndIf
EndFunc   ;==>_SaveFolder
Func DownloadCovers($LinkCover, $saveCover, $progTota, $ProgPart)
;MsgBox(0,"", $LinkCover & @CR & $saveCover)
$DownloadCoverSize = InetGetSize($LinkCover)
$DownloadCover = InetGet($LinkCover, $saveCover, 1, 1)
Do
$aInfo = InetGetInfo($DownloadCover)
$iPercent = Round($aInfo[0] / $DownloadCoverSize * 100, 1)
_GUICtrlListView_SetItemText($listview, $ProgPart, $iPercent & "%", 8)
Until $aInfo[2]
InetClose($DownloadCover)
GUICtrlSetData($State, "Game N': " & $ProgPart & " / " & $progTota & "	 |	 " & $LinkCover)
EndFunc   ;==>DownloadCovers
Func _Main()
Local $LangDown = GUICtrlRead($LangBox)
Global $FileListNand[1], $FileListNandGameID[1][3], $FileListNandGameALLID[1][2], $DownloadID[1]
If $TitleFolderState = 1 Then
Local $NewNumber = 0
$FileListRead = _FileListToArray($path & "\title", "*", 2)
If @error <> 1 Then
ReDim $FileListNand[$FileListRead[0] + 1]
For $Nn = 1 To $FileListRead[0]
If StringLeft($FileListRead[$Nn], 4) = "0001" Then
$FileListNandGame = _FileListToArray($path & "\title\" & $FileListRead[$Nn], "*", 2)
If @error <> 1 Then
ReDim $FileListNandGameID[$FileListNandGame[0] + $NewNumber + 1][3]
$FileListNandGameID[0][0] = $NewNumber
For $GI = 1 To $FileListNandGame[0]
$FileListNandGameID[$GI + $NewNumber][0] = $FileListNandGame[$GI]
$FileListNandGameID[$GI + $NewNumber][1] = StringUpper(BinaryToString("0x" & $FileListNandGame[$GI]))
$FileListNandGameID[$GI + $NewNumber][2] = $FileListRead[$Nn]
Next
$NewNumber += $FileListNandGame[0]
EndIf
EndIf
Next
$iNumber = 0
For $iL = 1 To $FileListNandGameID[0][0]
If $cancelState = 1 Then
$CancellString = "Load nand dump"
ExitLoop
EndIf
_searchGameID($FileListNandGameID[$iL - 1][2], $FileListNandGameID[$iL - 1][0], $FileListNandGameID[$iL - 1][1], $FileListNandGameID[0][0])
Next
EndIf
EndIf
;_ArrayDisplay($FileListNandGameID, "FileList")
EndFunc   ;==>_Main
Func GetCovers($IDToChek, $progTota, $ProgPart)
Local $CoversTitleFound = 0
$LangDown = GUICtrlRead($LangBox)
If GUICtrlRead($CoverTypeBox) = "Full" Then
$TypeDown = "coverfullHQ"
ElseIf GUICtrlRead($CoverTypeBox) = "Front" Then
$TypeDown = "cover"
ElseIf GUICtrlRead($CoverTypeBox) = "3D" Then
$TypeDown = "cover3D"
ElseIf GUICtrlRead($CoverTypeBox) = "Disc" Then
$TypeDown = "disc"; disccustom
EndIf
Local $nSize = InetGetSize("http://art.gametdb.com/wii/" & $TypeDown & "/" & $LangDown & "/" & $IDToChek & ".png")
If @error = 0 Then
$TotalDownload += 1
GUICtrlSetData($State, "Game N': " & $ProgPart & " / " & $progTota & "	 |	 http://art.gametdb.com/wii/" & $TypeDown & "/" & $LangDown & "/" & $IDToChek & ".png")
GUICtrlSetData($progress, $ProgPart * 100 / $progTota)
_GUICtrlListView_AddSubItem($listview, $ProgPart, $LangDown, 6, 1)
_GUICtrlListView_AddSubItem($listview, $ProgPart, Round($nSize / 1024), 7, 1)
_GUICtrlListView_AddSubItem($listview, $ProgPart, $IDToChek, 9, 1)
$CoversTitleFound = 1
Else
For $NewL = 0 To 10
$NowStringLang = _GUICtrlListView_GetItemText($LangOption, $NewL, 0)
If $NowStringLang = "EN" Or $NowStringLang = "FR" Or $NowStringLang = "DE" Or $NowStringLang = "ES" Or _
$NowStringLang = "IT" Or $NowStringLang = "NL" Or $NowStringLang = "PT" Then
$RegionID = "P"
ElseIf $NowStringLang = "US" Then
$RegionID = "E"
ElseIf $NowStringLang = "JA" Then
$RegionID = "J"
ElseIf $NowStringLang = "KO" Then
$RegionID = "K"
ElseIf $NowStringLang = "ZH" Then
$RegionID = "W"
EndIf
Local $NewIDREgion = ""
$splitIDToChek = StringSplit($IDToChek, "")
For $SSID = 1 To $splitIDToChek[0]
If $SSID = 4 Then
$NewIDREgion &= $RegionID
Else
$NewIDREgion &= $splitIDToChek[$SSID]
EndIf
Next
Local $nCOVERSSize = InetGetSize("http://art.gametdb.com/wii/" & $TypeDown & "/" & $NowStringLang & "/" & $NewIDREgion & ".png")
If @error = 0 Then
$TotalDownload += 1
GUICtrlSetData($progress, $ProgPart * 100 / $progTota)
_GUICtrlListView_AddSubItem($listview, $ProgPart, $NowStringLang, 6, 1)
_GUICtrlListView_AddSubItem($listview, $ProgPart, Round($nCOVERSSize / 1024), 7, 1)
$CoversTitleFound = 1
_GUICtrlListView_AddSubItem($listview, $ProgPart, $NewIDREgion, 9, 1)
ExitLoop
EndIf
;MsgBox(0, "", $NowStringLang)
GUICtrlSetData($State, "Game N': " & $ProgPart & " / " & $progTota & "	 |	 http://art.gametdb.com/wii/" & $TypeDown & "/" & $NowStringLang & "/" & $NewIDREgion & ".png")
Next
If $CoversTitleFound = 0 Then
GUICtrlSetData($State, "Game N': " & $ProgPart & " / " & $progTota & "	 |	 http://art.gametdb.com/wii/" & $TypeDown & "/" & $LangDown & "/" & $IDToChek & ".png")
GUICtrlSetData($progress, $ProgPart * 100 / $progTota)
_GUICtrlListView_AddSubItem($listview, $ProgPart, "Not found", 6, 1)
_GUICtrlListView_AddSubItem($listview, $ProgPart, 0, 7, 1)
_GUICtrlListView_AddSubItem($listview, $ProgPart, $IDToChek, 9, 1)
EndIf
EndIf

EndFunc   ;==>GetCovers

Func _searchGameID($foldernameMain, $foldername, $name_to_search, $iToNumber)
$iNumber += 1
GUICtrlSetData($State, "File N' " & $iNumber & " / " & $iToNumber & "	|	" & "Load: '" & $foldername & " : " & $name_to_search & "'")
$iPercent = Round($iNumber / $iToNumber * 100, 1)
GUICtrlSetData($progress, $iPercent)
$foldernameSize = DirGetSize($path & "\title\" & $foldernameMain & "\" & $foldername)
$foldernameTicketSize = FileGetSize($path & "\ticket\" & $foldernameMain & "\" & $foldername & ".tik")
If $foldernameSize > 0 Then
If FileExists($DataDir & "\title_" & GUICtrlRead($LangBox) & ".ini.") <> 0 Then
Local $hFile = FileOpen($DataDir & "\title_" & GUICtrlRead($LangBox) & ".ini.", 0)
If $hFile <> -1 Then
While True
$searchItem = FileReadLine($hFile)
If @error Then ExitLoop
If StringInStr($searchItem, "=") Then
Local $ID_To_search = StringSplit($searchItem, "=", 0)
If StringInStr($ID_To_search[1], $name_to_search) Then
Local $Title_To_search = StringSplit($searchItem, "=", 0)
If StringLeft($Title_To_search[2], 1) = " " Then $Title_To_search[2] = StringTrimLeft($Title_To_search[2], 1)
If StringRight($Title_To_search[1], 1) = " " Then $Title_To_search[1] = StringTrimRight($Title_To_search[1], 1)
$item_count = _GUICtrlListView_GetItemCount($listview)
_GUICtrlListView_AddItem($listview, $foldername, $item_count)
_GUICtrlListView_AddSubItem($listview, $item_count, $Title_To_search[1], 1, 1)
_GUICtrlListView_AddSubItem($listview, $item_count, $Title_To_search[2], 2, 1)
Local $SetGameType = ""
$GetGameType = StringLeft($Title_To_search[1], 1)
If $GetGameType = "W" Then
$SetGameType = "WiiWare"
ElseIf $GetGameType = "N" Then
$SetGameType = "Nintendo64"
ElseIf $GetGameType = "J" Then
$SetGameType = "SNES"
ElseIf $GetGameType = "F" Then
$SetGameType = "NES"
ElseIf $GetGameType = "A" Then
$GetGameType_A = StringLeft($Title_To_search[1], 2)
If $GetGameType_A = "A6" Then
$SetGameType = "Arcade"
ElseIf $GetGameType_A = "A7" Then
$SetGameType = "Arcade-Namco"
Else
$SetGameType = "custom"
EndIf
ElseIf $GetGameType = "P" Then
$SetGameType = "TurboGrafx16"
ElseIf $GetGameType = "Q" Then
$SetGameType = "TurboGrafxCD"
ElseIf $GetGameType = "C" Then
$SetGameType = "Commodore"
ElseIf $GetGameType = "E" Then ;EA
$SetGameType = "NeoGeo"
ElseIf $GetGameType = "M" Then
$SetGameType = "SegaMegaDrive"
ElseIf $GetGameType = "L" Then
$SetGameType = "SegaMasterSystem"
ElseIf $GetGameType = "R" Or $GetGameType = "S" Or $GetGameType = "A" Then
$SetGameType = "Wii"
ElseIf $GetGameType = "G" Or $GetGameType = "D" Then
$SetGameType = "GameCube"
ElseIf $GetGameType = "H" Then
$SetGameType = "General Channel"
ElseIf $GetGameType = "X" Then
$SetGameType = "WiiWare - Demos "
Else
$SetGameType = "custom"
EndIf
_GUICtrlListView_AddSubItem($listview, $item_count, $SetGameType, 3, 1)
_GUICtrlListView_AddSubItem($listview, $item_count, _GetRegion($Title_To_search[1]), 4, 1)
_GUICtrlListView_AddSubItem($listview, $item_count, Round(($foldernameSize + $foldernameTicketSize) / 1024, 2), 5, 1)
_GUICtrlListView_AddSubItem($listview, $item_count, $foldernameMain, 10, 1)
EndIf
EndIf
WEnd
FileClose($hFile)
EndIf
EndIf
EndIf
EndFunc   ;==>_searchGameID
Func _GetRegion($IDFound)
Global $UserSearchRegion = "Unknow"
If StringRight(StringLeft($IDFound, 4), 1) = "A" Then
$UserSearchRegion = "All regions"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "D" Then
$UserSearchRegion = "German-speaking regions"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "E" Then
$UserSearchRegion = "USA"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "F" Then
$UserSearchRegion = "French-speaking regions"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "I" Then
$UserSearchRegion = "Italian-speaking regions"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "J" Then
$UserSearchRegion = "Japan"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "K" Then
$UserSearchRegion = "Korea"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "L" Then
$UserSearchRegion = "Japanese Import to Europe"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "M" Then
$UserSearchRegion = "American Import to Europe"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "N" Then
$UserSearchRegion = "Japanese Import to USA"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "P" Then
$UserSearchRegion = "Europe"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "S" Then
$UserSearchRegion = "Spanish-speaking regions"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "Q" Then
$UserSearchRegion = "Korea with Japanese language"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "T" Then
$UserSearchRegion = "Korea with English language"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "X" Then
$UserSearchRegion = "Not a real region code"
EndIf
Return $UserSearchRegion
EndFunc   ;==>_GetRegion
Func _DragListView($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iwParam
Local Static $iStartIndex = -1, $iEndIndex = -1, $sItemText = "", $fLVDrag = False
Switch $iMsg
Case $WM_MOUSEMOVE
Local $aHit = _GUICtrlListView_HitTest($LangOptionHandle)
If IsArray($aHit) Then _GUICtrlListView_SetItemFocused($LangOptionHandle, $aHit[0])
Case $WM_NOTIFY
Local $tNMHDR, $hWndFrom, $iCode, $iNewItem, $tNMLISTVIEW
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, 'hWndFrom'))
$iCode = DllStructGetData($tNMHDR, 'Code')
Switch $hWndFrom
Case $LangOptionHandle
Switch $iCode
Case $LVN_BEGINDRAG
If Not $fLVDrag Then
$tNMLISTVIEW = DllStructCreate($tagNMLISTVIEW, $ilParam)
$iStartIndex = DllStructGetData($tNMLISTVIEW, 'Item')
$sItemText = _GUICtrlListView_GetItemTextString($LangOptionHandle, $iStartIndex)
$fLVDrag = True
GUIRegisterMsg($WM_MOUSEMOVE, '_DragListView')
EndIf
Case $LVN_HOTTRACK
If $fLVDrag Then
$tNMLISTVIEW = DllStructCreate($tagNMLISTVIEW, $ilParam)
$iEndIndex = DllStructGetData($tNMLISTVIEW, 'Item')
$fLVDrag = False
GUIRegisterMsg($WM_MOUSEMOVE, '')
Select
Case $iStartIndex < $iEndIndex
$iNewItem = _GUICtrlListView_InsertItem($LangOptionHandle, "", $iEndIndex + 1)
_GUICtrlListView_SetItemText($LangOptionHandle, $iNewItem, $sItemText, -1)
_GUICtrlListView_SetItemSelected($LangOptionHandle, $iNewItem, True, True)
_GUICtrlListView_DeleteItem($LangOptionHandle, $iStartIndex)
Case $iStartIndex > $iEndIndex
_GUICtrlListView_DeleteItem($LangOptionHandle, $iStartIndex)
$iNewItem = _GUICtrlListView_InsertItem($LangOptionHandle, "", $iEndIndex)
_GUICtrlListView_SetItemText($LangOptionHandle, $iNewItem, $sItemText, -1)
_GUICtrlListView_SetItemSelected($LangOptionHandle, $iNewItem, True, True)
EndSelect
EndIf
EndSwitch
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc   ;==>_DragListView
Func _WM_COMMAND($hWnd, $nMsg, $wParam, $lParam)
Local $hButton = GUICtrlGetHandle($Cancel)
Switch $lParam
Case $hButton
$cancelState = 1
GUICtrlSetData($progress, 0)
GUICtrlSetData($State, $CancellString & " : Operation cancelled by user")
EndSwitch
EndFunc   ;==>_WM_COMMAND
 

twig123

Well-Known Member
Member
Joined
Apr 4, 2009
Messages
261
Trophies
1
XP
257
Country
United States
Hmm...
Tried both v1 and v1a and can't seem to get it to work.
I have to move the program to the nand drive, because it won't let me pick the path if it isn't on the same drive letter.
Once moving it to the nand drive, I am able to select the nand folder (V:\Nand) and the cover path (V:\wiiflow\covers).
I click the "Load Nand Dump" button and it counts up a bunch of stuff at the bottom in the progress bar, but nothing is displayed in the main window.
...clicking "Check downloads" seems to do nothing, and clicking "Download Covers" shows Total Download "0".

I see that in your screenshot you are using the C: Drive... wondering if that is the issue, but I don't have enough free space on C: at the moment to test.
 

twig123

Well-Known Member
Member
Joined
Apr 4, 2009
Messages
261
Trophies
1
XP
257
Country
United States
1 - Change Lang to EN
2 - Go to Data folder and rename EN_title.ini to US_title.ini
3 - Change Lang to US

4 - Enjoy

I' ll fix it (next release)
I ended up formatting my Wii drive from FAT32/WBFS to just FAT32 and now NCD v1a seems to work when I launch it and click EN first (I didn't have to rename anything).
(Currently downloading covers for my entire Emu_Nand!!! You Rock Man!!!)

Funny thing I just noticed - it also parses save games for any normal Wii games on the NAND as well. lol, kinda strange :P

Another feature that might be cool... copy the URLs for all of the found pictures to the windows clipboard (That way we can use a download manager to multi-thread downloads)
 

flowlapache

Well-Known Member
Member
Joined
Sep 7, 2010
Messages
242
Trophies
1
Age
38
Website
Visit site
XP
1,048
Country
France
Thanks for this app, it's a really good idea and really usefull!! Moreover it would be perfect if it could work with another folder that the "nand at root" one...from the same folders use for neek2o for example would be perfect!! To have several nands with all covers (for postloader or wiiflow or mighty channels or other homebrews like these)...its faster than make it trough the wii!
 

spayrosam

Well-Known Member
OP
Member
Joined
Jun 2, 2009
Messages
756
Trophies
0
Location
Gafsa
Website
Visit site
XP
309
Country


New NCD Source code.
Build it to test (only a test)
Need to fix some issues..
Code:
#NoTrayIcon
#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Version=beta
#AutoIt3Wrapper_icon=icon.ico
#AutoIt3Wrapper_outfile=Nand Covers Downloader.exe
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_Comment=MNand Covers Downloader
#AutoIt3Wrapper_Res_Description=Nand Covers Downloader
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_ProductVersion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=Copyright &#169; 2011 Spayrosam (Samir.L)
#AutoIt3Wrapper_Res_Field=CompanyName|Spayrosam
#AutoIt3Wrapper_Res_Field=ProductName|Nand Covers Downloader
#AutoIt3Wrapper_Res_Field=ProductVersion|1.0.0.0
#AutoIt3Wrapper_Res_Field=Nand Covers Downloader|1.0.0.0
#AutoIt3Wrapper_Run_AU3Check=n
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <File.au3>
#include <Array.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <ListViewConstants.au3>
#include <String.au3>
#include <GuiEdit.au3>

Local $TitleFolderState = 0, $CoverFolderState = 0, $iNumber = 0, $CancellString = " "
Global $cancelState = 0
$DataDir = @ScriptDir & "\Data"
$ConfigINI = $DataDir & "\NCD.ini"
If FileExists($DataDir) = 0 Then DirCreate($DataDir)
$GUI = GUICreate("Nand Covers Downloader", 940, 620, -1, -1)
$Settingmenu = GUICtrlCreateMenu("&Settings")
$SettingLang = GUICtrlCreateMenuItem("Langauges Stettings", $Settingmenu)
GUICtrlSetState(-1, $GUI_DEFBUTTON)
GUICtrlCreateGroup("", 5, 10, 460, 40)
$TitleFolder = GUICtrlCreateButton("Nand Path", 10, 20, 120, 25)
$TitleFolderinput = GUICtrlCreateInput("", 130, 20, 330, 25, $ES_READONLY)
If FileExists(IniRead($ConfigINI, "Conf", "Nand Path", "")) Then
GUICtrlSetData($TitleFolderinput, IniRead($ConfigINI, "Conf", "Nand Path", ""))
Local $path = IniRead($ConfigINI, "Conf", "Nand Path", "")
$TitleFolderState = 1
EndIf
GUICtrlCreateGroup("", 475, 10, 460, 40)
$CoverFolder = GUICtrlCreateButton("Covers Path", 480, 20, 120, 25)
$CoverFolderInput = GUICtrlCreateInput("", 600, 20, 330, 25, $ES_READONLY)
If FileExists(IniRead($ConfigINI, "Conf", "Covers Path", "")) Then
GUICtrlSetData($CoverFolderInput, IniRead($ConfigINI, "Conf", "Covers Path", ""))
Local $SaveFolder = IniRead($ConfigINI, "Conf", "Covers Path", "")
EndIf
$LabeLLang = GUICtrlCreateLabel("Language", 10, 55, 60, 17)
$LangBox = GUICtrlCreateCombo("", 70, 52, 60, 25)
GUICtrlSetData(-1, "EN|FR|DE|ES|IT|NL|PT|US|JA|KO|ZH", IniRead($ConfigINI, "Conf", "Language", "EN"))
$LabelType = GUICtrlCreateLabel("Cover Type", 150, 55, 60, 17)
$CoverTypeBox = GUICtrlCreateCombo("", 210, 52, 60, 27)
GUICtrlSetData(-1, "Full|Front|3D|Disc", IniRead($ConfigINI, "Conf", "Cover Type", "Full"))
$loadnand = GUICtrlCreateButton("Load nand dump", 280, 50, 155, 25)
$Initialising = GUICtrlCreateButton("Check downloads", 445, 50, 155, 25)
$StartDownload = GUICtrlCreateButton("Download Covers", 610, 50, 155, 25)
$Cancel = GUICtrlCreateButton("Cancel", 775, 50, 155, 25)
$listview = GUICtrlCreateListView("", 10, 80, 920, 450, -1, BitOR($LVS_SORTASCENDING, $LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_REGIONAL))
$listviewHandle = GUICtrlGetHandle($listview)
_GUICtrlListView_AddColumn($listview, "Folder Name", 80)
_GUICtrlListView_AddColumn($listview, "ID", 70)
_GUICtrlListView_AddColumn($listview, "Name", 200)
_GUICtrlListView_AddColumn($listview, "Type", 100)
_GUICtrlListView_AddColumn($listview, "Region", 100)
_GUICtrlListView_AddColumn($listview, "Title size (Kb)", 100)
_GUICtrlListView_AddColumn($listview, "Cover Lang", 100)
_GUICtrlListView_AddColumn($listview, "Covers Size (Kb)", 100)
_GUICtrlListView_AddColumn($listview, "State", 100)
_GUICtrlListView_AddColumn($listview, "", 0)
_GUICtrlListView_AddColumn($listview, "", 0)
Local $contextmenu = GUICtrlCreateContextMenu($listview)
Local $OpentitleFolder = GUICtrlCreateMenuItem("Open title folder", $contextmenu)
Local $Deletetitle = GUICtrlCreateMenuItem("Delete", $contextmenu)
Local $GettitleInfo = GUICtrlCreateMenuItem("Title Information", $contextmenu)
GUICtrlSetState($OpentitleFolder, $GUI_DISABLE)
GUICtrlSetState($Deletetitle, $GUI_DISABLE)
GUICtrlSetState($GettitleInfo, $GUI_DISABLE)
$State = GUICtrlCreateLabel("State", 10, 545, 920, 25, BitOR($SS_CENTER, $SS_CENTERIMAGE))
$progress = GUICtrlCreateProgress(10, 570, 920, 20)
GUISetState(@SW_SHOW, $GUI)
$SettingsGui = GUICreate("", 145, 320, 10, 50, $WS_POPUP, BitOR($WS_EX_DLGMODALFRAME, $WS_EX_MDICHILD), $GUI)
GUICtrlCreateGroup("Preferred region order", 5, 5, 135, 280)
$LangOption = GUICtrlCreateListView('', 10, 20, 125, 260)
$LangOptionHandle = GUICtrlGetHandle($LangOption)
$PreferredRegion = StringSplit(IniRead($ConfigINI, "Conf", "Preferred Region", "EN|FR|DE|ES|IT|NL|PT|US|JA|KO|ZH"), "|", 0)
_GUICtrlListView_AddColumn($LangOption, "Region", 120)
If $PreferredRegion[0] = 11 Then
Else
MsgBox(16, "Error!", $ConfigINI & " is corrupted !" & @CRLF & "Repairing corrupted file..", 5, $GUI)
IniWrite($ConfigINI, "Conf", "Preferred Region", "EN|FR|DE|ES|IT|NL|PT|US|JA|KO|ZH")
$PreferredRegion = StringSplit(IniRead($ConfigINI, "Conf", "Preferred Region", "EN|FR|DE|ES|IT|NL|PT|US|JA|KO|ZH"), "|", 0)
EndIf
GUICtrlCreateListViewItem($PreferredRegion[1], $LangOption)
GUICtrlCreateListViewItem($PreferredRegion[2], $LangOption)
GUICtrlCreateListViewItem($PreferredRegion[3], $LangOption)
GUICtrlCreateListViewItem($PreferredRegion[4], $LangOption)
GUICtrlCreateListViewItem($PreferredRegion[5], $LangOption)
GUICtrlCreateListViewItem($PreferredRegion[6], $LangOption)
GUICtrlCreateListViewItem($PreferredRegion[7], $LangOption)
GUICtrlCreateListViewItem($PreferredRegion[8], $LangOption)
GUICtrlCreateListViewItem($PreferredRegion[9], $LangOption)
GUICtrlCreateListViewItem($PreferredRegion[10], $LangOption)
GUICtrlCreateListViewItem($PreferredRegion[11], $LangOption)
$LangSave = GUICtrlCreateButton("Save", 10, 290, 125, 25)
GUISetState(@SW_HIDE, $SettingsGui)
$GameInfoGui = GUICreate("", 580, 405, 200, 100, BitAND($GUI_SS_DEFAULT_GUI, BitNOT($WS_MINIMIZEBOX)), BitOR($WS_EX_DLGMODALFRAME, $WS_EX_MDICHILD), $GUI)
;GUISetBkColor(0x91c1ff)
$IDInfo = GUICtrlCreateLabel("ID: ", 10, 25, 60, 25)
$IDGetInfo = GUICtrlCreateInput("", 80, 20, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)
$regionInfo = GUICtrlCreateLabel("Region: ", 10, 50, 60, 25)
$regionGetInfo = GUICtrlCreateInput("", 80, 45, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)
$typeInfo = GUICtrlCreateLabel("Type: ", 10, 75, 60, 25)
$typeGetInfo = GUICtrlCreateInput("", 80, 70, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)
$languagesInfo = GUICtrlCreateLabel("Languages: ", 10, 100, 60, 25)
$languagesGetInfo = GUICtrlCreateInput("", 80, 95, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)
$developerInfo = GUICtrlCreateLabel("Developer: ", 10, 125, 60, 25)
$developerGetInfo = GUICtrlCreateInput("", 80, 120, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)
$publisherInfo = GUICtrlCreateLabel("Publisher: ", 10, 150, 60, 25)
$publisherGetInfo = GUICtrlCreateInput("", 80, 145, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)
$genreInfo = GUICtrlCreateLabel("Genre: ", 10, 175, 60, 25)
$genreGetInfo = GUICtrlCreateInput("", 80, 170, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)
$ratingInfo = GUICtrlCreateLabel("Rating: ", 10, 200, 60, 25)
$ratingGetInfo = GUICtrlCreateInput("", 80, 195, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)
$contentInfo = GUICtrlCreateLabel("Content: ", 10, 225, 60, 25)
$contentGetInfo = GUICtrlCreateInput("", 80, 220, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)
$playersInfo = GUICtrlCreateLabel("Players: ", 10, 250, 60, 25)
$playersGetInfo = GUICtrlCreateInput("", 80, 245, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)
$reqaccessoriesInfo = GUICtrlCreateLabel("Accessories: ", 10, 275, 60, 25)
$reqaccessoriesGetInfo = GUICtrlCreateInput("", 80, 270, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)
$onlineplayersInfo = GUICtrlCreateLabel("Online players: ", 10, 300, 70, 25)
$onlineplayersGetInfo = GUICtrlCreateInput("", 80, 295, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)
$sizeInfo = GUICtrlCreateLabel("Size: ", 10, 325, 60, 18)
$sizeGetInfo = GUICtrlCreateInput("", 80, 320, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)
$titleGame = GUICtrlCreateInput("", 210, 20, 360, 25, $ES_READONLY)
GUICtrlSetFont(-1, 13, 200, 1, "")
$DescripGetInfo = GUICtrlCreateEdit("", 210, 65, 360, 335, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_READONLY)
GUICtrlSetFont(-1, 12, 200, 1, "")
$inputID = GUICtrlCreateLabel("Input:", 10, 350, 50, 18)
$inputGetID = GUICtrlCreateInput("WDMP", 40, 345, 60, 21, $ES_UPPERCASE + $ES_CENTER)
GUICtrlSetLimit(-1, 6)
$Lang = GUICtrlCreateLabel("Languag:", 110, 350, 45, 18)
$LangGet = GUICtrlCreateCombo("", 160, 345, 40, 18)
GUICtrlSetData(-1, "EN|FR|DE|ES|IT|NL|PT", "EN")
$DownloadBTN = GUICtrlCreateButton("Download Infos", 10, 375, 190, 25)
GUISetState(@SW_HIDE, $GameInfoGui)
GUIRegisterMsg($WM_NOTIFY, '_DragListView')
GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
If WinActive($GUI, "") <> 0 Then
Exit
Else
GUISetState(@SW_HIDE, $GameInfoGui)
EndIf
Case $SettingLang
GUISetState(@SW_SHOW, $SettingsGui)
Case $LangSave
Local $Preferred = ""
For $PR = 0 To 10
$Preferred &= "|" & _GUICtrlListView_GetItemText($LangOption, $PR, 0)
Next
IniWrite($ConfigINI, "Conf", "Preferred Region", StringTrimLeft($Preferred, 1))
GUISetState(@SW_HIDE, $SettingsGui)
Case $OpentitleFolder
$Select = _GUICtrlListView_GetSelectedIndices($listview, True)
If $Select[0] > 0 Then
If _GUICtrlListView_GetItemText($listview, $Select[1], 0) <> "" Then
ShellExecute(GUICtrlRead($TitleFolderinput) & "\title\" & _GUICtrlListView_GetItemText($listview, $Select[1], 10) & "\" & _GUICtrlListView_GetItemText($listview, $Select[1], 0))
EndIf
EndIf
Case $Deletetitle
$Select = _GUICtrlListView_GetSelectedIndices($listview, True)
If $Select[0] > 0 Then
If _GUICtrlListView_GetItemText($listview, $Select[1], 0) <> "" Then
If MsgBox(36, "Delete Title", "Are you sure you want to remove : " & _GUICtrlListView_GetItemText($listview, $Select[1], 2) & "!", Default, $GUI) = 6 Then
If WinExists(GUICtrlRead($TitleFolderinput) & "\title\" & _GUICtrlListView_GetItemText($listview, $Select[1], 10) & "\" & _GUICtrlListView_GetItemText($listview, $Select[1], 0)) Then
WinClose(_GUICtrlListView_GetItemText($listview, $Select[1], 0))
EndIf
DirRemove(GUICtrlRead($TitleFolderinput) & "\title\" & _GUICtrlListView_GetItemText($listview, $Select[1], 10) & "\" & _GUICtrlListView_GetItemText($listview, $Select[1], 0), 1)
FileDelete(GUICtrlRead($TitleFolderinput) & "\ticket\" & _GUICtrlListView_GetItemText($listview, $Select[1], 10) & "\" & _GUICtrlListView_GetItemText($listview, $Select[1], 0) & ".tik")
_GUICtrlListView_DeleteItem(GUICtrlGetHandle($listview), $Select[1])
EndIf
EndIf
Else
GUICtrlSetState($OpentitleFolder, $GUI_DISABLE)
GUICtrlSetState($Deletetitle, $GUI_DISABLE)
GUICtrlSetState($GettitleInfo, $GUI_DISABLE)
EndIf
Case $GettitleInfo
GUISetState(@SW_SHOW, $GameInfoGui)
$Select = _GUICtrlListView_GetSelectedIndices($listview, True)
If $Select[0] > 0 Then
If _GUICtrlListView_GetItemText($listview, $Select[1], 0) <> "" Then
GUICtrlSetData($inputGetID, _GUICtrlListView_GetItemText($listview, $Select[1], 1))
EndIf
EndIf
If GUICtrlRead($LangBox) = "US" Or GUICtrlRead($LangBox) = "JA" Or GUICtrlRead($LangBox) = "KO" Or GUICtrlRead($LangBox) = "ZH" Then
GUICtrlSetData($LangGet, "EN")
Else
GUICtrlSetData($LangGet, GUICtrlRead($LangBox))
EndIf
_setInformation()
Case $loadnand
_GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($listview))
$cancelState = 0
_Main()
Case $TitleFolder
Local $path = FileSelectFolder("Choose a folder. (Nand)", @ScriptDir, 1, "", $GUI)
If @[member='error'] <> 1 Then
If StringRegExpReplace($path, "^.*\\(.*)$", "$1") = "Nand" Then
IniWrite($ConfigINI, "Conf", "Nand Path", $path)
$TitleFolderState = 1
_GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($listview))
GUICtrlSetData($TitleFolderinput, $path)
GUICtrlSetState($OpentitleFolder, $GUI_DISABLE)
GUICtrlSetState($Deletetitle, $GUI_DISABLE)
GUICtrlSetState($GettitleInfo, $GUI_DISABLE)
Else
$TitleFolderState = 0
GUICtrlSetData($TitleFolderinput, "")
MsgBox(48, "Wrong folder!", "Navigate to 'Nand' folder (USB\nand)")
EndIf
Else
$TitleFolderState = 0
MsgBox(48, "Wrong folder!", "Navigate to 'Nand' folder (USB\nand)")
EndIf
Case $CoverFolder
_SaveFolder()
Case $LangBox
If FileExists($DataDir & "\title_" & GUICtrlRead($LangBox) & ".ini") = 0 Then
$DownloadtitleSize = InetGetSize("http://www.gametdb.com/titles.txt?LANG=" & GUICtrlRead($LangBox))
$Downloadtitle = InetGet("http://www.gametdb.com/titles.txt?LANG=" & GUICtrlRead($LangBox), $DataDir & "\title_" & GUICtrlRead($LangBox) & ".ini", 1, 1)
Do
$aInfo = InetGetInfo($Downloadtitle)
$iPercent = Round($aInfo[0] / $DownloadtitleSize * 100, 1)
GUICtrlSetData($progress, $iPercent)
GUICtrlSetData($State, "Download " & GUICtrlRead($LangBox) & " title" & StringFormat("%s / %s", $aInfo[0], $DownloadtitleSize))
Until $aInfo[2]
Sleep(250)
If $aInfo[3] Then GUICtrlSetData($progress, 100)
InetClose($Downloadtitle)
EndIf
IniWrite($ConfigINI, "Conf", "Language", GUICtrlRead($LangBox))
Case $CoverTypeBox
IniWrite($ConfigINI, "Conf", "Cover Type", GUICtrlRead($CoverTypeBox))
Case $Initialising
$cancelState = 0
$CountTitle = _GUICtrlListView_GetItemCount($listview) - 1
For $Del = 0 To $CountTitle
_GUICtrlListView_SetItemText($listview, $Del, "", 6)
_GUICtrlListView_SetItemText($listview, $Del, "", 7)
_GUICtrlListView_SetItemText($listview, $Del, "", 8)
_GUICtrlListView_SetItemText($listview, $Del, "", 9)
Next
Local $TotalDownload = 0
For $CnT = 0 To $CountTitle
If $cancelState = 1 Then
$CancellString = "Check downloads"
ExitLoop
EndIf
GetCovers(_GUICtrlListView_GetItemText($listview, $CnT, 1), $CountTitle, $CnT)
Next
Case $StartDownload
Local $TotalDownload = 0, $TotalSize = 0
$cancelState = 0
$CountTitle = _GUICtrlListView_GetItemCount($listview) - 1
Local $TotalDownload = 0
For $CnT = 0 To $CountTitle
If _GUICtrlListView_GetItemText($listview, $CnT, 7) > 0 Then
$TotalSize += _GUICtrlListView_GetItemText($listview, $CnT, 7)
$TotalDownload += 1
EndIf
Next
If GUICtrlRead($CoverTypeBox) = "Full" Then
$TypeDown = "coverfullHQ"
ElseIf GUICtrlRead($CoverTypeBox) = "Front" Then
$TypeDown = "cover"
ElseIf GUICtrlRead($CoverTypeBox) = "3D" Then
$TypeDown = "cover3D"
ElseIf GUICtrlRead($CoverTypeBox) = "Disc" Then
$TypeDown = "disc"; disccustom
EndIf
If MsgBox(4, "Info", "Size of remote files: " & $TotalSize & " Kb" & @CR & "Total Download: " & $TotalDownload & @CR & "Download now?", Default, $GUI) = 6 Then
For $CnT = 0 To $CountTitle
If $cancelState = 1 Then
$CancellString = "Download covers"
ExitLoop
EndIf
If _GUICtrlListView_GetItemText($listview, $CnT, 7) <> 0 Then
Local $CoverUrl = "http://art.gametdb.com/wii/" & $TypeDown & "/" & _GUICtrlListView_GetItemText($listview, $CnT, 6) & "/" & _GUICtrlListView_GetItemText($listview, $CnT, 9) & ".png"
If GUICtrlRead($CoverFolderInput) = "" Then
_SaveFolder()
Else
Local $CoverUrlSaveFile = GUICtrlRead($CoverFolderInput) & "\" & StringLeft(_GUICtrlListView_GetItemText($listview, $CnT, 1), 4) & ".png"
DownloadCovers($CoverUrl, $CoverUrlSaveFile, $CountTitle, $CnT)
EndIf
Else
_GUICtrlListView_SetItemText($listview, $CnT, "****", 8)
EndIf
GUICtrlSetData($progress, $CnT * 100 / $CountTitle)
Next
EndIf
Case $DownloadBTN
_GetAllInfos()
Case $LangGet
_setInformation()
EndSwitch
WEnd
Func _SaveFolder()
Local $SaveFolder = FileSelectFolder("Choose a folder. (Covers)", @ScriptDir, 1)
If @[member='error'] <> 1 Then
$CoverFolderState = 1
GUICtrlSetData($CoverFolderInput, $SaveFolder)
IniWrite($ConfigINI, "Conf", "Covers Path", $SaveFolder)
Else
$CoverFolderState = 0
GUICtrlSetData($CoverFolderInput, "")
EndIf
EndFunc   ;==>_SaveFolder
Func DownloadCovers($LinkCover, $saveCover, $progTota, $ProgPart)
;MsgBox(0,"", $LinkCover & @CR & $saveCover)
$DownloadCoverSize = InetGetSize($LinkCover)
$DownloadCover = InetGet($LinkCover, $saveCover, 1, 1)
Do
$aInfo = InetGetInfo($DownloadCover)
$iPercent = Round($aInfo[0] / $DownloadCoverSize * 100, 1)
_GUICtrlListView_SetItemText($listview, $ProgPart, $iPercent & "%", 8)
Until $aInfo[2]
InetClose($DownloadCover)
GUICtrlSetData($State, "Game N': " & $ProgPart & " / " & $progTota & "	 |	 " & $LinkCover)
EndFunc   ;==>DownloadCovers
Func _Main()
Local $LangDown = GUICtrlRead($LangBox)
Global $FileListNand[1], $FileListNandGameID[1][3], $FileListNandGameALLID[1][2], $DownloadID[1]
If $TitleFolderState = 1 Then
Local $NewNumber = 0
$FileListRead = _FileListToArray($path & "\title", "*", 2)
If @[member='error'] <> 1 Then
ReDim $FileListNand[$FileListRead[0] + 1]
For $Nn = 1 To $FileListRead[0]
If StringLeft($FileListRead[$Nn], 4) = "0001" Then
$FileListNandGame = _FileListToArray($path & "\title\" & $FileListRead[$Nn], "*", 2)
If @[member='error'] <> 1 Then
ReDim $FileListNandGameID[$FileListNandGame[0] + $NewNumber + 1][3]
$FileListNandGameID[0][0] = $NewNumber
For $GI = 1 To $FileListNandGame[0]
$FileListNandGameID[$GI + $NewNumber][0] = $FileListNandGame[$GI]
$FileListNandGameID[$GI + $NewNumber][1] = StringUpper(BinaryToString("0x" & $FileListNandGame[$GI]))
$FileListNandGameID[$GI + $NewNumber][2] = $FileListRead[$Nn]
Next
$NewNumber += $FileListNandGame[0]
EndIf
EndIf
Next
$iNumber = 0
For $iL = 1 To $NewNumber
If $cancelState = 1 Then
$CancellString = "Load nand dump"
ExitLoop
EndIf
_searchGameID($FileListNandGameID[$iL - 1][2], $FileListNandGameID[$iL - 1][0], $FileListNandGameID[$iL - 1][1], $FileListNandGameID[0][0])
Next
If _GUICtrlListView_GetItemCount($listview) > 0 Then
GUICtrlSetState($OpentitleFolder, $GUI_ENABLE)
GUICtrlSetState($Deletetitle, $GUI_ENABLE)
GUICtrlSetState($GettitleInfo, $GUI_ENABLE)
EndIf
EndIf
EndIf
;_ArrayDisplay($FileListNandGameID, "FileList")
EndFunc   ;==>_Main
Func GetCovers($IDToChek, $progTota, $ProgPart)
Local $CoversTitleFound = 0
$LangDown = GUICtrlRead($LangBox)
If GUICtrlRead($CoverTypeBox) = "Full" Then
$TypeDown = "coverfullHQ"
ElseIf GUICtrlRead($CoverTypeBox) = "Front" Then
$TypeDown = "cover"
ElseIf GUICtrlRead($CoverTypeBox) = "3D" Then
$TypeDown = "cover3D"
ElseIf GUICtrlRead($CoverTypeBox) = "Disc" Then
$TypeDown = "disc"; disccustom
EndIf
Local $nSize = InetGetSize("http://art.gametdb.com/wii/" & $TypeDown & "/" & $LangDown & "/" & $IDToChek & ".png")
If @[member='error'] = 0 Then
$TotalDownload += 1
GUICtrlSetData($State, "Game N': " & $ProgPart & " / " & $progTota & "	 |	 http://art.gametdb.com/wii/" & $TypeDown & "/" & $LangDown & "/" & $IDToChek & ".png")
GUICtrlSetData($progress, $ProgPart * 100 / $progTota)
_GUICtrlListView_AddSubItem($listview, $ProgPart, $LangDown, 6, 1)
_GUICtrlListView_AddSubItem($listview, $ProgPart, Round($nSize / 1024), 7, 1)
_GUICtrlListView_AddSubItem($listview, $ProgPart, $IDToChek, 9, 1)
$CoversTitleFound = 1
Else
For $NewL = 0 To 10
$NowStringLang = _GUICtrlListView_GetItemText($LangOption, $NewL, 0)
If $NowStringLang = "EN" Or $NowStringLang = "FR" Or $NowStringLang = "DE" Or $NowStringLang = "ES" Or _
$NowStringLang = "IT" Or $NowStringLang = "NL" Or $NowStringLang = "PT" Then
$RegionID = "P"
ElseIf $NowStringLang = "US" Then
$RegionID = "E"
ElseIf $NowStringLang = "JA" Then
$RegionID = "J"
ElseIf $NowStringLang = "KO" Then
$RegionID = "K"
ElseIf $NowStringLang = "ZH" Then
$RegionID = "W"
EndIf
Local $NewIDREgion = ""
$splitIDToChek = StringSplit($IDToChek, "")
For $SSID = 1 To $splitIDToChek[0]
If $SSID = 4 Then
$NewIDREgion &= $RegionID
Else
$NewIDREgion &= $splitIDToChek[$SSID]
EndIf
Next
Local $nCOVERSSize = InetGetSize("http://art.gametdb.com/wii/" & $TypeDown & "/" & $NowStringLang & "/" & $NewIDREgion & ".png")
If @[member='error'] = 0 Then
$TotalDownload += 1
GUICtrlSetData($progress, $ProgPart * 100 / $progTota)
_GUICtrlListView_AddSubItem($listview, $ProgPart, $NowStringLang, 6, 1)
_GUICtrlListView_AddSubItem($listview, $ProgPart, Round($nCOVERSSize / 1024), 7, 1)
$CoversTitleFound = 1
_GUICtrlListView_AddSubItem($listview, $ProgPart, $NewIDREgion, 9, 1)
ExitLoop
EndIf
;MsgBox(0, "", $NowStringLang)
GUICtrlSetData($State, "Game N': " & $ProgPart & " / " & $progTota & "	 |	 http://art.gametdb.com/wii/" & $TypeDown & "/" & $NowStringLang & "/" & $NewIDREgion & ".png")
Next
If $CoversTitleFound = 0 Then
GUICtrlSetData($State, "Game N': " & $ProgPart & " / " & $progTota & "	 |	 http://art.gametdb.com/wii/" & $TypeDown & "/" & $LangDown & "/" & $IDToChek & ".png")
GUICtrlSetData($progress, $ProgPart * 100 / $progTota)
_GUICtrlListView_AddSubItem($listview, $ProgPart, "Not found", 6, 1)
_GUICtrlListView_AddSubItem($listview, $ProgPart, 0, 7, 1)
_GUICtrlListView_AddSubItem($listview, $ProgPart, $IDToChek, 9, 1)
EndIf
EndIf

EndFunc   ;==>GetCovers

Func _searchGameID($foldernameMain, $foldername, $name_to_search, $iToNumber)
$iNumber += 1
GUICtrlSetData($State, "File N' " & $iNumber & " / " & $iToNumber & "	|	" & "Load: '" & $foldername & " : " & $name_to_search & "'")
$iPercent = Round($iNumber / $iToNumber * 100, 1)
GUICtrlSetData($progress, $iPercent)
$foldernameSize = DirGetSize($path & "\title\" & $foldernameMain & "\" & $foldername)
$foldernameTicketSize = FileGetSize($path & "\ticket\" & $foldernameMain & "\" & $foldername & ".tik")
If $foldernameSize > 0 Then
If FileExists($DataDir & "\title_" & GUICtrlRead($LangBox) & ".ini.") <> 0 Then
Local $hFile = FileOpen($DataDir & "\title_" & GUICtrlRead($LangBox) & ".ini.", 0)
If $hFile <> -1 Then
While True
$searchItem = FileReadLine($hFile)
If @[member='error'] Then ExitLoop
If StringInStr($searchItem, "=") Then
Local $ID_To_search = StringSplit($searchItem, "=", 0)
If StringInStr($ID_To_search[1], $name_to_search) Then
Local $Title_To_search = StringSplit($searchItem, "=", 0)
If StringLeft($Title_To_search[2], 1) = " " Then $Title_To_search[2] = StringTrimLeft($Title_To_search[2], 1)
If StringRight($Title_To_search[1], 1) = " " Then $Title_To_search[1] = StringTrimRight($Title_To_search[1], 1)
$item_count = _GUICtrlListView_GetItemCount($listview)
_GUICtrlListView_AddItem($listview, $foldername, $item_count)
_GUICtrlListView_AddSubItem($listview, $item_count, $Title_To_search[1], 1, 1)
_GUICtrlListView_AddSubItem($listview, $item_count, $Title_To_search[2], 2, 1)
Local $SetGameType = ""
$GetGameType = StringLeft($Title_To_search[1], 1)
If $GetGameType = "W" Then
$SetGameType = "WiiWare"
ElseIf $GetGameType = "N" Then
$SetGameType = "Nintendo64"
ElseIf $GetGameType = "J" Then
$SetGameType = "SNES"
ElseIf $GetGameType = "F" Then
$SetGameType = "NES"
ElseIf $GetGameType = "A" Then
$GetGameType_A = StringLeft($Title_To_search[1], 2)
If $GetGameType_A = "A6" Then
$SetGameType = "Arcade"
ElseIf $GetGameType_A = "A7" Then
$SetGameType = "Arcade-Namco"
Else
$SetGameType = "custom"
EndIf
ElseIf $GetGameType = "P" Then
$SetGameType = "TurboGrafx16"
ElseIf $GetGameType = "Q" Then
$SetGameType = "TurboGrafxCD"
ElseIf $GetGameType = "C" Then
$SetGameType = "Commodore"
ElseIf $GetGameType = "E" Then ;EA
$SetGameType = "NeoGeo"
ElseIf $GetGameType = "M" Then
$SetGameType = "SegaMegaDrive"
ElseIf $GetGameType = "L" Then
$SetGameType = "SegaMasterSystem"
ElseIf $GetGameType = "R" Or $GetGameType = "S" Or $GetGameType = "A" Then
$SetGameType = "Wii"
ElseIf $GetGameType = "G" Or $GetGameType = "D" Then
$SetGameType = "GameCube"
ElseIf $GetGameType = "H" Then
$SetGameType = "General Channel"
ElseIf $GetGameType = "X" Then
$SetGameType = "WiiWare - Demos "
Else
$SetGameType = "custom"
EndIf
_GUICtrlListView_AddSubItem($listview, $item_count, $SetGameType, 3, 1)
_GUICtrlListView_AddSubItem($listview, $item_count, _GetRegion($Title_To_search[1]), 4, 1)
_GUICtrlListView_AddSubItem($listview, $item_count, Round(($foldernameSize + $foldernameTicketSize) / 1024, 2), 5, 1)
_GUICtrlListView_AddSubItem($listview, $item_count, $foldernameMain, 10, 1)
EndIf
EndIf
WEnd
FileClose($hFile)
EndIf
EndIf
EndIf
EndFunc   ;==>_searchGameID
Func _GetRegion($IDFound)
Global $UserSearchRegion = "Unknow"
If StringRight(StringLeft($IDFound, 4), 1) = "A" Then
$UserSearchRegion = "All regions"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "D" Then
$UserSearchRegion = "German-speaking regions"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "E" Then
$UserSearchRegion = "USA"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "F" Then
$UserSearchRegion = "French-speaking regions"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "I" Then
$UserSearchRegion = "Italian-speaking regions"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "J" Then
$UserSearchRegion = "Japan"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "K" Then
$UserSearchRegion = "Korea"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "L" Then
$UserSearchRegion = "Japanese Import to Europe"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "M" Then
$UserSearchRegion = "American Import to Europe"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "N" Then
$UserSearchRegion = "Japanese Import to USA"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "P" Then
$UserSearchRegion = "Europe"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "S" Then
$UserSearchRegion = "Spanish-speaking regions"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "Q" Then
$UserSearchRegion = "Korea with Japanese language"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "T" Then
$UserSearchRegion = "Korea with English language"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "X" Then
$UserSearchRegion = "Not a real region code"
EndIf
Return $UserSearchRegion
EndFunc   ;==>_GetRegion
Func _DragListView($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iwParam
Local Static $iStartIndex = -1, $iEndIndex = -1, $sItemText = "", $fLVDrag = False
Switch $iMsg
Case $WM_MOUSEMOVE
Local $aHit = _GUICtrlListView_HitTest($LangOptionHandle)
If IsArray($aHit) Then _GUICtrlListView_SetItemFocused($LangOptionHandle, $aHit[0])
Case $WM_NOTIFY
Local $tNMHDR, $hWndFrom, $iCode, $iNewItem, $tNMLISTVIEW
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, 'hWndFrom'))
$iCode = DllStructGetData($tNMHDR, 'Code')
Switch $hWndFrom
Case $LangOptionHandle
Switch $iCode
Case $LVN_BEGINDRAG
If Not $fLVDrag Then
$tNMLISTVIEW = DllStructCreate($tagNMLISTVIEW, $ilParam)
$iStartIndex = DllStructGetData($tNMLISTVIEW, 'Item')
$sItemText = _GUICtrlListView_GetItemTextString($LangOptionHandle, $iStartIndex)
$fLVDrag = True
GUIRegisterMsg($WM_MOUSEMOVE, '_DragListView')
EndIf
Case $LVN_HOTTRACK
If $fLVDrag Then
$tNMLISTVIEW = DllStructCreate($tagNMLISTVIEW, $ilParam)
$iEndIndex = DllStructGetData($tNMLISTVIEW, 'Item')
$fLVDrag = False
GUIRegisterMsg($WM_MOUSEMOVE, '')
Select
Case $iStartIndex < $iEndIndex
$iNewItem = _GUICtrlListView_InsertItem($LangOptionHandle, "", $iEndIndex + 1)
_GUICtrlListView_SetItemText($LangOptionHandle, $iNewItem, $sItemText, -1)
_GUICtrlListView_SetItemSelected($LangOptionHandle, $iNewItem, True, True)
_GUICtrlListView_DeleteItem($LangOptionHandle, $iStartIndex)
Case $iStartIndex > $iEndIndex
_GUICtrlListView_DeleteItem($LangOptionHandle, $iStartIndex)
$iNewItem = _GUICtrlListView_InsertItem($LangOptionHandle, "", $iEndIndex)
_GUICtrlListView_SetItemText($LangOptionHandle, $iNewItem, $sItemText, -1)
_GUICtrlListView_SetItemSelected($LangOptionHandle, $iNewItem, True, True)
EndSelect
EndIf
EndSwitch
Case $listviewHandle
Switch $iCode
Case $NM_DBLCLK
If _GUICtrlListView_GetItemCount($listview) > 0 Then
GUISetState(@SW_SHOW, $GameInfoGui)
$Select = _GUICtrlListView_GetSelectedIndices($listview, True)
If $Select[0] > 0 Then
If _GUICtrlListView_GetItemText($listview, $Select[1], 0) <> "" Then
GUICtrlSetData($inputGetID, _GUICtrlListView_GetItemText($listview, $Select[1], 1))
EndIf
EndIf
If GUICtrlRead($LangBox) = "US" Or GUICtrlRead($LangBox) = "JA" Or GUICtrlRead($LangBox) = "KO" Or GUICtrlRead($LangBox) = "ZH" Then
GUICtrlSetData($LangGet, "EN")
Else
GUICtrlSetData($LangGet, GUICtrlRead($LangBox))
EndIf
_setInformation()
EndIf
EndSwitch
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc   ;==>_DragListView
Func _WM_COMMAND($hWnd, $nMsg, $wParam, $lParam)
Local $hButton = GUICtrlGetHandle($Cancel)
Switch $lParam
Case $hButton
$cancelState = 1
GUICtrlSetData($progress, 0)
GUICtrlSetData($State, $CancellString & " : Operation cancelled by user")
EndSwitch
EndFunc   ;==>_WM_COMMAND

Func _GetAllInfos()
$resultRechercher = GUICtrlRead($inputGetID)
$HTML = _HTML_GetSource("http://www.gametdb.com/Wii/" & $resultRechercher)
FileDelete(@TempDir & "\~tmp")
FileWrite(@TempDir & "\~tmp", _HTML_GetText($HTML, "body", "", "id", 0, 12))
;;EN
Strip_desc_title("EN", "FR", $resultRechercher)
;;FR
Strip_desc_title("FR", "DE", $resultRechercher)
;;DE
Strip_desc_title("DE", "ES", $resultRechercher)
;;ES
Strip_desc_title("ES", "IT", $resultRechercher)
;;IT
Strip_desc_title("IT", "NL", $resultRechercher)
;;NL
Strip_desc_title("NL", "developer", $resultRechercher)
;;
Strip_desc_title("PT", "developer", $resultRechercher)
Start_Strip_MoreInfo($resultRechercher)
$Title_read = IniRead($DataDir & "\Multi.ini", $resultRechercher & "_" & GUICtrlRead($LangGet), "Title_" & $resultRechercher, "")
GUICtrlSetData($titleGame, $Title_read)
$descr_read = IniRead($DataDir & "\Multi.ini", $resultRechercher & "_" & GUICtrlRead($LangGet), "Descri", "")
$descr_read = StringReplace($descr_read, "@CRLF", @CRLF)
GUICtrlSetData($DescripGetInfo, $descr_read)
FileDelete(@TempDir & "\~tmp")
EndFunc   ;==>_GetAllInfos
Func Start_Strip_MoreInfo($resultRechercher)
$AsplitID = ''
$Asplitregion = ''
$Asplittype = ''
$Asplitlanguages = ''
$Asplitdeveloper = ''
$Asplitpublisher = ''
$Asplitgenre = ''
$Asplitrating = ''
$Asplitcontent = ''
$Asplitplayers = ''
$Asplitreqaccesso = ''
$Asplitreqaccessories = ''
$Asplitonlineplayers = ''
$Asplitsize = ''
;ID getinfo
$IDInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), 'Next' & @CRLF & 'ID', 'region')
If Not @[member='error'] And IsArray($IDInfoDownload) Then
$AsplitID = _ArrayToString($IDInfoDownload)
GUICtrlSetData($IDGetInfo, StringReplace($AsplitID, @CRLF, ''))
Else
GUICtrlSetData($IDGetInfo, "")
EndIf
IniWrite($DataDir & "\Multi.ini", $resultRechercher, "ID", StringReplace($AsplitID, @CRLF, ""))
;Region getinfo
$regionInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'region', 'type')
If Not @[member='error'] And IsArray($regionInfoDownload) Then
$Asplitregion = _ArrayToString($regionInfoDownload)
GUICtrlSetData($regionGetInfo, StringReplace($Asplitregion, @CRLF, ''))
Else
GUICtrlSetData($regionGetInfo, "")
EndIf
IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Region", StringReplace($Asplitregion, @CRLF, ""))
;type getinfo
$typeInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'type', 'languages')
If Not @[member='error'] And IsArray($typeInfoDownload) Then
$Asplittype = _ArrayToString($typeInfoDownload)
GUICtrlSetData($typeGetInfo, StringReplace($Asplittype, @CRLF, ''))
Else
GUICtrlSetData($typeGetInfo, "")
EndIf
IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Type", StringReplace($Asplittype, @CRLF, ""))
;type getinfo
$languagesInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'languages', 'title (EN)')
If Not @[member='error'] And IsArray($languagesInfoDownload) Then
$Asplitlanguages = _ArrayToString($languagesInfoDownload)
GUICtrlSetData($languagesGetInfo, StringReplace($Asplitlanguages, @CRLF, ''))
Else
GUICtrlSetData($languagesGetInfo, "")
EndIf
IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Languages", StringReplace($Asplitlanguages, @CRLF, ""))
;developer getinfo
$developerInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'developer', 'publisher')
If Not @[member='error'] And IsArray($developerInfoDownload) Then
$Asplitdeveloper = _ArrayToString($developerInfoDownload)
GUICtrlSetData($developerGetInfo, StringReplace($Asplitdeveloper, @CRLF, ''))
Else
GUICtrlSetData($developerGetInfo, "")
EndIf
IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Developer", StringReplace($Asplitdeveloper, @CRLF, ""))
;publisher getinfo
$publisherInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'publisher', 'release date')
If Not @[member='error'] And IsArray($publisherInfoDownload) Then
$Asplitpublisher = _ArrayToString($publisherInfoDownload)
GUICtrlSetData($publisherGetInfo, StringReplace($Asplitpublisher, @CRLF, ''))
Else
GUICtrlSetData($publisherGetInfo, "")
EndIf
IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Publisher", StringReplace($Asplitpublisher, @CRLF, ""))
;genre getinfo
$genreInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'genre', 'rating')
If Not @[member='error'] And IsArray($genreInfoDownload) Then
$Asplitgenre = _ArrayToString($genreInfoDownload)
GUICtrlSetData($genreGetInfo, StringReplace($Asplitgenre, @CRLF, ''))
Else
GUICtrlSetData($genreGetInfo, "")
EndIf
IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Genre", StringReplace($Asplitgenre, @CRLF, ""))
;rating getinfo
$ratingInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'rating', 'players')
If Not @[member='error'] And IsArray($ratingInfoDownload) Then
$Asplitrating = _ArrayToString($ratingInfoDownload)
If StringInStr($Asplitrating, "content") Then
$ratingInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'rating', 'content')
If Not @[member='error'] And IsArray($ratingInfoDownload) Then
$Asplitrating = _ArrayToString($ratingInfoDownload)
EndIf
EndIf
GUICtrlSetData($ratingGetInfo, StringReplace($Asplitrating, @CRLF, ''))
Else
GUICtrlSetData($ratingGetInfo, "")
EndIf
IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Rating", StringReplace($Asplitrating, @CRLF, ""))
;content GetInfo
$contentInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'content descriptors', 'players')
If Not @[member='error'] And IsArray($contentInfoDownload) Then
$Asplitcontent = _ArrayToString($contentInfoDownload)
GUICtrlSetData($contentGetInfo, StringReplace($Asplitcontent, @CRLF, ''))
Else
GUICtrlSetData($contentGetInfo, "")
EndIf
IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Content", StringReplace($Asplitcontent, @CRLF, ""))
;players getinfo
$playersInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'players', 'req. accessories')
If Not @[member='error'] And IsArray($playersInfoDownload) Then
$Asplitplayers = _ArrayToString($playersInfoDownload)
GUICtrlSetData($playersGetInfo, StringReplace($Asplitplayers, @CRLF, ''))
Else
GUICtrlSetData($playersGetInfo, "")
EndIf
IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Players", StringReplace($Asplitplayers, @CRLF, ""))
;reqaccessories getinfo
$reqaccessoriesInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'req. accessories', 'online players')
If Not @[member='error'] And IsArray($reqaccessoriesInfoDownload) Then
$Asplitreqaccesso = _ArrayToString($reqaccessoriesInfoDownload)
$Asplitreqaccessories = StringReplace($Asplitreqaccesso, "accessories", " ")
GUICtrlSetData($reqaccessoriesGetInfo, StringReplace($Asplitreqaccessories, @CRLF, ''))
Else
GUICtrlSetData($reqaccessoriesGetInfo, "")
EndIf
IniWrite($DataDir & "\Multi.ini", $resultRechercher, "ReqAccessories", StringReplace($Asplitreqaccessories, @CRLF, ""))
;onlineplayers getinfo
$onlineplayersInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'online players', 'online features')
If Not @[member='error'] And IsArray($onlineplayersInfoDownload) Then
$Asplitonlineplayers = _ArrayToString($onlineplayersInfoDownload)
GUICtrlSetData($onlineplayersGetInfo, StringReplace($Asplitonlineplayers, @CRLF, ''))
Else
GUICtrlSetData($onlineplayersGetInfo, "")
EndIf
IniWrite($DataDir & "\Multi.ini", $resultRechercher, "OnlinePlayers", StringReplace($Asplitonlineplayers, @CRLF, ""))
;size getinfo
$sizeInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'size', 'crc')
If Not @[member='error'] And IsArray($sizeInfoDownload) Then
$Asplitsi = _ArrayToString($sizeInfoDownload)
$Asplitsize = $Asplitsi / 1048576
GUICtrlSetData($sizeGetInfo, StringReplace($Asplitsize, @CRLF, '') & " MB")
Else
GUICtrlSetData($sizeGetInfo, "")
EndIf
IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Size", StringReplace($Asplitsize, @CRLF, "") & " MB")
EndFunc   ;==>Start_Strip_MoreInfo
Func Strip_desc_title($1, $2, $resultRechercher)
If Not @[member='error'] Then
$DescreptionTitle = _StringBetween(FileRead(@TempDir & "\~tmp"), 'title (' & $1 & ')', 'synopsis (' & $1 & ')')
If Not @[member='error'] And IsArray($DescreptionTitle) Then
$Asplittitle = _ArrayToString($DescreptionTitle)
Else
$DescreptionTitle = _StringBetween(FileRead(@TempDir & "\~tmp"), 'title (' & $1 & ')', 'developer')
If Not @[member='error'] And IsArray($DescreptionTitle) Then
$Asplittitle = _ArrayToString($DescreptionTitle)
If StringInStr($Asplittitle, "title (EN)") Then
$DescreptionTitle = _StringBetween(FileRead(@TempDir & "\~tmp"), 'title (' & $1 & ')', 'title (EN)')
If Not @[member='error'] And IsArray($DescreptionTitle) Then
$Asplittitle = _ArrayToString($DescreptionTitle)
EndIf
EndIf
If StringInStr($Asplittitle, "title (FR)") Then
$DescreptionTitle = _StringBetween(FileRead(@TempDir & "\~tmp"), 'title (' & $1 & ')', 'title (FR)')
If Not @[member='error'] And IsArray($DescreptionTitle) Then
$Asplittitle = _ArrayToString($DescreptionTitle)
EndIf
EndIf
If StringInStr($Asplittitle, "title (DE)") Then
$DescreptionTitle = _StringBetween(FileRead(@TempDir & "\~tmp"), 'title (' & $1 & ')', 'title (DE)')
If Not @[member='error'] And IsArray($DescreptionTitle) Then
$Asplittitle = _ArrayToString($DescreptionTitle)
EndIf
EndIf
If StringInStr($Asplittitle, "title (ES)") Then
$DescreptionTitle = _StringBetween(FileRead(@TempDir & "\~tmp"), 'title (' & $1 & ')', 'title (ES)')
If Not @[member='error'] And IsArray($DescreptionTitle) Then
$Asplittitle = _ArrayToString($DescreptionTitle)
EndIf
EndIf
If StringInStr($Asplittitle, "title (IT)") Then
$DescreptionTitle = _StringBetween(FileRead(@TempDir & "\~tmp"), 'title (' & $1 & ')', 'title (IT)')
If Not @[member='error'] And IsArray($DescreptionTitle) Then
$Asplittitle = _ArrayToString($DescreptionTitle)
EndIf
EndIf
If StringInStr($Asplittitle, "title (NL)") Then
$DescreptionTitle = _StringBetween(FileRead(@TempDir & "\~tmp"), 'title (' & $1 & ')', 'title (NL)')
If Not @[member='error'] And IsArray($DescreptionTitle) Then
$Asplittitle = _ArrayToString($DescreptionTitle)
EndIf
EndIf
If StringInStr($Asplittitle, "title (PT)") Then
$DescreptionTitle = _StringBetween(FileRead(@TempDir & "\~tmp"), 'title (' & $1 & ')', 'title (PT)')
If Not @[member='error'] And IsArray($DescreptionTitle) Then
$Asplittitle = _ArrayToString($DescreptionTitle)
EndIf
EndIf
Else
$Asplittitle = "No Title Found"
EndIf
EndIf
IniWrite($DataDir & "\Multi.ini", $resultRechercher & "_" & $1, "Title_" & $resultRechercher, StringReplace($Asplittitle, @CRLF, ""))
$Descreption = _StringBetween(FileRead(@TempDir & "\~tmp"), 'synopsis (' & $1 & ')', 'title (' & $2 & ')')
If Not @[member='error'] And IsArray($Descreption) Then
$AsplitDescr = _ArrayToString($Descreption)
Else
$Descreption = _StringBetween(FileRead(@TempDir & "\~tmp"), 'synopsis (' & $1 & ')', 'developer')
If Not @[member='error'] And IsArray($Descreption) Then
$AsplitDescr = _ArrayToString($Descreption)
If StringInStr($AsplitDescr, "title (ZHCN") Then
$Descreption = _StringBetween(FileRead(@TempDir & "\~tmp"), 'synopsis (' & $1 & ')', 'title (ZHCN')
If Not @[member='error'] And IsArray($Descreption) Then
$AsplitDescr = _ArrayToString($Descreption)
EndIf
EndIf
If StringInStr($AsplitDescr, "title (ZHTW") Then
$Descreption = _StringBetween(FileRead(@TempDir & "\~tmp"), 'synopsis (' & $1 & ')', 'title (ZHTW')
If Not @[member='error'] And IsArray($Descreption) Then
$AsplitDescr = _ArrayToString($Descreption)
EndIf
EndIf
If StringInStr($AsplitDescr, "title (FR)") Then
$Descreption = _StringBetween(FileRead(@TempDir & "\~tmp"), 'synopsis (' & $1 & ')', 'title (FR)')
If Not @[member='error'] And IsArray($Descreption) Then
$AsplitDescr = _ArrayToString($Descreption)
EndIf
EndIf
If StringInStr($AsplitDescr, "title (DE)") Then
$Descreption = _StringBetween(FileRead(@TempDir & "\~tmp"), 'synopsis (' & $1 & ')', 'title (DE)')
If Not @[member='error'] And IsArray($Descreption) Then
$AsplitDescr = _ArrayToString($Descreption)
EndIf
EndIf
If StringInStr($AsplitDescr, "title (ES)") Then
$Descreption = _StringBetween(FileRead(@TempDir & "\~tmp"), 'synopsis (' & $1 & ')', 'title (ES)')
If Not @[member='error'] And IsArray($Descreption) Then
$AsplitDescr = _ArrayToString($Descreption)
EndIf
EndIf
If StringInStr($AsplitDescr, "title (IT)") Then
$Descreption = _StringBetween(FileRead(@TempDir & "\~tmp"), 'synopsis (' & $1 & ')', 'title (IT)')
If Not @[member='error'] And IsArray($Descreption) Then
$AsplitDescr = _ArrayToString($Descreption)
EndIf
EndIf
If StringInStr($AsplitDescr, "title (PT)") Then
$Descreption = _StringBetween(FileRead(@TempDir & "\~tmp"), 'synopsis (' & $1 & ')', 'title (PT)')
If Not @[member='error'] And IsArray($Descreption) Then
$AsplitDescr = _ArrayToString($Descreption)
EndIf
EndIf
Else
$AsplitDescr = "No Description Found"
EndIf
EndIf
IniWrite($DataDir & "\Multi.ini", $resultRechercher & "_" & $1, "Descri", StringReplace($AsplitDescr, @CRLF, "@CRLF"))
IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Downloaded at", 'Downloaded at ' & @HOUR & ':' & @[member='Min'] & " " & @[member='Mday'] & '-' & @MON & '-' & @YEAR & @CRLF)
EndIf
EndFunc   ;==>Strip_desc_title
Func _setInformation()
$resultRechercher = GUICtrlRead($inputGetID)
GUICtrlSetData($titleGame, IniRead($DataDir & "\Multi.ini", $resultRechercher & "_" & GUICtrlRead($LangGet), "Title_" & $resultRechercher, ""))
GUICtrlSetData($DescripGetInfo, StringReplace(IniRead($DataDir & "\Multi.ini", $resultRechercher & "_" & GUICtrlRead($LangGet), "Descri", ""), "@CRLF", @CRLF))
GUICtrlSetData($IDGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "ID", ""))
GUICtrlSetData($regionGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "Region", ""))
GUICtrlSetData($typeGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "Type", ""))
GUICtrlSetData($languagesGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "Languages", ""))
GUICtrlSetData($developerGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "Developer", ""))
GUICtrlSetData($publisherGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "Publisher", ""))
GUICtrlSetData($genreGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "Genre", ""))
GUICtrlSetData($ratingGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "Rating", ""))
GUICtrlSetData($contentGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "Content", ""))
GUICtrlSetData($playersGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "Players", ""))
GUICtrlSetData($reqaccessoriesGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "ReqAccessories", ""))
GUICtrlSetData($onlineplayersGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "OnlinePlayers", ""))
GUICtrlSetData($sizeGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "Size", ""))
EndFunc   ;==>_setInformation
; _HTML_GetText / _HTML_GetSource / __HTML_Filter created by Thorsten Willert
Func _HTML_GetSource($sURL)
Local $sHTML = InetRead($sURL, 1)
If @[member='error'] Then Return SetError(@[member='error'], @extended, "")
$sHTML = BinaryToString($sHTML)
$sHTML = StringRegExpReplace($sHTML, '[\r\n\t]', " ")
$sHTML = StringRegExpReplace($sHTML, '(?i)<script.*?>.*?</script>', "")
Return $sHTML
EndFunc   ;==>_HTML_GetSource
Func _HTML_GetText($sHTML, $sTag, $sValue = "", $sAttribute = "id", $iIndex = 0, $iFilter = 30)
Local $sE1
If $sValue And $sAttribute Then
$iIndex = $iIndex * 2 + 1
$sE1 = '(?i)<' & $sTag & '\s+.*?' & $sAttribute & '\s*=\s*("|''|)' & __HTML_Search($sValue) & '\1.*?>(.*?)</' & $sTag & '>'
Else
$sE1 = '(?i)<' & $sTag & '.*?>(.*?)</' & $sTag & '>'
EndIf
ConsoleWrite("_HTML_GetText: " & $sE1 & @CRLF)
Local $r = StringRegExp($sHTML, $sE1, 3)
If @[member='error'] = 2 Then
ConsoleWriteError("_HTML_GetText: Error in expression: " & $sE1 & @CRLF)
Return SetError(1, 0, "")
EndIf
Local $iE = UBound($r)
If $iE = 0 Or $iIndex >= $iE Then Return SetError(1, 0, "")
If $iFilter Then __HTML_Filter($r[$iIndex], $iFilter)
Return $r[$iIndex]
EndFunc   ;==>_HTML_GetText
Func __HTML_Filter(ByRef $sString, $iMode = 0)
If $iMode = 0 Then Return $sString
;16 simple HTML tag / entities converter
If $iMode >= 16 And $iMode < 32 Then
Local $aEntities[96][2] = [["&quot;", 34],["&amp;", 38],["&lt;", 60],["&gt;", 62],[" ", 3],[" ", 32] _
,["&#161;", 161],["&#162;", 162],["&#163;", 163],["&#164;", 164],["&#165;", 165],["&#166;", 166] _
,["&#167;", 167],["&#168;", 168],["&#169;", 169],["&#170;", 170],["&#172;", 172],["&#173;", 173] _
,["&#174;", 174],["&#175;", 175],["&#176;", 176],["&#177;", 177],["&#178;", 178],["&#179;", 179] _
,["&#180;", 180],["&#181;", 181],["&#182;", 182],["&#183;", 183],["&#184;", 184],["&#185;", 185] _
,["&#186;", 186],["&#187;", 187],["&#188;", 188],["&#189;", 189],["&#190;", 190],["&#191;", 191] _
,["&#192;", 192],["&#193;", 193],["&#195;", 195],["&#196;", 196],["&#197;", 197],["&#198;", 198] _
,["&#199;", 199],["&#200;", 200],["&#201;", 201],["&#202;", 202],["&#204;", 204],["&#205;", 205] _
,["&#206;", 206],["&#207;", 207],["&#208;", 208],["&#209;", 209],["&#210;", 210],["&#211;", 211] _
,["&#212;", 212],["&#213;", 213],["&#214;", 214],["&#215;", 215],["&#216;", 216],["&#217;", 217] _
,["&#218;", 218],["&#219;", 219],["&#220;", 220],["&#221;", 221],["&#222;", 222],["&#223;", 223] _
,["&#224;", 224],["&#225;", 225],["&#226;", 226],["&#227;", 227],["&#228;", 228],["&#229;", 229] _
,["&#230;", 230],["&#231;", 231],["&#232;", 232],["&#233;", 233],["&#234;", 234],["&#235;", 235] _
,["&#236;", 236],["&#237;", 237],["&#238;", 238],["&#239;", 239],["&#240;", 240],["&#241;", 241] _
,["&#242;", 242],["&#243;", 243],["&#244;", 244],["&#245;", 245],["&#246;", 246],["&#247;", 247] _
,["&#248;", 248],["&#249;", 249],["&#250;", 250],["&#251;", 251],["&#252;", 252],["&#254;", 254]]
$sString = StringRegExpReplace($sString, '(?i)<p.*?>', @CRLF & @CRLF)
$sString = StringRegExpReplace($sString, '(?i)<br>', @CRLF)
Local $iE = UBound($aEntities) - 1
For $x = 0 To $iE
$sString = StringReplace($sString, $aEntities[$x][0], Chr($aEntities[$x][1]), 0, 2)
Next
For $x = 32 To 255
$sString = StringReplace($sString, "&#" & $x & ";", Chr($x))
Next
$iMode -= 16
EndIf
;8 Tag filter
If $iMode >= 8 And $iMode < 16 Then
;$sString = StringRegExpReplace($sString, '<script.*?>.*?</script>', "")
$sString = StringRegExpReplace($sString, "<[^>]*>", @CRLF)
$iMode -= 8
EndIf
; 4 remove all double cr, lf
If $iMode >= 4 And $iMode < 8 Then
$sString = StringRegExpReplace($sString, "([ \t]*[\n\r]+[ \t]*)", @CRLF)
$sString = StringRegExpReplace($sString, "[\n\r]+", @CRLF)
$iMode -= 4
EndIf
; 2 remove all double withespaces
If $iMode = 2 Or $iMode = 3 Then
$sString = StringRegExpReplace($sString, "[[:blank:]]+", " ")
$sString = StringRegExpReplace($sString, "\n[[:blank:]]+", @CRLF)
$sString = StringRegExpReplace($sString, "[[:blank:]]+\n", "")
$iMode -= 2
EndIf
; 1 remove all non ASCII
If $iMode = 1 Then
$sString = StringRegExpReplace($sString, "[^\x00-\x7F]", " ")
EndIf
Return $sString
EndFunc   ;==>__HTML_Filter
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BakerMan
    The snack that smiles back, Ballsack!
  • Veho @ Veho:
    I thought it was an actual xBox at that price.
  • Sicklyboy @ Sicklyboy:
    I wanna grab a 360 Slim and a 360 E one of these days. Missed the boat of getting them at their lowest though, once they were discontinued. Could've got them for cheap back when I was a broke 20 something working at Target, but then again, I was a broke 20 something working at Target
  • Veho @ Veho:
    Being broke is no fun.
  • K3Nv2 @ K3Nv2:
    @Sicklyboy, $150 isn't that bad for a jtag slim on ebay
  • Veho @ Veho:
    I only wish it was actually playable.
  • Veho @ Veho:
    There's a guy on the Tube of You that makes playable mechanical arcade games out of Lego. This could work on the same principle.
  • Veho @ Veho:
    Just a couple of guys taking their manatee out for some fresh air, why you have to molest them?
  • Veho @ Veho:
    Stupid Chinese shop switched their shipping company and this one is slooooooow.
  • LeoTCK @ LeoTCK:
    STOP BUYING CHINESE CRAP THEN
  • LeoTCK @ LeoTCK:
    SUPPORT LOCAL PRODUCTS, MAKE REVOLUTION
  • LeoTCK @ LeoTCK:
    THEY KEEP REMOVING LOCAL SHIt AND REPLACING WItH INFERIOR CHINESE CRAP
  • LeoTCK @ LeoTCK:
    THATS WHY MY PARTNER CANT GET A GOOTWEAR HIS SIZE ANYMORE
  • LeoTCK @ LeoTCK:
    HE HAS BIG FOOT AND BIG DUCK
  • LeoTCK @ LeoTCK:
    d*ck i mean*
  • LeoTCK @ LeoTCK:
    lol
  • Veho @ Veho:
    Mkay.
  • Veho @ Veho:
    I just ordered another package from China just to spite you.
  • SylverReZ @ SylverReZ:
    Communism lol
  • SylverReZ @ SylverReZ:
    OUR products
  • The Real Jdbye @ The Real Jdbye:
    @LeoTCK actually good quality products are dying out because they can't compete with dropshipped chinese crap
    +1
  • BakerMan @ BakerMan:
    @LeoTCK is your partner the sascrotch or smth?
    BakerMan @ BakerMan: @LeoTCK is your partner the sascrotch or smth?