- Offizieller Beitrag
Hi!
dies ist ein eBay script, schaut es euch einfach an schwer zu beschreiben..(bzw: zu faul^^)
C
#include <GUIConstants.au3>
#include <file.au3>
#include <GuiListView.au3>
Global Const $THRESHOLD = Number(RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "DoubleClickSpeed"))
Global $TIMER = TimerInit()
Global $tempfile = _TempFile ()
Opt("OnExitFunc", "OnAutoItExit")
If Not FileExists("ebay.ini") Then
IniWrite("ebay.ini", "Data", "ListViewFile", "err")
EndIf
$listfile = IniRead("ebay.ini", "Data", "ListViewFile", "err")
If $listfile = "err" Then
$Form1 = GUICreate("LSTV", 324, 47, 192, 125)
$Input1 = GUICtrlCreateInput(@ScriptDir & "\Data.lstv", 8, 24, 251, 21, -1, $WS_EX_CLIENTEDGE)
GUICtrlCreateLabel("Bitte wählen Sie in welcher datei Sie Ihre Daten Speichern wollen:", 8, 8, 315, 15)
$save = GUICtrlCreateButton("..", 266, 24, 21, 21)
$ok = GUICtrlCreateButton("&Ok", 296, 24, 21, 21)
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $save
$saveopen = FileSaveDialog("LSTV", @ScriptDir, "ListViewFile(*.lstv)", -1, "Data.lstv")
If @error Then ContinueLoop
$sr = StringRight($saveopen, 5)
If String($sr) = ".lstv" Then
;Weis auch net warum.. aber wenn ich If Not String($sr) = ".lstv" Then eingebe klappt es net?!
Else
$saveopen &= ".lstv"
EndIf
GUICtrlSetData($Input1, $saveopen)
Case $msg = $ok
$saveopen = GUICtrlRead($Input1)
IniWrite("ebay.ini", "Data", "ListViewFile", $saveopen)
$listfile = $saveopen
$hWriteFile = FileWrite($listfile, "")
ExitLoop
EndSelect
WEnd
GUIDelete()
EndIf
$Form1 = GUICreate("eBay", 622, 236, 451, 323)
GUISetBkColor(0xFFFFFF)
$Pic1 = GUICtrlCreatePic("ebay.jpg", 8, 8, 131, 64)
$ListView1 = GUICtrlCreateListView("Name|Seite", 8, 88, 610, 142)
$fcllf = _FileCountLines($listfile)
For $a = 1 To $fcllf
GUICtrlCreateListViewItem(FileReadLine($listfile, $a), $ListView1)
Next
GUICtrlCreateLabel("Deine Bisherigen daten:", 8, 72, 117, 15)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$site = GUICtrlCreateInput("http://www.eBay.de", 144, 24, 473, 21, -1, $WS_EX_CLIENTEDGE)
GUICtrlCreateLabel("Mein Angebobt auf Seite:", 144, 8, 124, 15)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$weiter = GUICtrlCreateButton("&Weiter >>", 480, 56, 139, 25)
GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
$load = GUICtrlCreateButton("&Liste Laden", 312, 56, 163, 25)
GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
$del = GUICtrlCreateButton("Liste L&öschen", 144, 56, 163, 25)
GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $Pic1
RunWait(@ComSpec & ' /c [URL]http://www.ebay.de[/URL]', '', @SW_HIDE)
Case $msg = $weiter
$site = GUICtrlRead($site)
SplashTextOn("", "Bitte Warten...", 120, 20, -1, -1, 1)
ExitLoop
Case $msg = $load
$listfile = FileOpenDialog("", @ScriptDir, "ListViewFile(*.lstv)", -1, "Data.lstv")
GUICtrlDelete($ListView1)
$ListView1 = GUICtrlCreateListView("Name|Seite", 8, 88, 610, 142)
$fcllf = _FileCountLines($listfile)
For $a = 1 To $fcllf
GUICtrlCreateListViewItem(FileReadLine($listfile, $a), $ListView1)
Next
Case $msg = $GUI_EVENT_PRIMARYDOWN
_DoubleClickOnListView($ListView1)
Case $msg = $del
If MsgBox(4, "", "Wollen Sie wirklich die Liste, " & $listfile & ", Löschen?") = 7 Then ContinueLoop
_FileCreate($listfile)
GUICtrlDelete($ListView1)
$ListView1 = GUICtrlCreateListView("Name|Seite", 8, 88, 610, 142)
EndSelect
WEnd
GUIDelete()
$siteread = InetGet($site, $tempfile)
If @error Then
SplashOff()
MsgBox(16, "", "Error to get Source!")
Exit
EndIf
$siteread = FileReadAll($tempfile)
If StringInStr($siteread, "beendet") Then
SplashOff()
$Kaeufer = StringSplit($siteread, "Käufer:", 1)
$Kaeufer = StringSplit($Kaeufer[2], "userid=", 1)
$Kaeufer = StringSplit($Kaeufer[2], "&", 1)
MsgBox(0, "", "Auktion wurde von """ & $Kaeufer[1] & """ Beendet!")
Exit
EndIf
$rest = StringSplit($siteread, "Restzeit:", 1)
$rest = StringSplit($rest[2], "<b>", 1)
$rest = StringSplit($rest[2], "</b>", 1)
$start = StringSplit($siteread, "Angebotsbeginn:", 1)
$start = StringSplit($start[2], "<td>", 1)
$start = StringSplit($start[2], "</td>", 1)
$ende = StringSplit($siteread, "Restzeit:", 1)
$ende = StringSplit($ende[2], '<span class="help">', 1)
$ende = StringSplit($ende[2], "</span>", 1)
$preis = "Preis"
If StringInStr($siteread, "Aktuelles Gebot:") Then $preis = "Aktuelles Gebot:"
$preis = StringSplit($siteread, $preis, 1)
$preis = StringSplit($preis[2], "<b>", 1)
$preis = StringSplit($preis[2], "</b>", 1)
$preispl = StringNum(StringReplace($preis[1], ",", "."))
$ortst = StringSplit($siteread, "Artikelstandort:", 1)
$ort1 = StringSplit($ortst[2], '<td>', 1)
$ort1 = StringSplit($ort1[2], '<br>', 1)
$ort1 = $ort1[1] & ", "
$versand = StringSplit($siteread, "Versandkosten", 1)
$versand = StringSplit($versand[2], "<td>", 1)
$versand = StringSplit($versand[2], "</td>", 1)
If StringInStr($versand[1], "<br>") Then $versand = StringSplit($versand[1], "<br>")
$versandpl = StringNum(StringReplace($versand[1], ",", "."))
$ort2 = StringSplit($ortst[2], '<span class="help">', 1)
$ort2 = StringSplit($ort2[2], "</span>", 1)
$ort = $ort1 & $ort2[1]
$titel = StringSplit($siteread, "content=""", 1)
$titel = StringSplit($titel[4], ", ", 1)
If Not StringInStr(FileReadAll($listfile), $titel[1] & "|" & $site) Then FileWriteLine($listfile, $titel[1] & "|" & $site)
SplashOff()
$Form2 = GUICreate("eBay: " & $titel[1], 400, 190, 185, 113)
GUISetBkColor(0xFFFFFF)
$Pic1 = GUICtrlCreatePic("ebay.jpg", 8, 8, 131, 64)
GUICtrlCreateLabel("Restdauer:", 8, 80, 56, 17)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlCreateLabel("Start:", 8, 96, 29, 17)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlCreateLabel("Ende:", 8, 112, 32, 17)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlCreateLabel("Preis:", 8, 128, 30, 17)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlCreateLabel("Ort:", 8, 144, 30, 17)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$restlab = GUICtrlCreateLabel($rest[1], 64, 80, 200, 17)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$startlab = GUICtrlCreateLabel($start[1], 40, 96, 200, 17)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$endelab = GUICtrlCreateLabel($ende[1], 40, 112, 500, 17)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$preislab = GUICtrlCreateLabel($preis[1] & "+ " & $versand[1] & " = " & StringLeft($preis[1], 4) & StringReplace($preispl + $versandpl, ".", ","), 40, 128, 500, 17)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$ortlab = GUICtrlCreateLabel($ort, 40, 144, 200, 17)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$akt = GUICtrlCreateButton("Aktualisieren", 8, 160)
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Pic1
RunWait(@ComSpec & ' /c [URL]http://www.ebay.de[/URL]', '', @SW_HIDE)
Case $msg = $akt
Akt()
EndSelect
WEnd
Exit
Func Akt()
SplashTextOn("", "Bitte Warten...", 120, 20, -1, -1, 1)
$siteread = InetGet($site, $tempfile, 1)
If @error Then
SplashOff()
MsgBox(16, "", "Error to get Source!")
Exit
EndIf
$siteread = FileReadAll($tempfile)
If StringInStr($siteread, "beendet.") Then
SplashOff()
$Kaeufer = StringSplit($siteread, "Käufer:", 1)
$Kaeufer = StringSplit($Kaeufer[2], "userid=", 1)
$Kaeufer = StringSplit($Kaeufer[2], "&", 1)
MsgBox(0, "", "Auktion wurde von """ & $Kaeufer[1] & """ Beendet!")
Exit
EndIf
$rest = StringSplit($siteread, "Restzeit:", 1)
$rest = StringSplit($rest[2], "<b>", 1)
$rest = StringSplit($rest[2], "</b>", 1)
$start = StringSplit($siteread, "Angebotsbeginn:", 1)
$start = StringSplit($start[2], "<td>", 1)
$start = StringSplit($start[2], "</td>", 1)
$ende = StringSplit($siteread, "Restzeit:", 1)
$ende = StringSplit($ende[2], '<span class="help">', 1)
$ende = StringSplit($ende[2], "</span>", 1)
$preis = "Preis"
If StringInStr($siteread, "Aktuelles Gebot:") Then $preis = "Aktuelles Gebot:"
$preis = StringSplit($siteread, $preis, 1)
$preis = StringSplit($preis[2], "<b>", 1)
$preis = StringSplit($preis[2], "</b>", 1)
$preispl = StringNum(StringReplace($preis[1], ",", "."))
$ortst = StringSplit($siteread, "Artikelstandort:", 1)
$ort1 = StringSplit($ortst[2], '<td>', 1)
$ort1 = StringSplit($ort1[2], '<br>', 1)
$ort1 = $ort1[1] & ", "
$versand = StringSplit($siteread, "Versandkosten", 1)
$versand = StringSplit($versand[2], "<td>", 1)
$versand = StringSplit($versand[2], "</td>", 1)
If StringInStr($versand[1], "<br>") Then $versand = StringSplit($versand[1], "<br>")
$versandpl = StringNum(StringReplace($versand[1], ",", "."))
$ort2 = StringSplit($ortst[2], '<span class="help">', 1)
$ort2 = StringSplit($ort2[2], "</span>", 1)
$ort = $ort1 & $ort2[1]
$titel = StringSplit($siteread, "content=""", 1)
$titel = StringSplit($titel[4], ", ", 1)
GUICtrlSetData($restlab, $rest[1])
GUICtrlSetData($startlab, $start[1])
GUICtrlSetData($endelab, $ende[1])
GUICtrlSetData($ortlab, $ort)
GUICtrlSetData($preislab, $preis[1] & "+ " & $versand[1] & " = " & StringLeft($preis[1], 4) & $preispl + $versandpl)
SplashOff()
EndFunc ;==>Akt
Func FileReadAll($file)
$fileopen = FileOpen($file, 0)
$fileret = ""
For $a = 1 To _FileCountLines($file)
$fileret &= FileReadLine($fileopen, $a) & @CR
Next
Return $fileret
EndFunc ;==>FileReadAll
Func OnAutoItExit()
FileDelete($tempfile)
EndFunc ;==>OnAutoItExit
Func _DoubleClickOnListView(ByRef $lvctrl)
Dim $MousePos = GUIGetCursorInfo()
If ($MousePos[4] == $lvctrl And GUICtrlRead($lvctrl) > 0 And _GUICtrlListViewGetHotItem ($lvctrl) = _GUICtrlListViewGetCurSel ($lvctrl)) Then
$timerdiff = TimerDiff($TIMER)
If $timerdiff <= $THRESHOLD Then
$listread = StringSplit(GUICtrlRead(GUICtrlRead($ListView1)), "|")
GUICtrlSetData($site, $listread[2])
EndIf
$TIMER = TimerInit()
EndIf
EndFunc ;==>_DoubleClickOnListView
Func StringNum($data)
For $a = 0 To 255
If $a = 46 Then ContinueLoop
If $a = 48 Then ContinueLoop
If $a = 49 Then ContinueLoop
If $a = 50 Then ContinueLoop
If $a = 51 Then ContinueLoop
If $a = 52 Then ContinueLoop
If $a = 53 Then ContinueLoop
If $a = 54 Then ContinueLoop
If $a = 55 Then ContinueLoop
If $a = 56 Then ContinueLoop
If $a = 57 Then ContinueLoop
$data = StringReplace($data, Chr($a), "")
Next
Return $data
EndFunc ;==>StringNum
Alles anzeigen
edit: mhh kan ima noch keine zips anhängen! wida gleicher fehler... also hab ichs wida geuploadet: