Code : Tout sélectionner
#include <File.au3>
#include <GuiConstants.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiEdit.au3>
#Include <GuiButton.au3>
Dim $word[99][9999]
$Form2 = GUICreate("Vos lettres", 640, 300, -1, -1)
GUICtrlCreateLabel("2 lettres", 27, 40)
GUICtrlCreateLabel("3 lettres", 117, 40)
GUICtrlCreateLabel("4 lettres", 207, 40)
GUICtrlCreateLabel("5 lettres", 297, 40)
GUICtrlCreateLabel("6 lettres", 387, 40)
GUICtrlCreateLabel("7 lettres", 477, 40)
GUICtrlCreateLabel("8 lettres", 567, 40)
$2lettres=GUICtrlCreateEdit("", 10, 60, 80, 180, BitOR($ES_READONLY, $ES_AUTOVSCROLL, $WS_VSCROLL))
$3lettres=GUICtrlCreateEdit("", 100, 60, 80, 180, BitOR($ES_READONLY, $ES_AUTOVSCROLL, $WS_VSCROLL))
$4lettres=GUICtrlCreateEdit("", 190, 60, 80, 180, BitOR($ES_READONLY, $ES_AUTOVSCROLL, $WS_VSCROLL))
$5lettres=GUICtrlCreateEdit("", 280, 60, 80, 180, BitOR($ES_READONLY, $ES_AUTOVSCROLL, $WS_VSCROLL))
$6lettres=GUICtrlCreateEdit("", 370, 60, 80, 180, BitOR($ES_READONLY, $ES_AUTOVSCROLL, $WS_VSCROLL))
$7lettres=GUICtrlCreateEdit("", 460, 60, 80, 180, BitOR($ES_READONLY, $ES_AUTOVSCROLL, $WS_VSCROLL))
$8lettres=GUICtrlCreateEdit("", 550, 60, 80, 180, BitOR($ES_READONLY, $ES_AUTOVSCROLL, $WS_VSCROLL))
GUICtrlSetBkColor($2lettres, 0xffffff)
GUICtrlSetBkColor($3lettres, 0xffffff)
GUICtrlSetBkColor($4lettres, 0xffffff)
GUICtrlSetBkColor($5lettres, 0xffffff)
GUICtrlSetBkColor($6lettres, 0xffffff)
GUICtrlSetBkColor($7lettres, 0xffffff)
GUICtrlSetBkColor($8lettres, 0xffffff)
$Lettres2=GUICtrlCreateInput("", 10, 10, 145, 20)
$Rechercher=GUICtrlCreateButton("Rechercher", 160, 9, 70, 22, $BS_DEFPUSHBUTTON )
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Rechercher
$lettres = GUICtrlRead($Lettres2)
GUICtrlSetData($2lettres, "")
GUICtrlSetData($3lettres, "")
GUICtrlSetData($4lettres, "")
GUICtrlSetData($5lettres, "")
GUICtrlSetData($6lettres, "")
GUICtrlSetData($7lettres, "")
GUICtrlSetData($8lettres, "")
_2lettres()
EndSwitch
WEnd
Func _2lettres()
$pathfile = 'resultat.txt'
$pathresultat = 'resultats.txt'
InetGet('http://www.kurokatta.org/hacks/scarab-fr?q='&$lettres, $pathfile)
$Read=String(FileRead($pathfile))
$split=StringSplit($read, "<dt>2 lettres</dt>",1)
If @error Then Return
FileDelete($pathfile)
FileDelete($pathresultat)
$split=StringSplit($split[2], "Calcul", 1)
$split=StringSplit($split[1], "<dt>3 lettres</dt>", 1)
$Rpl=StringReplace($Split[1], "<dd>", "")
$Rpl=StringReplace($Rpl, "</dd>", "")
$Rpl=StringReplace($Rpl, "<dl>", "")
$Rpl=StringReplace($Rpl, "</dl>", "")
$Rpl=StringReplace($Rpl, "<dt>", "")
$Rpl=StringReplace($Rpl, "</dt>", "")
$Rpl=StringReplace($Rpl, "<p>", "")
$Rpl=StringReplace($Rpl, Chr(10), "")
$Rpl=StringReplace($Rpl, ",", @CRLF)
$Rpl=StringReplace($Rpl, " ", "")
GUICtrlSetData($2lettres, $Rpl)
FileWrite($pathresultat, $rpl)
$line=_FileCountLines($pathresultat)
For $i=1 To $line
$word[2][$i]=FileReadLine($pathresultat, $i)
;~ ConsoleWrite("$word[2][" & $i & "] = " & FileReadLine($pathresultat, $i) & @CRLF)
Next
FileDelete($pathresultat)
_3lettres()
EndFunc
Func _3lettres()
$pathfile = 'resultat.txt'
$pathresultat = 'resultats.txt'
InetGet('http://www.kurokatta.org/hacks/scarab-fr?q='&$lettres, $pathfile)
$Read=String(FileRead($pathfile))
$split=StringSplit($read, "<dt>3 lettres</dt>",1)
If @error Then Return
FileDelete($pathfile)
FileDelete($pathresultat)
$split=StringSplit($split[2], "Calcul", 1)
$split=StringSplit($split[1], "<dt>4 lettres</dt>", 1)
$Rpl=StringReplace($Split[1], "<dd>", "")
$Rpl=StringReplace($Rpl, "</dd>", "")
$Rpl=StringReplace($Rpl, "<dl>", "")
$Rpl=StringReplace($Rpl, "</dl>", "")
$Rpl=StringReplace($Rpl, "<dt>", "")
$Rpl=StringReplace($Rpl, "</dt>", "")
$Rpl=StringReplace($Rpl, "<p>", "")
$Rpl=StringReplace($Rpl, Chr(10), "")
$Rpl=StringReplace($Rpl, ",", @CRLF)
$Rpl=StringReplace($Rpl, " ", "")
GUICtrlSetData($3lettres, $Rpl)
FileWrite($pathresultat, $rpl)
$line=_FileCountLines($pathresultat)
For $i=1 To $line
$word[3][$i]=FileReadLine($pathresultat, $i)
;~ ConsoleWrite("$word[3][" & $i & "] = " & FileReadLine($pathresultat, $i) & @CRLF)
Next
FileDelete($pathresultat)
_4lettres()
EndFunc
Func _4lettres()
$pathfile = 'resultat.txt'
$pathresultat = 'resultats.txt'
InetGet('http://www.kurokatta.org/hacks/scarab-fr?q='&$lettres, $pathfile)
$Read=String(FileRead($pathfile))
$split=StringSplit($read, "<dt>4 lettres</dt>",1)
If @error Then Return
FileDelete($pathfile)
FileDelete($pathresultat)
$split=StringSplit($split[2], "Calcul", 1)
$split=StringSplit($split[1], "<dt>5 lettres</dt>", 1)
$Rpl=StringReplace($Split[1], "<dd>", "")
$Rpl=StringReplace($Rpl, "</dd>", "")
$Rpl=StringReplace($Rpl, "<dl>", "")
$Rpl=StringReplace($Rpl, "</dl>", "")
$Rpl=StringReplace($Rpl, "<dt>", "")
$Rpl=StringReplace($Rpl, "</dt>", "")
$Rpl=StringReplace($Rpl, "<p>", "")
$Rpl=StringReplace($Rpl, Chr(10), "")
$Rpl=StringReplace($Rpl, ",", @CRLF)
$Rpl=StringReplace($Rpl, " ", "")
GUICtrlSetData($4lettres, $Rpl)
FileWrite($pathresultat, $rpl)
$line=_FileCountLines($pathresultat)
For $i=1 To $line
$word[4][$i]=FileReadLine($pathresultat, $i)
;~ ConsoleWrite("$word[4][" & $i & "] = " & FileReadLine($pathresultat, $i) & @CRLF)
Next
FileDelete($pathresultat)
_5lettres()
EndFunc
Func _5lettres()
$pathfile = 'resultat.txt'
$pathresultat = 'resultats.txt'
InetGet('http://www.kurokatta.org/hacks/scarab-fr?q='&$lettres, $pathfile)
$Read=String(FileRead($pathfile))
$split=StringSplit($read, "<dt>5 lettres</dt>",1)
If @error Then Return
FileDelete($pathfile)
FileDelete($pathresultat)
$split=StringSplit($split[2], "Calcul", 1)
$split=StringSplit($split[1], "<dt>6 lettres</dt>", 1)
$Rpl=StringReplace($Split[1], "<dd>", "")
$Rpl=StringReplace($Rpl, "</dd>", "")
$Rpl=StringReplace($Rpl, "<dl>", "")
$Rpl=StringReplace($Rpl, "</dl>", "")
$Rpl=StringReplace($Rpl, "<dt>", "")
$Rpl=StringReplace($Rpl, "</dt>", "")
$Rpl=StringReplace($Rpl, "<p>", "")
$Rpl=StringReplace($Rpl, Chr(10), "")
$Rpl=StringReplace($Rpl, ",", @CRLF)
$Rpl=StringReplace($Rpl, " ", "")
GUICtrlSetData($5lettres, $Rpl)
FileWrite($pathresultat, $rpl)
$line=_FileCountLines($pathresultat)
For $i=1 To $line
$word[5][$i]=FileReadLine($pathresultat, $i)
;~ ConsoleWrite("$word[5][" & $i & "] = " & FileReadLine($pathresultat, $i) & @CRLF)
Next
FileDelete($pathresultat)
_6lettres()
EndFunc
Func _6lettres()
$pathfile = 'resultat.txt'
$pathresultat = 'resultats.txt'
InetGet('http://www.kurokatta.org/hacks/scarab-fr?q='&$lettres, $pathfile)
$Read=String(FileRead($pathfile))
$split=StringSplit($read, "<dt>6 lettres</dt>",1)
If @error Then Return
FileDelete($pathfile)
FileDelete($pathresultat)
$split=StringSplit($split[2], "Calcul", 1)
$split=StringSplit($split[1], "<dt>7 lettres</dt>", 1)
$Rpl=StringReplace($Split[1], "<dd>", "")
$Rpl=StringReplace($Rpl, "</dd>", "")
$Rpl=StringReplace($Rpl, "<dl>", "")
$Rpl=StringReplace($Rpl, "</dl>", "")
$Rpl=StringReplace($Rpl, "<dt>", "")
$Rpl=StringReplace($Rpl, "</dt>", "")
$Rpl=StringReplace($Rpl, "<p>", "")
$Rpl=StringReplace($Rpl, Chr(10), "")
$Rpl=StringReplace($Rpl, ",", @CRLF)
$Rpl=StringReplace($Rpl, " ", "")
GUICtrlSetData($6lettres, $Rpl)
FileWrite($pathresultat, $rpl)
$line=_FileCountLines($pathresultat)
For $i=1 To $line
$word[6][$i]=FileReadLine($pathresultat, $i)
;~ ConsoleWrite("$word[6][" & $i & "] = " & FileReadLine($pathresultat, $i) & @CRLF)
Next
FileDelete($pathresultat)
_7lettres()
EndFunc
Func _7lettres()
$pathfile = 'resultat.txt'
$pathresultat = 'resultats.txt'
InetGet('http://www.kurokatta.org/hacks/scarab-fr?q='&$lettres, $pathfile)
$Read=String(FileRead($pathfile))
$split=StringSplit($read, "<dt>7 lettres</dt>",1)
If @error Then Return
FileDelete($pathfile)
FileDelete($pathresultat)
$split=StringSplit($split[2], "Calcul", 1)
$split=StringSplit($split[1], "<dt>8 lettres</dt>", 1)
$Rpl=StringReplace($Split[1], "<dd>", "")
$Rpl=StringReplace($Rpl, "</dd>", "")
$Rpl=StringReplace($Rpl, "<dl>", "")
$Rpl=StringReplace($Rpl, "</dl>", "")
$Rpl=StringReplace($Rpl, "<dt>", "")
$Rpl=StringReplace($Rpl, "</dt>", "")
$Rpl=StringReplace($Rpl, "<p>", "")
$Rpl=StringReplace($Rpl, Chr(10), "")
$Rpl=StringReplace($Rpl, ",", @CRLF)
$Rpl=StringReplace($Rpl, " ", "")
GUICtrlSetData($7lettres, $Rpl)
FileWrite($pathresultat, $rpl)
$line=_FileCountLines($pathresultat)
For $i=1 To $line
$word[7][$i]=FileReadLine($pathresultat, $i)
;~ ConsoleWrite("$word[7][" & $i & "] = " & FileReadLine($pathresultat, $i) & @CRLF)
Next
FileDelete($pathresultat)
_8lettres()
EndFunc
Func _8lettres()
$pathfile = 'resultat.txt'
$pathresultat = 'resultats.txt'
InetGet('http://www.kurokatta.org/hacks/scarab-fr?q='&$lettres, $pathfile)
$Read=String(FileRead($pathfile))
$split=StringSplit($read, "<dt>8 lettres</dt>",1)
If @error Then Return
FileDelete($pathfile)
FileDelete($pathresultat)
$split=StringSplit($split[2], "Calcul", 1)
$split=StringSplit($split[1], "<dt>9 lettres</dt>", 1)
$Rpl=StringReplace($Split[1], "<dd>", "")
$Rpl=StringReplace($Rpl, "</dd>", "")
$Rpl=StringReplace($Rpl, "<dl>", "")
$Rpl=StringReplace($Rpl, "</dl>", "")
$Rpl=StringReplace($Rpl, "<dt>", "")
$Rpl=StringReplace($Rpl, "</dt>", "")
$Rpl=StringReplace($Rpl, "<p>", "")
$Rpl=StringReplace($Rpl, Chr(10), "")
$Rpl=StringReplace($Rpl, ",", @CRLF)
$Rpl=StringReplace($Rpl, " ", "")
GUICtrlSetData($8lettres, $Rpl)
FileWrite($pathresultat, $rpl)
$line=_FileCountLines($pathresultat)
For $i=1 To $line
$word[8][$i]=FileReadLine($pathresultat, $i)
;~ ConsoleWrite("$word[8][" & $i & "] = " & FileReadLine($pathresultat, $i) & @CRLF)
Next
FileDelete($pathresultat)
;~ _9lettres()
EndFunc