Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
- #AutoIt3Wrapper_outfile=RS-Man.exe
- #AutoIt3Wrapper_Compression=4
- #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
- #cs;================================================
- ;AutoIt Version: 3.2.12.1
- ;Author: Taek
- ;Script Function: RS-Man
- #ce;================================================
- #include <ButtonConstants.au3>
- #include <Date.au3>
- #include <EditConstants.au3>
- #include <File.au3>
- #include <GUIConstantsEx.au3>
- #include <GUIConstants.au3>
- #include <String.au3>
- #include <ListViewConstants.au3>
- #include <WindowsConstants.au3>
- #include <GuiListView.au3>
- #include <StaticConstants.au3>
- #include <Misc.au3>
- ;==================================================
- ; GUI
- ;==================================================
- _Singleton(@ScriptName,0)
- ;GUIRegisterMsg(0x233, "On_WM_DROPFILES")
- $mainGUI = GUICreate("RS-Man", 750, 600, Default, Default, -1, $WS_EX_ACCEPTFILES)
- Opt('TrayMenuMode', 1)
- Opt('TrayAutoPause', 0)
- $TrayShow = TrayCreateItem('Anzeigen')
- $TrayExit = TrayCreateItem('Beenden')
- GUICtrlCreateLabel("© Taek", 695, 0, 75, 55)
- GUICtrlSetTip(-1, "GTASpider für seine RapidPrem Funktionen", "DANKE")
- GUICtrlSetFont(-1, 11, 800)
- GUICtrlCreateIcon("icon.ico", "", 635, 0, 60, 60)
- GUICtrlCreateGroup("Account", 2, 0, 290, 40)
- $account_new = GUICtrlCreateButton("Anlegen", 170, 15, 55, 22)
- $account_del = GUICtrlCreateButton("Entfernen", 230, 15, 55, 22)
- $account_combo = GUICtrlCreateCombo("", 15, 15, 150, 22)
- $account_type = GUICtrlCreateLabel("", 5, 17, 10, 22)
- GUICtrlSetFont(-1, 11, 800)
- GUICtrlCreateGroup("Status", 295, 0, 350, 40)
- $statuslabel = GUICtrlCreateLabel("", 300, 15, 340, 25, $SS_CENTER)
- GUICtrlSetFont(-1, 10, 800)
- $tab = GUICtrlCreateTab(2, 42, 748, 558)
- $tab1 = GUICtrlCreateTabItem("Infos")
- ;########################################
- GUICtrlCreateGroup("Standard User Infos", 5, 65, 200, 80)
- GUICtrlSetBkColor(-1, 0xFFFFFF)
- $lbl_dateien1 = GUICtrlCreateLabel("Dateien:", 10, 80, 100, 15)
- GUICtrlSetFont(-1, 9, 800)
- $lbl_dateien2 = GUICtrlCreateLabel("N/A", 110, 80, 90, 15)
- $lbl_points1 = GUICtrlCreateLabel("Punkte:", 10, 95, 100, 15)
- GUICtrlSetFont(-1, 9, 800)
- $lbl_points2 = GUICtrlCreateLabel("N/A", 110, 95, 90, 15)
- $lbl_pointspu1 = GUICtrlCreateLabel("Punkte PU:", 10, 110, 100, 15)
- GUICtrlSetFont(-1, 9, 800)
- $lbl_pointspu2 = GUICtrlCreateLabel("N/A", 110, 110, 90, 15)
- GUICtrlSetTip(-1, "Diese Punkte wurden" & @CRLF & "durch Premium-User" & @CRLF & "generiert.", "Info:", 0, 1)
- $lbl_speicher1 = GUICtrlCreateLabel("Speicher:", 10, 125, 100, 15)
- GUICtrlSetFont(-1, 9, 800)
- $lbl_speicher2 = GUICtrlCreateLabel("N/A", 110, 125, 90, 15)
- ;########################################
- GUICtrlCreateGroup("Premium User Infos", 210, 65, 200, 80)
- $lbl_gueltig1 = GUICtrlCreateLabel("Gültig bis:", 215, 80, 100, 15)
- GUICtrlSetFont(-1, 9, 800)
- $lbl_gueltig2 = GUICtrlCreateLabel("N/A", 310, 80, 90, 15)
- $lbl_traffic1 = GUICtrlCreateLabel("Übriger Traffic:", 215, 95, 100, 15)
- GUICtrlSetFont(-1, 9, 800)
- $lbl_traffic2 = GUICtrlCreateLabel("N/A", 310, 95, 90, 15)
- $lbl_traffic3 = GUICtrlCreateLabel("TrafficShare:", 215, 110, 100, 15)
- GUICtrlSetFont(-1, 9, 800)
- $lbl_traffic4 = GUICtrlCreateLabel("N/A", 310, 110, 90, 15)
- ;########################################
- $btn_laden = GUICtrlCreateButton("Letzter Status", 415, 70, 130, 22)
- $lbl_abfrage2 = GUICtrlCreateLabel("N/A", 415, 90, 130, 10, $SS_CENTER)
- GUICtrlSetFont(-1, 8)
- $update = GUICtrlCreateButton("Update", 415, 105, 50, 40)
- $auto_update = GUICtrlCreateButton("Auto" & @CRLF & "Update", 470, 105, 50, 40, $BS_MULTILINE)
- $auto_update_state = GUICtrlCreateLabel("", 523, 110, 40, 15)
- GUICtrlSetFont(-1, 9, 800)
- $auto_update_time = GUICtrlCreateLabel("", 520, 125, 30, 15, $SS_CENTER)
- GUICtrlSetFont(-1, 7)
- ;########################################
- GUICtrlCreateGroup("Dateien", 550, 65, 195, 80)
- $btn_alle = GUICtrlCreateButton("Alle" & @CRLF & "auswählen", 555, 80, 90, 30, $BS_MULTILINE)
- $btn_keine = GUICtrlCreateButton("Keine" & @CRLF & "auswählen", 555, 110, 90, 30, $BS_MULTILINE)
- $btn_invers = GUICtrlCreateButton("Auswahl" & @CRLF & "umkehren", 650, 80, 90, 30, $BS_MULTILINE)
- $export = GUICtrlCreateButton("Links" & @CRLF & "kopieren", 650, 110, 90, 30, $BS_MULTILINE)
- GUICtrlSetBkColor($statuslabel, $GUI_BKCOLOR_TRANSPARENT)
- $listview = GUICtrlCreateListView(" Dateiname | Größe (KB) | Downloads | Letzter Download | Status | ID", 3, 145, 744, 452, BitOR($LVS_SHOWSELALWAYS, $LVS_REPORT), _
- BitOR($LVS_EX_CHECKBOXES, $LVS_EX_FULLROWSELECT, $LVS_SORTASCENDING))
- $deckel = GUICtrlCreateLabel("", 3, 145, 744, 452)
- _GUICtrlListView_SetColumnWidth ($listview, 0, 395)
- _GUICtrlListView_RegisterSortCallBack ($listview, True, True)
- ;######################################## Upload GUI
- #cs
- $tab2 = GUICtrlCreateTabItem("Hochladen")
- GUICtrlCreateLabel("Dateien per Drag-And-Drop einfügen!", 5, 70, 200, 22)
- $uploadqueue = GUICtrlCreateListView(" Dateipfad | Status ", 5, 90, 740, 300)
- _GUICtrlListView_SetColumnWidth($uploadqueue, 0, 450)
- _GUICtrlListView_SetColumnWidth($uploadqueue, 1, 280)
- $upload_start = GUICtrlCreateButton("Upload starten", 5, 400, 100, 22)
- $upload_delete = GUICtrlCreateButton("Datei entfernen", 110, 400, 100, 22)
- $hLab_DownlPrz = GUICtrlCreateLabel("", 5, 425, 100, 22)
- $hProg_Downl = GUICtrlCreateProgress(110, 425, 200, 22)
- #ce
- ;########################################
- ;$tab3 = GUICtrlCreateTabItem("Statistik")
- ;########################################
- ;$tab4 = GUICtrlCreateTabItem("Programmupdate")
- ;########################################
- $tab2 = GUICtrlCreateTabItem("Settings")
- GUICtrlCreateGroup("Markierungen", 5, 65, 420, 140)
- GUICtrlCreateLabel("Dateien unter", 10, 80, 70, 22)
- $hInput1 = GUICtrlCreateInput(IniRead(@ScriptDir & "\userdata.ini", "settings", "groesse", 5), 80, 80, 40, 18, $ES_NUMBER)
- GUICtrlCreateUpdown($hInput1)
- GUICtrlCreateLabel("MB werden ", 125, 80, 60, 22)
- $choose_color0 = GUICtrlCreateButton("", 185, 80, 30, 18)
- GUICtrlSetBkColor(-1, IniRead(@ScriptDir & "\userdata.ini", "settings", "farbe0", 0xAAAAAA))
- GUICtrlCreateLabel("markiert", 220, 80, 70, 22)
- GUICtrlCreateLabel("Dateien, die länger als ", 10, 105, 110, 22)
- $hInput2 = GUICtrlCreateInput(IniRead(@ScriptDir & "\userdata.ini", "settings", "grenze1", 60), 125, 105, 40, 18, $ES_NUMBER)
- GUICtrlCreateUpdown($hInput2)
- GUICtrlCreateLabel("Tage nicht geladen wurden, werden ", 170, 105, 175, 22)
- $choose_color1 = GUICtrlCreateButton("", 345, 105, 30, 18)
- GUICtrlSetBkColor(-1, IniRead(@ScriptDir & "\userdata.ini", "settings", "farbe1", 0xFFC864))
- GUICtrlCreateLabel("markiert", 380, 105, 70, 22)
- GUICtrlCreateLabel("Dateien, die länger als", 10, 130, 110, 22)
- $hInput3 = GUICtrlCreateInput(IniRead(@ScriptDir & "\userdata.ini", "settings", "grenze2", 80), 125, 130, 40, 18, $ES_NUMBER)
- GUICtrlCreateUpdown($hInput3)
- GUICtrlCreateLabel("Tage nicht geladen wurden, werden ", 170, 130, 175, 22)
- $choose_color2 = GUICtrlCreateButton("", 345, 130, 30, 18)
- GUICtrlSetBkColor(-1, IniRead(@ScriptDir & "\userdata.ini", "settings", "farbe2", 0xFF6666))
- GUICtrlCreateLabel("markiert", 380, 130, 70, 22)
- GUICtrlCreateLabel("Dateien ohne Download werden ", 10, 155, 160, 22)
- $choose_color3 = GUICtrlCreateButton("", 170, 155, 30, 18)
- GUICtrlSetBkColor(-1, IniRead(@ScriptDir & "\userdata.ini", "settings", "farbe3", 0xFF0000))
- GUICtrlCreateLabel("markiert", 205, 155, 70, 22)
- $color_save = GUICtrlCreateButton("Speichern", 10, 175, 100, 22)
- $color_restore = GUICtrlCreateButton("Standard", 115, 175, 100, 22)
- ;######################################## Input GUI
- $inputGUI = GUICreate("Login-Daten", 270, 100, Default, Default, $WS_CAPTION)
- GUICtrlCreateLabel("Username:", 5, 5, 50, 22)
- $input_username = GUICtrlCreateInput("", 60, 5, 205, 22)
- GUICtrlCreateLabel("Passwort:", 5, 30)
- $input_password = GUICtrlCreateInput("", 60, 30, 205, 22, 0x20)
- $radio_coll = GUICtrlCreateRadio("Collector", 5, 52, 60, 22)
- $radio_prem = GUICtrlCreateRadio("Premium", 5, 75, 60, 22)
- $inputGUI_OK = GUICtrlCreateButton("OK", 100, 75, 80, 22)
- $inputGUI_Abbr = GUICtrlCreateButton("Abbrecchen", 185, 75, 80, 22)
- ;######################################## Autoupdate GUI
- Global $read_accounts = IniReadSection(@ScriptDir & "\userdata.ini", "Accounts")
- If @error Then
- $anzahl_accounts = 1
- Else
- $anzahl_accounts = UBound($read_accounts)
- EndIf
- $updateGUI = GUICreate("Auto Update", 240, 120 + ($anzahl_accounts - 1 - 1) * 20, Default, Default, $WS_CAPTION)
- GUICtrlCreateLabel("Bitte die Minuten eingeben und die Accounts überprüfen. Bei '0' wird die Funktion deaktiviert.", 5, 5, 230, 50)
- Global $checkbox[$anzahl_accounts]
- If $anzahl_accounts > 1 Then
- For $z = 1 To $anzahl_accounts - 1
- $checkbox[$z] = GUICtrlCreateCheckbox($read_accounts[$z][0], 5, 45 + ($z - 1) * 20, 200, 17)
- Next
- Else
- $checkbox[0] = GUICtrlCreateCheckbox("", 5, 45, 200, 17)
- EndIf
- $update_time = GUICtrlCreateInput("", 5, 65 + ($anzahl_accounts - 1 - 1) * 20, 50, 22)
- GUICtrlCreateLabel("Minuten", 60, 70 + ($anzahl_accounts - 1 - 1) * 20, 50, 22)
- $updateGUI_OK = GUICtrlCreateButton("OK", 30, 95 + ($anzahl_accounts - 1 - 1) * 20, 80, 22)
- $updateGUI_Abbr = GUICtrlCreateButton("Abbrecchen", 130, 95 + ($anzahl_accounts - 1 - 1) * 20, 80, 22)
- ;==================================================
- ; Hauptprogramm
- ;==================================================
- TCPStartup()
- Opt("TCPTimeout", 500)
- Global $hProg_Downl
- Global $hLab_DownlPrz
- Global $hGUI_Prog
- Global $bDownloadActive = False
- GUISetState(@SW_SHOW, $mainGUI)
- $startTimer = TimerInit()
- $read_accounts = IniReadSection(@ScriptDir & "\userdata.ini", "Accounts")
- If @error Then
- GUICtrlSetData($account_combo, "N/A", "N/A")
- GUICtrlSetState($account_del, $GUI_DISABLE)
- GUICtrlSetState($btn_laden, $GUI_DISABLE)
- GUICtrlSetState($update, $GUI_DISABLE)
- GUICtrlSetState($auto_update, $GUI_DISABLE)
- Else
- $text = "|"
- For $k = 1 To UBound($read_accounts) - 1
- $text = $text & $read_accounts[$k][0] & "|"
- Next
- GUICtrlSetData($account_combo, $text, $read_accounts[1][0])
- EndIf
- _account_combo()
- If IniRead(@ScriptDir & "\userdata.ini", "Data 4all", "autoupdate", "0") = 0 Then
- GUICtrlSetData($auto_update_state, "AUS")
- AdlibUnRegister()
- Else
- GUICtrlSetData($auto_update_state, "AN")
- AdlibRegister("_timeleft", 1000)
- EndIf
- While 1
- $minutes = IniRead(@ScriptDir & "\userdata.ini", "Data 4all", "autoupdate", "0")
- If $minutes <> 0 Then
- If TimerDiff($startTimer) > $minutes * 60 * 1000 Then
- AdlibUnRegister()
- GUICtrlSetData($auto_update_time, "00:00")
- For $z = 1 To UBound($read_accounts) - 1
- If IniRead(@ScriptDir & "\userdata.ini", "Data " & $read_accounts[$z][0], "autoupdate", "aus") = "an" Then
- _update($read_accounts[$z][0])
- _Laden($read_accounts[$z][0])
- EndIf
- $startTimer = TimerInit()
- Next
- $startTimer = TimerInit()
- AdlibRegister("_timeleft", 1000)
- EndIf
- EndIf
- Switch GUIGetMsg()
- Case $GUI_EVENT_MINIMIZE
- Opt('TrayIconHide', 0)
- GUISetState(@SW_HIDE, $mainGUI)
- While 2
- Switch TrayGetMsg()
- Case $TrayShow
- Opt('TrayIconHide', 1)
- GUISetState(@SW_SHOW, $mainGUI)
- GUISetState(@SW_RESTORE, $mainGUI)
- ExitLoop
- Case $TrayExit
- $quitloop = 1
- Exit
- EndSwitch
- WEnd
- Case $GUI_EVENT_CLOSE
- Exit
- Case $account_new
- GUICtrlSetData($statuslabel, "Accounteinstellungen geöffnet...")
- GUISetState(@SW_ENABLE, $inputGUI)
- GUISetState(@SW_DISABLE, $mainGUI)
- GUISetState(@SW_SHOW, $inputGUI)
- GUICtrlSetState($inputGUI_OK, $GUI_FOCUS)
- Case $inputGUI_OK
- If GUICtrlRead($input_username) = "" Then
- MsgBox(64, "Angabe fehlt", "Bitte geben Sie ihren Login ein.")
- ElseIf GUICtrlRead($input_password) = "" Then
- MsgBox(64, "Angabe fehlt", "Bitte geben Sie ihr Passwort ein.")
- ElseIf GUICtrlRead($radio_coll) = 4 And GUICtrlRead($radio_prem) = 4 Then
- MsgBox(64, "Angabe fehlt", "Bitte wählen Sie einen Account-Typ aus.")
- Else
- IniWrite(@ScriptDir & "\userdata.ini", "Accounts", GUICtrlRead($input_username), _Now())
- IniWrite(@ScriptDir & "\userdata.ini", "Login " & GUICtrlRead($input_username), "Username", GUICtrlRead($input_username))
- $read_password = _StringEncrypt(1, GUICtrlRead($input_password), "rslogincrypt")
- IniWrite(@ScriptDir & "\userdata.ini", "Login " & GUICtrlRead($input_username), "Password", $read_password)
- If GUICtrlRead($radio_prem) = 1 Then
- IniWrite(@ScriptDir & "\userdata.ini", "Login " & GUICtrlRead($input_username), "Type", "Premium")
- Else
- IniWrite(@ScriptDir & "\userdata.ini", "Login " & GUICtrlRead($input_username), "Type", "Collector")
- EndIf
- $read_accounts = IniReadSection(@ScriptDir & "\userdata.ini", "Accounts")
- $text = "|"
- For $k = 1 To UBound($read_accounts) - 1
- $text = $text & $read_accounts[$k][0] & "|"
- Next
- GUICtrlSetData($account_combo, $text, $read_accounts[1][0])
- GUICtrlSetData($statuslabel, "")
- GUICtrlSetState($account_del, $GUI_ENABLE)
- GUICtrlSetState($btn_laden, $GUI_ENABLE)
- GUICtrlSetState($update, $GUI_ENABLE)
- GUICtrlSetState($auto_update, $GUI_ENABLE)
- GUISetState(@SW_ENABLE, $mainGUI)
- GUISetState(@SW_HIDE, $inputGUI)
- GUISetState(@SW_DISABLE, $inputGUI)
- MsgBox(64, "Info", "Damit die Accounts beim Auto Update richtig eingetragen sind müssen Sie das Programm neu starten.")
- EndIf
- Case $inputGUI_Abbr
- GUICtrlSetData($statuslabel, "")
- GUISetState(@SW_ENABLE, $mainGUI)
- GUISetState(@SW_HIDE, $inputGUI)
- GUISetState(@SW_DISABLE, $inputGUI)
- Case $account_del
- _account_del()
- Case $account_combo
- _account_combo()
- Case $listview
- _GUICtrlListView_SortItems ($listview, GUICtrlGetState($listview))
- Case $btn_laden
- _Laden(GUICtrlRead($account_combo))
- Case $update
- _update(GUICtrlRead($account_combo))
- _Laden(GUICtrlRead($account_combo))
- Case $auto_update
- GUICtrlSetData($statuslabel, "Updateinstellungen geöffnet...")
- GUICtrlSetData($update_time, IniRead(@ScriptDir & "\userdata.ini", "Data 4all", "autoupdate", "0"))
- For $z = 1 To UBound($read_accounts) - 1
- If IniRead(@ScriptDir & "\userdata.ini", "Data " & $read_accounts[$z][0], "autoupdate", "aus") = "aus" Then
- GUICtrlSetState($checkbox[$z], $GUI_UNCHECKED)
- Else
- GUICtrlSetState($checkbox[$z], $GUI_CHECKED)
- EndIf
- Next
- GUISetState(@SW_ENABLE, $updateGUI)
- GUISetState(@SW_DISABLE, $mainGUI)
- GUISetState(@SW_SHOW, $updateGUI)
- GUICtrlSetState($updateGUI_OK, $GUI_FOCUS)
- Case $updateGUI_OK
- If GUICtrlRead($update_time) = "" Then
- MsgBox(64, "Angabe fehlt", "Bitte geben Sie eine Zahl ein.")
- Else
- IniWrite(@ScriptDir & "\userdata.ini", "Data 4all", "autoupdate", GUICtrlRead($update_time))
- For $z = 1 To UBound($read_accounts) - 1
- If GUICtrlRead($checkbox[$z]) = 1 Then
- IniWrite(@ScriptDir & "\userdata.ini", "Data " & $read_accounts[$z][0], "autoupdate", "an")
- Else
- IniWrite(@ScriptDir & "\userdata.ini", "Data " & $read_accounts[$z][0], "autoupdate", "aus")
- EndIf
- Next
- If IniRead(@ScriptDir & "\userdata.ini", "Data 4all", "autoupdate", "0") = 0 Then
- GUICtrlSetData($auto_update_state, "AUS")
- AdlibUnRegister()
- GUICtrlSetData($auto_update_time, "")
- Else
- GUICtrlSetData($auto_update_state, "AN")
- AdlibRegister("_timeleft", 1000)
- EndIf
- GUICtrlSetData($statuslabel, "")
- GUISetState(@SW_ENABLE, $mainGUI)
- GUISetState(@SW_HIDE, $updateGUI)
- GUISetState(@SW_DISABLE, $updateGUI)
- EndIf
- Case $updateGUI_Abbr
- GUICtrlSetData($statuslabel, "")
- GUISetState(@SW_ENABLE, $mainGUI)
- GUISetState(@SW_HIDE, $updateGUI)
- GUISetState(@SW_DISABLE, $updateGUI)
- Case $btn_alle
- _GUICtrlListView_SetItemChecked ($listview, -1, True)
- Case $btn_keine
- _GUICtrlListView_SetItemChecked ($listview, -1, False)
- Case $btn_invers
- $anzahl = IniRead(@ScriptDir & "\userdata.ini", "Data " & GUICtrlRead($account_combo), "Dateien", "error")
- Local $aexport[1]
- For $ex = 1 To $anzahl
- If _GUICtrlListView_GetItemChecked ($listview, $ex - 1) = True Then
- _GUICtrlListView_SetItemChecked ($listview, $ex - 1, False)
- Else
- _GUICtrlListView_SetItemChecked ($listview, $ex - 1, True)
- EndIf
- Next
- Case $export
- _Links_kopieren()
- ;Case $upload_start
- ; _RapidPrem_UploadFile("E:\AutoIT\leer.txt", "BornFromPain")
- Case $choose_color0
- $rColor0 = _ChooseColor(2, IniRead(@ScriptDir & "\userdata.ini", "settings", "farbe0", 0xAAAAAA), 2, $mainGUI)
- GUICtrlSetBkColor($choose_color0, $rColor0)
- IniWrite(@ScriptDir & "\userdata.ini", "settings", "farbe0", $rColor0)
- Case $choose_color1
- $rColor1 = _ChooseColor(2, IniRead(@ScriptDir & "\userdata.ini", "settings", "farbe1", 0xFFC864), 2, $mainGUI)
- GUICtrlSetBkColor($choose_color1, $rColor1)
- IniWrite(@ScriptDir & "\userdata.ini", "settings", "farbe1", $rColor1)
- Case $choose_color2
- $rColor2 = _ChooseColor(2, IniRead(@ScriptDir & "\userdata.ini", "settings", "farbe2", 0xFF6666), 2, $mainGUI)
- GUICtrlSetBkColor($choose_color2, $rColor2)
- IniWrite(@ScriptDir & "\userdata.ini", "settings", "farbe2", $rColor2)
- Case $choose_color3
- $rColor3 = _ChooseColor(2, IniRead(@ScriptDir & "\userdata.ini", "settings", "farbe3", 0xFF0000), 2, $mainGUI)
- GUICtrlSetBkColor($choose_color3, $rColor3)
- IniWrite(@ScriptDir & "\userdata.ini", "settings", "farbe3", $rColor3)
- Case $color_save
- IniWrite(@ScriptDir & "\userdata.ini", "settings", "groesse", GUICtrlRead($hInput1))
- IniWrite(@ScriptDir & "\userdata.ini", "settings", "grenze1", GUICtrlRead($hInput2))
- IniWrite(@ScriptDir & "\userdata.ini", "settings", "grenze2", GUICtrlRead($hInput3))
- Case $color_restore
- IniDelete(@ScriptDir & "\userdata.ini", "settings", "groesse")
- IniDelete(@ScriptDir & "\userdata.ini", "settings", "grenze1")
- IniDelete(@ScriptDir & "\userdata.ini", "settings", "grenze2")
- IniDelete(@ScriptDir & "\userdata.ini", "settings", "farbe0")
- IniDelete(@ScriptDir & "\userdata.ini", "settings", "farbe1")
- IniDelete(@ScriptDir & "\userdata.ini", "settings", "farbe2")
- IniDelete(@ScriptDir & "\userdata.ini", "settings", "farbe3")
- GUICtrlSetBkColor($choose_color0, 0xAAAAAA)
- GUICtrlSetData($hInput1, 5)
- GUICtrlSetBkColor($choose_color1, 0xFFC864)
- GUICtrlSetData($hInput2, 60)
- GUICtrlSetBkColor($choose_color2, 0xFF6666)
- GUICtrlSetData($hInput3, 80)
- GUICtrlSetBkColor($choose_color3, 0xFF0000)
- EndSwitch
- WEnd
- Func _account_del()
- $iMsgBoxAnswer = MsgBox(36, "Löschen?", "Wollen Sie den Account " & @CRLF & GUICtrlRead($account_combo) & @CRLF & "wirklich löschen?")
- Select
- Case $iMsgBoxAnswer = 6 ;Yes
- GUICtrlSetData($statuslabel, "Account wird gelöscht...")
- For $i = 1 To IniRead(@ScriptDir & "\userdata.ini", "Data " & GUICtrlRead($account_combo), "Dateien", "N/A")
- IniDelete(@ScriptDir & "\userdata.ini", $i & " " & GUICtrlRead($account_combo))
- Next
- IniDelete(@ScriptDir & "\userdata.ini", "Accounts", GUICtrlRead($account_combo))
- IniDelete(@ScriptDir & "\userdata.ini", "Login " & GUICtrlRead($account_combo))
- IniDelete(@ScriptDir & "\userdata.ini", "Data " & GUICtrlRead($account_combo))
- _GUICtrlListView_DeleteAllItems ($listview)
- $read_accounts = IniReadSection(@ScriptDir & "\userdata.ini", "Accounts")
- If @error Then
- GUICtrlSetData($account_combo, "N/A", "N/A")
- GUICtrlSetState($account_del, $GUI_DISABLE)
- GUICtrlSetState($btn_laden, $GUI_DISABLE)
- GUICtrlSetState($update, $GUI_DISABLE)
- Else
- $text = "|"
- For $k = 1 To UBound($read_accounts) - 1
- $text = $text & $read_accounts[$k][0] & "|"
- Next
- GUICtrlSetData($account_combo, $text, $read_accounts[1][0])
- EndIf
- GUICtrlSetData($statuslabel, "")
- MsgBox(64, "Info", "Damit die Accounts beim Auto Update richtig eingetragen sind müssen Sie das Programm neu starten.")
- Case $iMsgBoxAnswer = 7 ;No
- EndSelect
- EndFunc ;==>_account_del
- Func _account_combo()
- If IniRead(@ScriptDir & "\userdata.ini", "Login " & GUICtrlRead($account_combo), "Type", "Collector") = "Collector" Then
- GUICtrlSetData($account_type, "C")
- ElseIf IniRead(@ScriptDir & "\userdata.ini", "Login " & GUICtrlRead($account_combo), "Type", "Collector") = "Premium" Then
- GUICtrlSetData($account_type, "P")
- EndIf
- GUICtrlSetData($lbl_dateien2, IniRead(@ScriptDir & "\userdata.ini", "Data " & GUICtrlRead($account_combo), "Dateien", "N/A"))
- GUICtrlSetData($lbl_points2, IniRead(@ScriptDir & "\userdata.ini", "Data " & GUICtrlRead($account_combo), "Points", "N/A"))
- GUICtrlSetData($lbl_pointspu2, IniRead(@ScriptDir & "\userdata.ini", "Data " & GUICtrlRead($account_combo), "PointsPU", "N/A"))
- GUICtrlSetData($lbl_speicher2, IniRead(@ScriptDir & "\userdata.ini", "Data " & GUICtrlRead($account_combo), "Speicher", "N/A"))
- GUICtrlSetData($lbl_abfrage2, IniRead(@ScriptDir & "\userdata.ini", "Data " & GUICtrlRead($account_combo), "Letzte Abfrage", "N/A"))
- GUICtrlSetData($lbl_gueltig2, IniRead(@ScriptDir & "\userdata.ini", "Data " & GUICtrlRead($account_combo), "Gueltig", "N/A"))
- GUICtrlSetData($lbl_traffic2, IniRead(@ScriptDir & "\userdata.ini", "Data " & GUICtrlRead($account_combo), "Traffic", "N/A"))
- GUICtrlSetData($lbl_traffic4, IniRead(@ScriptDir & "\userdata.ini", "Data " & GUICtrlRead($account_combo), "TrafficShare", "N/A"))
- $read_points = IniRead(@ScriptDir & "\userdata.ini", "Data " & GUICtrlRead($account_combo), "Points", "N/A")
- $read_points_alt = IniRead(@ScriptDir & "\userdata.ini", "Data " & GUICtrlRead($account_combo), "Points_alt", "0")
- GUICtrlSetTip($lbl_points2, $read_points & " (+" & ($read_points - $read_points_alt) & ")", "Vorherige Punkte:", 0, 1)
- EndFunc ;==>_account_combo
- Func _update($account_name)
- ; Accountdaten auswerten
- GUICtrlSetData($statuslabel, "Account wird abgerufen...")
- $get_password = _StringEncrypt(0, IniRead(@ScriptDir & "\userdata.ini", "Login " & $account_name, "Password", ""), "rslogincrypt")
- If IniRead(@ScriptDir & "\userdata.ini", "Login " & $account_name, "Type", "") = "Collector" Then
- $sUrl = "https://ssl.rapidshare.com/cgi-bin/collectorszone.cgi"
- $phrase1 = "username"
- Else
- $phrase1 = "login"
- $sUrl = "https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi"
- EndIf
- Local $hDll = DllOpen("wininet.dll")
- Local $sUserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1", $hInternet, $hRequest, $iBufferSize = 1024 * 20
- Local $tNumberOfBytesRead = DllStructCreate("dword"), $tBuffer = DllStructCreate("byte[" & $iBufferSize & "]"), $sReadFile, $aRegEx, $aRet[4], $avResult, $iReadBuffer, $iErr
- Local $hInternet = DllCall($hDll, _
- "ptr", "InternetOpen", _
- "wstr", $sUserAgent, _
- "dword", 0, _
- "ptr", 0, _
- "ptr", 0, _
- "dword", 0)
- If @error Then Return SetError(1, 0, 0)
- $hInternet = $hInternet[0]
- Local $hHTTPReq = DllCall($hDll, _
- "ptr", "InternetOpenUrlW", _
- "ptr", $hInternet, _
- "wstr", $sUrl & "?" & $phrase1 & "=" & $account_name & "&password=" & $get_password, _
- "ptr", 0, _
- "dword", 0, _
- "dword", 0, _
- "ptr", 0)
- If @error Then Return SetError(2, 0, 0)
- $hHTTPReq = $hHTTPReq[0]
- Do
- $tNumberOfBytesRead = DllStructCreate("dword")
- $tBuffer = DllStructCreate("byte[" & $iBufferSize & "]")
- Local $avResult = DllCall($hDll, _
- "int", "InternetReadFile", _
- "ptr", $hHTTPReq, _
- "ptr", DllStructGetPtr($tBuffer), _
- "dword", $iBufferSize, _
- "ptr", DllStructGetPtr($tNumberOfBytesRead))
- If @error Or Not $avResult[0] Then ExitLoop
- $iReadBuffer = DllStructGetData($tNumberOfBytesRead, 1)
- $sReadFile &= BinaryToString(BinaryMid(DllStructGetData($tBuffer, 1), 1, $iReadBuffer))
- Until Not $iReadBuffer
- If StringInStr($sReadFile, "The Account has been found, password incorrect.") Then
- MsgBox(64, "Info", "Account gefunden, das Passwort stimmt nicht.")
- Else
- If StringInStr($sReadFile, "Account not found.") Then
- MsgBox(64, "Info", "Der Account wurde nicht gefunden.")
- Else
- If StringInStr($sReadFile, "This Account expired on") Then
- MsgBox(64, "Info", "Der Account ist bereits abgelaufen.")
- Else
- GUICtrlSetData($statuslabel, "Account Daten auswerten...")
- $aRegEx = StringRegExp($sReadFile, '(?s)Files:</td>.*?<b>(.*?)</b>', 3)
- $dateien = $aRegEx[0]
- $aRegEx = StringRegExp($sReadFile, '(?s)Used storage:</td>.*?<b>(.*?)</b>', 3)
- $speicher = $aRegEx[0]
- $aRegEx = StringRegExp($sReadFile, '(?s)RapidPoints:</td>.*?"rpo">(.*?)</', 3)
- $points = $aRegEx[0]
- $aRegEx = StringRegExp($sReadFile, '(?s)RapidPoints PU</a>:</td>.*?<b>(.*?)</b>', 3)
- $pointsPU = $aRegEx[0]
- $aRegEx = StringRegExp($sReadFile, '(?s)Expiration date:</td>.*?<b>(.*?)</b>', 3)
- If @error Then
- $gueltig = "N/A"
- Else
- $gueltig = _RapidDateToCalc($aRegEx[0])
- EndIf
- $aRegEx = StringRegExp($sReadFile, '(?s)Traffic left:</td>.*?Math\.ceil\((.*?)/1000\)', 3)
- If @error Then
- $traffic = "N/A"
- Else
- $traffic = Round($aRegEx[0] / 1000) & " MB"
- EndIf
- $aRegEx = StringRegExp($sReadFile, '(?s)<td>TrafficShare left:</td>.*?<b>(.*?)</b>', 3)
- If @error Then
- $trafficshare = "N/A"
- Else
- $trafficshare = $aRegEx[0]
- EndIf
- IniWrite(@ScriptDir & "\userdata.ini", "Data " & $account_name, "Gueltig", $gueltig)
- IniWrite(@ScriptDir & "\userdata.ini", "Data " & $account_name, "Traffic", $traffic)
- IniWrite(@ScriptDir & "\userdata.ini", "Data " & $account_name, "TrafficShare", $trafficshare)
- IniWrite(@ScriptDir & "\userdata.ini", "Data " & $account_name, "Dateien", $dateien)
- $read_points_alt = IniRead(@ScriptDir & "\userdata.ini", "Data " & $account_name, "Points", "N/A")
- IniWrite(@ScriptDir & "\userdata.ini", "Data " & $account_name, "Points_alt", $read_points_alt)
- GUICtrlSetTip($lbl_points2, $read_points_alt & " (+" & ($points - $read_points_alt) & ")", "Vorherige Punkte:", 0, 1)
- IniWrite(@ScriptDir & "\userdata.ini", "Data " & $account_name, "Points", $points)
- IniWrite(@ScriptDir & "\userdata.ini", "Data " & $account_name, "Speicher", $speicher)
- IniWrite(@ScriptDir & "\userdata.ini", "Data " & $account_name, "PointsPU", $pointsPU)
- IniWrite(@ScriptDir & "\userdata.ini", "Data " & $account_name, "Letzte Abfrage", _Now())
- GUICtrlSetData($lbl_dateien2, IniRead(@ScriptDir & "\userdata.ini", "Data " & $account_name, "Dateien", "N/A"))
- GUICtrlSetData($lbl_points2, IniRead(@ScriptDir & "\userdata.ini", "Data " & $account_name, "Points", "N/A"))
- GUICtrlSetData($lbl_pointspu2, IniRead(@ScriptDir & "\userdata.ini", "Data " & $account_name, "PointsPU", "N/A"))
- GUICtrlSetData($lbl_speicher2, IniRead(@ScriptDir & "\userdata.ini", "Data " & $account_name, "Speicher", "N/A"))
- GUICtrlSetData($lbl_abfrage2, IniRead(@ScriptDir & "\userdata.ini", "Data " & $account_name, "Letzte Abfrage", "N/A"))
- GUICtrlSetData($lbl_gueltig2, IniRead(@ScriptDir & "\userdata.ini", "Data " & $account_name, "Gueltig", "N/A"))
- GUICtrlSetData($lbl_traffic2, IniRead(@ScriptDir & "\userdata.ini", "Data " & $account_name, "Traffic", "N/A"))
- GUICtrlSetData($lbl_traffic4, IniRead(@ScriptDir & "\userdata.ini", "Data " & $account_name, "TrafficShare", "N/A"))
- ; Dateien auswerten
- If $dateien <> 0 Then
- $seiten = Int($dateien / 500) + 1
- For $s = 2 To $seiten
- Local $hHTTPReq = DllCall($hDll, _
- "ptr", "InternetOpenUrlW", _
- "ptr", $hInternet, _
- "wstr", $sUrl & "?" & $phrase1 & "=" & $account_name & "&password=" & $get_password & "&skip=" & 500 * ($s - 1), _
- "ptr", 0, _
- "dword", 0, _
- "dword", 0, _
- "ptr", 0)
- If @error Then Return SetError(2, 0, 0)
- $hHTTPReq = $hHTTPReq[0]
- Do
- $tNumberOfBytesRead = DllStructCreate("dword")
- $tBuffer = DllStructCreate("byte[" & $iBufferSize & "]")
- Local $avResult = DllCall($hDll, _
- "int", "InternetReadFile", _
- "ptr", $hHTTPReq, _
- "ptr", DllStructGetPtr($tBuffer), _
- "dword", $iBufferSize, _
- "ptr", DllStructGetPtr($tNumberOfBytesRead))
- If @error Or Not $avResult[0] Then ExitLoop
- $iReadBuffer = DllStructGetData($tNumberOfBytesRead, 1)
- $sReadFile &= BinaryToString(BinaryMid(DllStructGetData($tBuffer, 1), 1, $iReadBuffer))
- Until Not $iReadBuffer
- Next
- $aRegEx = StringRegExp($sReadFile, '(?s)Adliste\["(\d*?)"\]\["filename"\] = "(.*?)";.*?\["downloads"\] = "(.*?)";.*?\["sizekb"\] ' & _
- '= "(.*?)";.*?\["lastdownload"\] = (.*?);.*?\["killcode"\] = (.*?);.*?\["filestatusid"\] = (.*?);', 3)
- For $i = 0 To UBound($aRegEx) - 1 Step 7
- GUICtrlSetData($statuslabel, "Dateien werden gespeichert... " & ($i / 7) + 1 & " von " & $dateien)
- IniWrite(@ScriptDir & "\userdata.ini", ($i / 7) + 1 & " " & $account_name, "fileid", $aRegEx[$i])
- IniWrite(@ScriptDir & "\userdata.ini", ($i / 7) + 1 & " " & $account_name, "filename", $aRegEx[$i + 1])
- IniWrite(@ScriptDir & "\userdata.ini", ($i / 7) + 1 & " " & $account_name, "downloads", $aRegEx[$i + 2])
- IniWrite(@ScriptDir & "\userdata.ini", ($i / 7) + 1 & " " & $account_name, "sizekb", $aRegEx[$i + 3])
- If $aRegEx[$i + 2] = 0 Then
- IniWrite(@ScriptDir & "\userdata.ini", ($i / 7) + 1 & " " & $account_name, "lastdownload", "N/A")
- Else
- $time = StringTrimLeft(StringTrimRight($aRegEx[$i + 4], 1), 12)
- $year = StringRight(StringLeft($aRegEx[$i + 4], 11), 4)
- $month = StringRight(StringLeft($aRegEx[$i + 4], 6), 2)
- $day = StringRight(StringLeft($aRegEx[$i + 4], 3), 2)
- $lastdownload = $year & "-" & $month & "-" & $day & " " & $time
- IniWrite(@ScriptDir & "\userdata.ini", ($i / 7) + 1 & " " & $account_name, "lastdownload", $lastdownload)
- EndIf
- $filestatusid = StringTrimRight(StringTrimLeft($aRegEx[$i + 6], 1), 1)
- If $filestatusid = 0 Then
- IniWrite(@ScriptDir & "\userdata.ini", ($i / 7) + 1 & " " & $account_name, "filestatus", "Online")
- ElseIf $filestatusid = 1 Then
- IniWrite(@ScriptDir & "\userdata.ini", ($i / 7) + 1 & " " & $account_name, "filestatus", "Incomplete")
- ElseIf $filestatusid = 2 Then
- IniWrite(@ScriptDir & "\userdata.ini", ($i / 7) + 1 & " " & $account_name, "filestatus", "In Cluster")
- ElseIf $filestatusid = 3 Then
- IniWrite(@ScriptDir & "\userdata.ini", ($i / 7) + 1 & " " & $account_name, "filestatus", "TrafficShare")
- ElseIf $filestatusid = 4 Then
- IniWrite(@ScriptDir & "\userdata.ini", ($i / 7) + 1 & " " & $account_name, "filestatus", "Secure TrafficShare")
- EndIf
- Next
- EndIf
- EndIf
- EndIf
- EndIf
- $get_password = False
- GUICtrlSetData($statuslabel, "")
- EndFunc ;==>_update
- Func _Laden($account_name)
- GUICtrlSetState($deckel, $GUI_SHOW)
- GUICtrlSetData($statuslabel, "Daten werden eingelesen...")
- _GUICtrlListView_DeleteAllItems ($listview)
- $groesse = IniRead(@ScriptDir & "\userdata.ini", "settings", "groesse", 5)
- $farbe0 = IniRead(@ScriptDir & "\userdata.ini", "settings", "farbe0", 0xAAAAAA)
- $grenze1 = IniRead(@ScriptDir & "\userdata.ini", "settings", "grenze1", 60)
- $farbe1 = IniRead(@ScriptDir & "\userdata.ini", "settings", "farbe1", 0xFFC864)
- $grenze2 = IniRead(@ScriptDir & "\userdata.ini", "settings", "grenze2", 80)
- $farbe2 = IniRead(@ScriptDir & "\userdata.ini", "settings", "farbe2", 0xFF6666)
- $farbe3 = IniRead(@ScriptDir & "\userdata.ini", "settings", "farbe3", 0xFF0000)
- $anzahl = IniRead(@ScriptDir & "\userdata.ini", "Data " & $account_name, "Dateien", "error")
- Global $Item[$anzahl + 1]
- For $f = 1 To $anzahl
- $get_fileid = IniRead(@ScriptDir & "\userdata.ini", $f & " " & $account_name, "fileid", "error")
- $get_filename = IniRead(@ScriptDir & "\userdata.ini", $f & " " & $account_name, "filename", "error")
- $get_downloads = IniRead(@ScriptDir & "\userdata.ini", $f & " " & $account_name, "downloads", "error")
- $get_sizekb = IniRead(@ScriptDir & "\userdata.ini", $f & " " & $account_name, "sizekb", "0")
- $get_lastdownload = IniRead(@ScriptDir & "\userdata.ini", $f & " " & $account_name, "lastdownload", "N/A")
- $get_status = IniRead(@ScriptDir & "\userdata.ini", $f & " " & $account_name, "filestatus", "N/A")
- $Item[$f] = GUICtrlCreateListViewItem($get_filename & "|" & $get_sizekb & "|" & $get_downloads & "|" & $get_lastdownload & "|" & $get_status & "|" & $get_fileid, $listview)
- If $get_sizekb < $groesse * 1024 Then
- GUICtrlSetBkColor(-1, $farbe0)
- EndIf
- If _DateDiff("d", $get_lastdownload, _NowCalc()) > $grenze1 Then
- GUICtrlSetBkColor(-1, $farbe1)
- EndIf
- If _DateDiff("d", $get_lastdownload, _NowCalc()) > $grenze2 Then
- GUICtrlSetBkColor(-1, $farbe2)
- EndIf
- If $get_downloads = 0 Then
- GUICtrlSetBkColor(-1, $farbe3)
- EndIf
- Next
- GUICtrlSetData($statuslabel, "")
- GUICtrlSetState($deckel, $GUI_HIDE)
- EndFunc ;==>_Laden
- Func _Links_kopieren()
- GUICtrlSetData($statuslabel, "Links werden gespeichert...")
- $anzahl = IniRead(@ScriptDir & "\userdata.ini", "Data " & GUICtrlRead($account_combo), "Dateien", "error")
- Local $aexport[1]
- For $ex = 1 To $anzahl
- If _GUICtrlListView_GetItemChecked ($listview, $ex - 1) = True Then
- $citem = _GUICtrlListView_GetItemTextArray ($listview, $ex - 1)
- _ArrayAdd($aexport, "http://rapidshare.com/files/" & $citem[6] & "/" & $citem[1])
- EndIf
- Next
- ClipPut(_ArrayToString($aexport, @CRLF, 1, UBound($aexport) - 1))
- GUICtrlSetData($statuslabel, "")
- If UBound($aexport) = 1 Then
- MsgBox(64, "Info", "Es wurden keine Links markiert.")
- ElseIf UBound($aexport) = 2 Then
- MsgBox(64, "Info", "1 Link in die Zwischenablage kopiert.")
- Else
- MsgBox(64, "Info", UBound($aexport) - 1 & " Links in die Zwischenablage kopiert.")
- EndIf
- EndFunc ;==>_Links_kopieren
- ;===============================================================================
- ; Function Name: _RapidPrem_UploadFile
- ; Description:: Upload a file with given Login
- ; Parameter(s): $sFilePath: Path to Uploadfile
- ; $sUsername: Username
- ; $sPassword: Password
- ; [$sServer: [optional] Default Rapidshare Server]
- ; Requirement(s): TCP
- ; Return Value(s): Received Header, @extended is Error return from HTTPRecv function
- ; : False (0) on Failed
- ; : @error codes:
- ; : 1 - couldn't open Internet connection
- ; : 2 - couldn't open url
- ; : 3 - Couldn't connect to rapidshare server on port 80
- ; : 4 - Error by sending string
- ;
- ; Author(s): GtaSpider (Modified By Taek)
- ;===============================================================================
- ;
- Func _RapidPrem_UploadFile($sFilePath, $account_name, $sServer = "1")
- GUICtrlSetData($statuslabel, "Starte Upload...")
- Local $sSendString, $sTemp, $sGet, $sAuth, $hSocket
- $get_password = _StringEncrypt(0, IniRead(@ScriptDir & "\userdata.ini", "Login " & $account_name, "Password", ""), "rslogincrypt")
- If IniRead(@ScriptDir & "\userdata.ini", "Login " & $account_name, "Type", "") = "Collector" Then
- $phrase1 = "username"
- Local $hDll = DllOpen("wininet.dll")
- Local $sUserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1", $hInternet, $hRequest, $iBufferSize = 1024 * 20
- Local $tNumberOfBytesRead = DllStructCreate("dword"), $tBuffer = DllStructCreate("byte[" & $iBufferSize & "]"), $sReadFile, $aRegEx, $aRet[4], $avResult, $iReadBuffer, $iErr
- Local $hInternet = DllCall($hDll, _
- "ptr", "InternetOpen", _
- "wstr", $sUserAgent, _
- "dword", 0, _
- "ptr", 0, _
- "ptr", 0, _
- "dword", 0)
- If @error Then Return SetError(1, 0, 0)
- $hInternet = $hInternet[0]
- Local $hHTTPReq = DllCall($hDll, _
- "ptr", "InternetOpenUrlW", _
- "ptr", $hInternet, _
- "wstr", "https://ssl.rapidshare.com/cgi-bin/collectorszone.cgi?username=" & $account_name & "&password=" & $get_password, _
- "ptr", 0, _
- "dword", 0, _
- "dword", 0, _
- "ptr", 0)
- If @error Then Return SetError(2, 0, 0)
- $hHTTPReq = $hHTTPReq[0]
- Do
- $tNumberOfBytesRead = DllStructCreate("dword")
- $tBuffer = DllStructCreate("byte[" & $iBufferSize & "]")
- Local $avResult = DllCall($hDll, _
- "int", "InternetReadFile", _
- "ptr", $hHTTPReq, _
- "ptr", DllStructGetPtr($tBuffer), _
- "dword", $iBufferSize, _
- "ptr", DllStructGetPtr($tNumberOfBytesRead))
- If @error Or Not $avResult[0] Then ExitLoop
- $iReadBuffer = DllStructGetData($tNumberOfBytesRead, 1)
- $sReadFile &= BinaryToString(BinaryMid(DllStructGetData($tBuffer, 1), 1, $iReadBuffer))
- Until Not $iReadBuffer
- $aRegEx = StringRegExp($sReadFile, '(?s)"post" action="(.*?)" enctype="multipart/form-data"', 3)
- $serverconnection = $aRegEx[0]
- $aRegEx = StringRegExp($sReadFile, 'name="freeaccountid" value="(.*?)"', 3)
- $loginname = $aRegEx[0]
- Else
- $phrase1 = "login"
- $loginname = $account_name
- $serverconnection = "rs" & $sServer & ".rapidshare.com"
- EndIf
- $hSocket = TCPConnect(TCPNameToIP($serverconnection), 80)
- If @error Then Return SetError(3, @error, 0)
- $sTemp = @CRLF & _
- "----------" & _GetTime() & @CRLF & _
- 'Content-Disposition: form-data; name="toolmode2"' & @CRLF & _
- "" & @CRLF & _
- "1" & @CRLF & _
- "----------" & _GetTime() & @CRLF & _
- 'Content-Disposition: form-data; name="filecontent"; filename="' & $sFilePath & '"' & @CRLF & _
- "Content-Type: multipart/form-data" & @CRLF & _
- "Content-Transfer-Encoding: binary" & @CRLF & @CRLF & _
- FileRead($sFilePath) & @CRLF & _
- "----------" & _GetTime() & @CRLF & _
- 'Content-Disposition: form-data; name="' & $phrase1 & '"' & @CRLF & _
- "" & @CRLF & _
- $loginname & @CRLF & _
- "----------" & _GetTime() & @CRLF & _
- 'Content-Disposition: form-data; name="password"' & @CRLF & _
- "" & @CRLF & _
- $get_password & @CRLF & _
- "----------" & _GetTime() & @CRLF
- $sSendString = "POST /cgi-bin/upload.cgi HTTP/1.0" & @CRLF & _
- "Connection: Keep-Alive" & @CRLF & _
- "Content-Type: multipart/form-data; boundary=--------" & _GetTime() & @CRLF & _
- "Content-Length: " & StringLen($sTemp) - 2 & @CRLF & _
- "Host: " & $serverconnection & @CRLF & _
- "Keep-Alive: 300" & @CRLF & _
- "User-Agent: RapidUploader[v1,2]" & @CRLF & $sTemp
- ClipPut($get_password)
- _HTTPSend($sSendString, $hSocket, Round(StringLen($sTemp) / 100))
- If @error Then Return SetError(4, @error, 0)
- $sRecv = _HTTPRecv($hSocket)
- GUICtrlSetData($statuslabel, "")
- Return SetError(0, @error, $sRecv)
- EndFunc ;==>_RapidPrem_UploadFile
- Func _timeleft()
- $countfrom = IniRead(@ScriptDir & "\userdata.ini", "Data 4all", "autoupdate", "0") * 60
- $vorbei = Int(TimerDiff($startTimer) / 1000)
- $min = Int(($countfrom - $vorbei) / 60)
- $sec = $countfrom - $vorbei - (60 * $min)
- GUICtrlSetData($auto_update_time, StringFormat('%02u', $min) & ":" & StringFormat('%02u', $sec))
- EndFunc ;==>_timeleft
- ;RapidDateToCalc (e.g.: Sun, 14. Sep 2008 --> 2008/09/14)
- ;by GtaSpider
- Func _RapidDateToCalc($sRapidDate)
- Local $aMonthNumberAbbrev[13] = ["", "Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec" ]
- $sRapidDate = StringSplit(StringTrimLeft($sRapidDate, StringInStr($sRapidDate, ",") + 1), " ")
- Local $sRet = StringTrimLeft("00", StringLen(StringTrimRight($sRapidDate[1], 1))) & StringTrimRight($sRapidDate[1], 1) & ".", $i
- For $i = 1 To 12
- If $sRapidDate[2] = StringLeft($aMonthNumberAbbrev[$i], 3) Then $sRet &= StringTrimLeft("00", StringLen($i)) & $i & "."
- Next
- $sRet &= $sRapidDate[3]
- Return $sRet
- EndFunc ;==>_RapidDateToCalc
- ;HTTP Send
- ;by GtaSpider
- Func _HTTPSend($sSendString, $hSocket, $iBufferSize = 2904)
- Local $sBuffer = $sSendString, $iProz
- If $iBufferSize < 1024 Then $iBufferSize = 1024
- While StringLen($sBuffer)
- $iSend = 0
- If $iBufferSize >= StringLen($sBuffer) Then $iBufferSize = StringLen($sBuffer) + 2
- While $iSend < $iBufferSize
- $iSend += TCPSend($hSocket, StringLeft($sBuffer, $iBufferSize))
- If @error Then ExitLoop 2
- WEnd
- $sBuffer = StringTrimLeft($sBuffer, $iBufferSize)
- $iProz = Round(100 - (100 * StringLen($sBuffer) / StringLen($sSendString)))
- GUICtrlSetData($hProg_Downl, $iProz)
- GUICtrlSetData($hLab_DownlPrz, $iProz & "%")
- WEnd
- EndFunc ;==>_HTTPSend
- ;HTML Recv
- ;by GtaSpider
- Func _HTTPRecv($hSocket, $iSleep = 50, $iTimeOut = 20000, $sDwn = False, $iForceBinary = 0, $iBufferSize = 1024)
- Local $sRecv, $sRet, $iErr = 0, $hTi, $hFiOp, $sFirstRecv, $iLen = 0, $iFirst = True
- If $iTimeOut > 0 Then $hTi = TimerInit()
- If $sDwn Then $hFiOp = FileOpen($sDwn, 17)
- If $hFiOp = -1 Then $bExist = False
- While 1
- If $iTimeOut > 0 And TimerDiff($hTi) > $iTimeOut Then ExitLoop
- $sRecv = TCPRecv($hSocket, $iBufferSize, $iForceBinary)
- $iErr = @error
- If $iErr Then ExitLoop
- If $sDwn And (Not $bDownloadActive) Then ExitLoop
- While StringLen($sRecv)
- If $iForceBinary Then $sRecv = BinaryToString($sRecv)
- If $iFirst Then
- If Not StringInStr($sRecv, "HTTP/1.1 200 OK") Then
- TCPCloseSocket($hSocket)
- If $sDwn And $bExist Then FileClose($hFiOp)
- Return SetError(1, 1, "ERR:" & $sRecv)
- EndIf
- $sFirstRecv = $sRecv
- If $sDwn Then $sRecv = StringTrimLeft($sRecv, StringInStr($sRecv, @CRLF & @CRLF) + 4)
- $iFirst = False
- EndIf
- If $sDwn Then
- $iLen += StringLen($sRecv)
- If $bExist Then FileWrite($hFiOp, $sRecv)
- Call("__SetProgress", $sFirstRecv, $iLen)
- EndIf
- If Not $sDwn Then $sRet &= $sRecv
- $sRecv = TCPRecv($hSocket, $iBufferSize, $iForceBinary)
- $iErr = @error
- If $iErr Then ExitLoop 2
- If $iTimeOut > 0 And TimerDiff($hTi) > $iTimeOut Then ExitLoop 2
- If $sDwn And (Not $bDownloadActive) Then ExitLoop 2
- WEnd
- Sleep($iSleep)
- WEnd
- TCPCloseSocket($hSocket)
- If $sDwn And $bExist Then FileClose($hFiOp)
- If $iForceBinary Then $sRet = "0x" & StringReplace($sRet, "0x", "")
- If $iTimeOut > 0 And TimerDiff($hTi) > $iTimeOut Then Return SetError(2, 0, "Timeout")
- If $iErr Then Return SetError(3, $iErr, $sRet)
- If Not $bDownloadActive Then Return SetError(4, 0, 0)
- Return $sRet
- EndFunc ;==>_HTTPRecv
- ;Function for Download to show a progress
- ;by GtaSpider
- Func __SetProgress($sRecv, $iLen)
- Local $aRegEx, $iProz
- $aRegEx = StringRegExp($sRecv, "(?s)(.*?Content-Length: (.*?)" & @CRLF & @CRLF & ")", 3)
- If UBound($aRegEx) < 2 Then Return GUICtrlSetData($hLab_DownlPrz, "?")
- $iProz = Round(100 * $iLen / $aRegEx[1])
- If GUICtrlRead($hLab_DownlPrz) = $iProz & "%" Then Return 0
- GUICtrlSetData($hProg_Downl, $iProz)
- GUICtrlSetData($hLab_DownlPrz, $iProz & "%")
- EndFunc ;==>__SetProgress
- ;GetTime
- ;by GtaSpider
- Func _GetTime()
- Return @MON & @MDAY & StringRight(@YEAR, 2) & @HOUR & @MIN & @SEC & "044" ;Eigentlich MSec aber warte auf naecchste Stable
- EndFunc ;==>_GetTime
- #cs
- Func On_WM_DROPFILES($hWnd, $msg, $wParam, $lParam)
- Local $tDrop, $aRet, $iCount
- ;string buffer for file path
- $tDrop = DllStructCreate("char[260]")
- ;get file count
- $aRet = DllCall("shell32.dll", "int", "DragQueryFile", _
- "hwnd", $wParam, _
- "uint", -1, _
- "ptr", DllStructGetPtr($tDrop), _
- "int", DllStructGetSize($tDrop) _
- )
- $iCount = $aRet[0]
- ;get file paths
- For $i = 0 To $iCount - 1
- $aRet = DllCall("shell32.dll", "int", "DragQueryFile", _
- "hwnd", $wParam, _
- "uint", $i, _
- "ptr", DllStructGetPtr($tDrop), _
- "int", DllStructGetSize($tDrop) _
- )
- $pfad_uebergabe = DllStructGetData($tDrop, 1)
- _GUICtrlListView_BeginUpdate($uploadqueue)
- If StringInStr(StringRight($pfad_uebergabe, 4), ".") Then GUICtrlCreateListViewItem($pfad_uebergabe, $uploadqueue) ;Dateiname dem ListView hinzufügen
- _GUICtrlListView_EndUpdate($uploadqueue)
- Next
- ;finalize
- DllCall("shell32.dll", "int", "DragFinish", "hwnd", $wParam)
- Return
- EndFunc ;==>On_WM_DROPFILES
- Func OnAutoItExit()
- _GUICtrlListView_UnRegisterSortCallBack($listview)
- TCPShutdown()
- EndFunc ;==>OnAutoItExit
- #ce
Advertisement
Add Comment
Please, Sign In to add comment