;------------NEWS UPLOAD SYSTEM
on *:text:!addsitenews*:#tr.priv: {
if ($sockopen(ftp)) sockclose ftp
set %2news $2-
write -il59 index2.html
write -il43 wars.html | |
write -il44 wars.html TeamTurkey |
write -il45 wars.html %enemyclan |
write -il46 wars.html $date |
write -il47 wars.html %player1 $+ , %player2 $+ , %player3 |
write -il48 wars.html %eplayer1 $+ , %eplayer2 $+ , %eplayer3 |
write -il49 wars.html %1map %1score |
write -il50 wars.html %2map %2score |
write -il51 wars.html %3map %3score |
write -il52 wars.html %comment |
write -il53 wars.html
msg #tr.priv 0,1[ 14MATCH REPORT 0] 0-14 The match is being uploaded to the site. Please be patient...
set %fileToUpload wars.html
sockopen ftp alpro.al.funpic.de 21
}
on *:sockread:ftp:{
if ($sockopen(ftpa)) sockclose ftpa
sockread %temp
echo -a %temp
; LOGIN
if (220* iswm %temp) { sockwrite -nt ftp USER ***** }
if (331* iswm %temp) { sockwrite -nt ftp PASS ***** }
;Einstellungen, lösche bestehende Datei...
if (230* iswm %temp) {
sockwrite -nt ftp TYPE I
sockwrite -nt ftp CWD stp
sockwrite -nt ftp DELE %fileToUpload
sockwrite -nt ftp PASV
}
;Lege neue Datei an...
if (227* iswm %temp) {
tokenize 44 $remove($gettok(%temp,-1,32),$chr(40),$chr(41),.)
sockwrite -nt ftp REST 0
sockwrite -nt ftp STOR %fileToUpload
sockopen ftpa $+($1,.,$2,.,$3,.,$4) $calc($5 * 256 + $6)
}
if (226* iswm %temp) {
sockwrite -n QUIT
}
}
; Speicher Daten
on *:SOCKOPEN:ftpa:{
if ($sockerr) { echo -s Ein Fehler ist aufgetreten. | return }
var %a = 1, %file
echo -s sending lines
if (%fileToUpload == wars.html) %file = $v2
elseif (%fileToUpload == index2.html) %file = $v2
while ($lines(%file) >= %a) {
sockwrite ftpa $read(%file,%a) $+ $crlf
inc %a
}
echo -s $calc(%a -1) lines sent
sockclose ftpa
}