Vergessen habe ich es nicht, nur mir hat die Zeit gefehlt. Aber hier is das Resultat. Es entspricht der Beschreibung wie ich sie verstanden habe und enthält bisher noch keine Features. Wenn de noch was brauchst, meld dich hier. Bin jetzt aber erst mal für ne Woche wech, Ski-Urlaub.
Code:
Const dlstatINI = "dlulstat.ini"
Const actChan = "#progging_newbies"
Sub Init()
Script "Down-Up-Stat Script by HAPM"
Hook "Chan_Msg"
SpreadFlagMessage 0, "+m", "7*** Down-Up-Stat Script by HAPM loaded"
End Sub
Sub Chan_Msg(Chan, Nick, RegUser, Line)
Select Case LCase(Param(Line,1))
Case "!dl"
If Not LCase(Param(Line,2)) = "all" Then
AddDownload Nick, Line
Exit Sub
End If
ShowDownloads Nick
Case "!dldel"
DelDownload Nick, Line
Case "!ul"
If Not LCase(Param(Line,2)) = "all" Then
AddUpload Nick, Line
Exit Sub
End If
ShowUpload Nick
Case "!uldel"
DelUpload Nick, Line
End Select
End Sub
Sub AddDownload(Nick, Line)
Dim DLCount
If Param(Line, 2) = "" Then
SendLine "PRIVMSG " & Nick & " :Du hasst vergessen den Nick anzugeben, der etwas runterlädt.", 3
SendLine "PRIVMSG " & Nick & " :Syntax: !dl [Ziel] [Quelle] [Datei]", 3
Exit Sub
End If
If Param(Line, 3) = "" Then
SendLine "PRIVMSG " & Nick & " :Du hasst vergessen den Nick anzugeben, von dem runtergeladen wird.", 3
SendLine "PRIVMSG " & Nick & " :Syntax: !dl [Ziel] [Quelle] [Datei]", 3
Exit Sub
End If
If Param(Line, 4) = "" Then
SendLine "PRIVMSG " & Nick & " :Du hasst vergessen die Datei anzugeben, die runtergeladen wird.", 3
SendLine "PRIVMSG " & Nick & " :Syntax: !dl [Ziel] [Quelle] [Datei]", 3
Exit Sub
End If
DLCount = ReadINIString("Download","DLCount",0,dlstatINI)
DLCount = DLCount*1 + 1
WriteINIString "Download","DLCount", DLCount, dlstatINI
WriteINIString "Download",DLCount&"Data", GetRest(Line,2), dlstatINI
WriteINIString "Download",DLCount&"Time", Now, dlstatINI
SendLine "PRIVMSG " & Nick & " :Download der Datei "&Param(Line,4)&" von "&Param(Line,2)&" bei "&Param(Line,3)&" wurde hinzugefügt.",3
End Sub
Sub ShowDownloads(Nick)
Dim DLCount, DLData, DLTime
DLCount = ReadINIString("Download","DLCount",0,dlstatINI)
If DLCount <= 0 Then
SendLine "PRIVMSG " & Nick & " :Aktuell sind keine Downloads bei mir gespeichert.", 3
End If
For i = 1 To DLCount
DLData = ReadINIString("Download",i&"Data","",dlstatINI)
DLTime = ReadINIString("Download",i&"Time","",dlstatINI)
SendLine "PRIVMSG "&Nick&" :"&i&") "&Param(DLData,1)&" saugt bei "&Param(DLData,2)&" die Datei "&Param(DLData,3)&". Gestartet: "&DLTime, 3
Next
End Sub
Sub DelDownload(Nick,Line)
Dim DLCount, DLData, DLTime
If Param(Line,2) = "" Then
SendLine "PRIVMSG " & Nick & " :Du hasst vergessen die Nummer des zu löschenden Downloads anzugeben.", 3
SendLine "PRIVMSG " & Nick & " :Syntax: !dldel [DelNr]", 3
Exit Sub
End If
If Not IsNumeric(Param(Line,2)) Then
SendLine "PRIVMSG " & Nick & " :Du die Nummer des Downloads angeben, keinen Text.", 3
SendLine "PRIVMSG " & Nick & " :Syntax: !dldel [DelNr]", 3
Exit Sub
End If
DLCount = ReadINIString("Download","DLCount",0,dlstatINI)
If DLCount <= 0 Then
SendLine "PRIVMSG " & Nick & " :Aktuell sind keine Downloads bei mir gespeichert.", 3
Exit Sub
End If
If DLCount < Param(Line,2) Then
SendLine "PRIVMSG " & Nick & " :Der Download mit der angegebenen Nr. existiert nicht.", 3
Exit Sub
End If
DLData = ReadINIString("Download",Param(Line,2)&"Data","",dlstatINI)
DLTime = ReadINIString("Download",Param(Line,2)&"Time","",dlstatINI)
WriteINIString "Download", Param(Line,2)&"Data", ReadINIString("Download", DLCount&"Data", "", dlstatINI), dlstatINI
WriteINIString "Download", Param(Line,2)&"Time", ReadINIString("Download", DLCount&"Time", "", dlstatINI), dlstatINI
DeleteINIString "Download", DLCount&"Data", dlstatINI
DeleteINIString "Download", DLCount&"Time", dlstatINI
DLCount = DLCount - 1
WriteINIString "Download", "DLCount", DLCount, dlstatINI
SendLine "PRIVMSG " & Nick & " :Der Download mit der Nummer "&Param(Line,2)&" wurde gelöscht.", 3
SendLine "PRIVMSG " & actChan & " :Download beendet!!! Datei: "&Param(DLData,3)&" | Quelle: "&Param(DLData,1)&" | Ziel: "&Param(DLData,2)&" | Gestartet: "&DLTime, 3
End Sub
Sub AddUpload(Nick, Line)
Dim ULCount
If Param(Line, 2) = "" Then
SendLine "PRIVMSG " & Nick & " :Du hasst vergessen den Nick anzugeben, der etwas hochlädt.", 3
SendLine "PRIVMSG " & Nick & " :Syntax: !ul [Quelle] [Ziel] [Datei]", 3
Exit Sub
End If
If Param(Line, 3) = "" Then
SendLine "PRIVMSG " & Nick & " :Du hasst vergessen den Nick anzugeben, von dem hochgeladen wird.", 3
SendLine "PRIVMSG " & Nick & " :Syntax: !ul [Quelle] [Ziel] [Datei]", 3
Exit Sub
End If
If Param(Line, 4) = "" Then
SendLine "PRIVMSG " & Nick & " :Du hasst vergessen die Datei anzugeben, die hochgeladen wird.", 3
SendLine "PRIVMSG " & Nick & " :Syntax: !ul [Quelle] [Ziel] [Datei]", 3
Exit Sub
End If
ULCount = ReadINIString("Upload","ULCount",0,dlstatINI)
ULCount = ULCount*1 + 1
WriteINIString "Upload","ULCount", ULCount, dlstatINI
WriteINIString "Upload",ULCount&"Data", GetRest(Line,2), dlstatINI
WriteINIString "Upload",ULCount&"Time", Now, dlstatINI
SendLine "PRIVMSG " & Nick & " :Upload der Datei "&Param(Line,4)&" von "&Param(Line,2)&" zu "&Param(Line,3)&" wurde hinzugefügt.",3
End Sub
Sub ShowUpload(Nick)
Dim ULCount, ULData, ULTime
ULCount = ReadINIString("Upload","ULCount",0,dlstatINI)
If ULCount <= 0 Then
SendLine "PRIVMSG " & Nick & " :Aktuell sind keine Uploads bei mir gespeichert.", 3
End If
For i = 1 To ULCount
ULData = ReadINIString("Upload",i&"Data","",dlstatINI)
ULTime = ReadINIString("Upload",i&"Time","",dlstatINI)
SendLine "PRIVMSG "&Nick&" :"&i&") "&Param(ULData,1)&" lädt bei "&Param(ULData,2)&" die Datei "&Param(ULData,3)&" hoch. Gestartet: "&ULTime, 3
Next
End Sub
Sub DelUpload(Nick,Line)
Dim ULCount, ULData, ULTime
If Param(Line,2) = "" Then
SendLine "PRIVMSG " & Nick & " :Du hasst vergessen die Nummer des zu löschenden Uploads anzugeben.", 3
SendLine "PRIVMSG " & Nick & " :Syntax: !uldel [DelNr]", 3
Exit Sub
End If
If Not IsNumeric(Param(Line,2)) Then
SendLine "PRIVMSG " & Nick & " :Du die Nummer des Uploads angeben, keinen Text.", 3
SendLine "PRIVMSG " & Nick & " :Syntax: !uldel [DelNr]", 3
Exit Sub
End If
ULCount = ReadINIString("Upload","ULCount",0,dlstatINI)
If ULCount <= 0 Then
SendLine "PRIVMSG " & Nick & " :Aktuell sind keine Uploads bei mir gespeichert.", 3
Exit Sub
End If
If ULCount < Param(Line,2) Then
SendLine "PRIVMSG " & Nick & " :Der Upload mit der angegebenen Nr. existiert nicht.", 3
Exit Sub
End If
ULData = ReadINIString("Upload",Param(Line,2)&"Data","",dlstatINI)
ULTime = ReadINIString("Upload",Param(Line,2)&"Time","",dlstatINI)
WriteINIString "Upload", Param(Line,2)&"Data", ReadINIString("Upload", ULCount&"Data", "", dlstatINI), dlstatINI
WriteINIString "Upload", Param(Line,2)&"Time", ReadINIString("Upload", ULCount&"Time", "", dlstatINI), dlstatINI
DeleteINIString "Upload", ULCount&"Data", dlstatINI
DeleteINIString "Upload", ULCount&"Time", dlstatINI
ULCount = ULCount - 1
WriteINIString "Upload", "ULCount", ULCount, dlstatINI
SendLine "PRIVMSG " & Nick & " :Der Upload mit der Nummer "&Param(Line,2)&" wurde gelöscht.", 3
SendLine "PRIVMSG " & actChan & " :Upload beendet!!! Datei: "&Param(ULData,3)&" | Quelle: "&Param(ULData,1)&" | Ziel: "&Param(ULData,2)&" | Gestartet: "&ULTime, 3
End Sub