MIRCstats Auto Update

NEcRoPhEuS Messages postés 1 Date d'inscription vendredi 21 mars 2003 Statut Membre Dernière intervention 11 septembre 2003 - 11 sept. 2003 à 13:46
cs_jhd Messages postés 338 Date d'inscription mardi 13 août 2002 Statut Membre Dernière intervention 29 novembre 2007 - 12 sept. 2003 à 13:23
J'ai trouvé sur le net un script qui est supposé mettre à jour les statistiques d'un salon et de les envoyer sur un ftp en même temps, seulement cette version date de 2000 et lorsque j'essaye de faire un update cela me dit "Cannot find mIRCstats program files" je suppose que ca ne fonctionne pas car le script est pas adapté aux nouvelles version de mIRC et également à la nouvelle version de mIRCstats donc si quelqu'un pouvait regarder ce qui ne va pas dans ce script car pour ma part je m'y connais pas assez :s

[ MSTATS.MRC ]

dialog ms.config {
title "mIRCstats Automation Control Panel"
size -1 -1 640 370

box "Update Freq", 100, 5 5 130 78,

radio "Every", 102, 10 23 50 15,
edit "", 103, 60 20 30 21,
text "hours", 104, 92 23 40 15,

radio "Every", 105, 10 49 50 15,
edit "", 106, 60 46 30 21,
text "days", 107, 92 49 40 15,

box "mIRCstats program location", 200, 140 5 495 63,

edit "", 201, 145 19 240 23, autohs
button "Browse", 202, 390 20 50 21,
check "Automatic Operation", 203, 146 46 120 15,
check "Reuse Chan Settings", 204, 291 46 120 15,

box " Configuration Options ", 300, 5 75 631 211,

text "Channel:", 301, 11 88 50 15,
edit "", 302, 10 100 100 23, autohs
list 303, 10 121 100 88, vsbar

button "Save", 304, 113 100 45 23,
button "Delete", 305, 113 126 45 21,
button "Update", 306, 113 160 45 21,
button "Upload", 307, 113 184 45 21,

text "ftp hostname:", 308, 165 88 120 15,
check "Enable FTP", 326, 327 87 80 15, left
edit "", 309, 164 101 244 23, autohs

text "ftp login:", 310, 165 127 100 15,
edit "", 311, 164 140 122 23, autohs

text "password:", 312, 292 127 100 15,
edit "", 313, 291 140 117 23, autohs pass

text "Remote location:", 314, 165 166 100 15,
edit "", 315, 164 179 122 23, autohs

text "Config file:", 316, 292 166 100 15,
edit "", 317, 291 179 117 23, autohs

text "Log file:", 318, 11 205 100 15,
edit "", 319, 10 218 145 23, autohs
button "Browse", 320, 160 219 45 21,

text ".html file:", 321, 213 205 100 15,
edit "", 322, 212 218 145 23, autohs
button "Browse", 323, 362 219 45 21,

check "Set topic on update:", 324, 11 244 160 15,
check "Say in Channel:", 337, 170 244 140 15,
edit "", 325, 10 258 398 23, autohs, disable

text "bot ftp:", 327, 415 88 120 15,
check "Enable log DL", 329, 538 87 91 15, left
edit "", 328, 414 101 216 23, autohs

text "bot ftp login:", 330, 415 127 100 15,
edit "", 331, 414 140 108 23, autohs

text "bot ftp password:", 332, 528 127 100 15,
edit "", 333, 527 140 103 23, autohs pass

text "bot log path+file:", 334, 415 166 180 15,
edit "", 335, 414 179 216 23, autohs
check "Incremental Log", 336, 534 165 95 15, left

box "", 400, 5 289 630 45,

button "Update + Upload All", 401, 12 303 110 23,
button "Save Options", 402, 127 303 90 23,
button "Ok", 1, 348 303 90 23, default, ok
button "Cancel", 403, 443 303 90 23, cancel
button "Help Me!", 404, 538 303 90 23,

box "", 50, 5 335 630 27,
text "Welcome to mIRCstats Automation Control Panel", 51, 12 345 433 15,
}

on 1:DIALOG:ms.config:init:0 {
did -o ms.config 103 1 $readini mircstats.ini Global FreqHour
did -o ms.config 106 1 $readini mircstats.ini Global FreqDay
if ($readini mircstats.ini Global FreqType == h) {
did -u ms.config 106
did -b ms.config 106
did -c ms.config 102
}
else {
did -u ms.config 103
did -b ms.config 103
did -c ms.config 105
}
did -o ms.config 201 1 $readini mircstats.ini Global Program
if ($readini mircstats.ini Global State == a) { did -c ms.config 203 }
if ($readini mircstats.ini Global Reuse == 1) { did -c ms.config 204 }
set %ms.chans $readini mircstats.ini Global Chans
if (%ms.chans != $null) {
set %ms.chancount $numtok(%ms.chans, 44)
:ms.cPchanloop
did -a ms.config 303 $gettok(%ms.chans, %ms.chancount, 44)
dec %ms.chancount
if (%ms.chancount > 0) { goto ms.cPchanloop }
unset %ms.chan*
did -f ms.config 1
}
did -c ms.config 326
/ms.botstate d
}

on 1:DIALOG:ms.config:sclick:*: {
if ($did == 102) {
if ($did(102).state == 1) {
did -e ms.config 103
did -u ms.config 106
did -b ms.config 106
}
}
if ($did == 105) {
if ($did(105).state == 1) {
did -e ms.config 106
did -u ms.config 103
did -b ms.config 103
}
}
if ($did == 202) { .timer -m 1 1 /ms.browse 201 Select Location of mIRCstats program file: }
if ($did == 303) {
if ($did(302).text != $null) { /ms.saveChan $did(302).text }
/ms.loadChan $did(303, $did(303, 1).sel).text
}
if ($did == 304) { /ms.saveChan $did(302).text }
if ($did == 305) { /ms.delChan $did(302).text $did(303, 1).sel }
if ($did == 306) {
unset %ms.dAfullupdate
if ($did(329).state == 1) { /ms.botdownload $did(302).text }
else { /ms.update $did(302).text }
}
if ($did == 307) {
unset %ms.dAfullupdate
if ($readini mircstats.ini $did(302).text ftpState == e) { /ms.upload $did(302).text }
}
if ($did == 320) { .timer -m 1 1 /ms.browse 319 Select Location of Log file for this channel: }
if ($did == 323) { .timer -m 1 1 /ms.browse 322 Select Location of .html file for this channel: }
if ($did == 324) { if (($did(324).state 1) && ($did(337).state 0)) { did -e ms.config 325 } if (($did(324).state 0) && ($did(337).state 0)) { did -b ms.config 325 }
}
if ($did == 337) { if (($did(337).state 1) && ($did(324).state 0)) { did -e ms.config 325 } if (($did(337).state 0) && ($did(324).state 0)) { did -b ms.config 325 }
}
if ($did == 326) {
if ($did(326).state == 1) { /ms.ftpstate e }
else { /ms.ftpstate d }
}
if ($did == 329) {
if ($did(329).state == 1) { /ms.botstate e }
else { /ms.botstate d }
}
if ($did == 401) { set %ms.FUnotbytimer 1 | /ms.doall }
if ($did == 402) { /ms.saveOpts }
if ($did == 404) { run http://mAC.scriptmania.com/helplink.html }
if ($did == 1) {
/ms.saveOpts
/ms.saveChan $did(302).text
if ($did(203).state == 1) { /ms.enable }
else { /ms.disable }
}
}

on 1:DIALOG:ms.config:edit:*: {
if ($did == 302) {
if (($chr(44) !isin $did(302).text) && ($left($did(302).text, 1) == $chr(35)) && ($len($did(302).text) > 1)) {
set %ms.ceChanList $readini mircstats.ini Global Chans
if ($istok(%ms.ceChanList, $did(302).text, 44) == $false) { /ms.newChan $did(302).text }
unset %ms.ceChanList
}
if ($did == 335) {
set %ms.botLogName $did(335).text
set %ms.botLogName $gettok(%ms.botLogName, $numtok(%ms.botLogName, 47), 47)
did -o ms.config 319 1 $mircdir $+ %ms.botLogName
unset %ms.botLogName
}
}
}

on 1:CONNECT: {
if ($readini mircstats.ini Global State == a) { ms.enable }
}

on 1:TEXT:*:#: { if (($1 !nextupdate) && ($ms.isInChans($chan) $true)) {
set %ms.nUtemp $readini mircstats.ini Global LTS
set %ms.nUtemp $gettok(%ms.nUtemp, 2, 32)
if ($timer(.ms.enable) != $null) { set %ms.nUtemp $calc((%ms.nUtemp + $timer(.ms.enable).delay) - $ctime) }
elseif ($timer(.ms.autoupdate) != $null) { set %ms.nUtemp $calc((%ms.nUtemp + $timer(.ms.autoupdate).delay) - $ctime) }
notice $nick 2[12m10A12C2] 6-> 14Next $chan Stats Update in $duration(%ms.nUtemp)
unset %ms.nUtemp
}
}

on 1:LOAD: { load -rs mstats1.mrc }

menu status,menubar {
-
mIRCstats
.Control Panel:/mircstats
.Automatic ( $+ $ms.trueState $+ )
..$ms.state:/ms.changestate
.Update + Upload All:/ms.doallpopup
-
}

[ MSTATS1.MRC ]

alias /mircstats {
if ($readini mircstats.ini Global Init == $null) { /ms.init }
dialog -m ms.config ms.config
}

alias ms.init {
writeini mircstats.ini Global Init y
writeini mircstats.ini Global FreqType h
writeini mircstats.ini Global FreqHour 1
writeini mircstats.ini Global FreqDay 1
writeini mircstats.ini Global State m
echo -s 2[12m10A12C2] 6-> 14Searching for mIRCstats.exe
set %ms.programloc $findfile($left($mircdir, 3), mircstats.exe, 1)
if (%ms.programloc != $null) {
echo -s 2[12m10A12C2] 6-> 14Found mIRCstats.exe @ %ms.programloc
writeini mircstats.ini Global Program %ms.programloc
}
else { echo -s 2[12m10A12C2] 6-> 14mIRCstats.exe not found! }
unset %ms.programloc
}

alias ms.browse {
set %ms.browsetemp $dir=" $2- " c:\
if (%ms.browsetemp != $null) { did -o ms.config $1 1 %ms.browsetemp }
unset %ms.browsetemp
}

alias ms.saveChan {
if (($chr(44) isin $1) || ($chr(35) != $left($1, 1)) || ($len($1) < 2)) { $ms.status(Error: Invalid channel name) | did -f ms.config 302 | return }
if ($did(326).state == 1) {
if ($did(309).text == $null) { $ms.status(Error: Please enter FTP hostname) | did -f ms.config 309 | return }
if ($did(311).text == $null) { $ms.status(Error: Please enter FTP username) | did -f ms.config 311 | return }
if ($did(313).text == $null) { $ms.status(Error: Please enter FTP password) | did -f ms.config 313 | return }
if ($did(315).text == $null) { $ms.status(Error: Please enter Remote Location) | did -f ms.config 315 | return }
writeini mircstats.ini $1 ftpState e
writeini mircstats.ini $1 ftpHost $did(309).text
writeini mircstats.ini $1 ftpLogin $did(311).text
writeini mircstats.ini $1 ftpPassword $did(313).text
writeini mircstats.ini $1 RemoteLocation $did(315).text
}
else { writeini mircstats.ini $1 ftpState d }
if ($did(317).text == $null) { $ms.status(Error: Please enter Configuration Filename) | did -f ms.config 317 | return } if ($did(329).state 0) { if ($did(319).text $null) { $ms.status(Error: Please enter Log Filename) | did -f ms.config 319 | return } }
if ($did(322).text == $null) { $ms.status(Error: Please enter .html Filename) | did -f ms.config 322 | return }
if ($did(329).state == 1) {
if ($did(328).text == $null) { $ms.status(Error: Please enter bot FTP hostname) | did -f ms.config 328 | return }
if ($did(331).text == $null) { $ms.status(Error: Please enter bot FTP username) | did -f ms.config 331 | return }
if ($did(333).text == $null) { $ms.status(Error: Please enter bot FTP password) | did -f ms.config 333 | return }
if ($did(335).text == $null) { $ms.status(Error: Please enter bot log path + filename) | did -f ms.config 335 | return }
writeini mircstats.ini $1 botState e
writeini mircstats.ini $1 botftpHost $did(328).text
writeini mircstats.ini $1 botLogin $did(331).text
writeini mircstats.ini $1 botPW $did(333).text
writeini mircstats.ini $1 botLog $did(335).text
writeini mircstats.ini $1 botIncLog $did(336).state
writeini mircstats.ini $1 Log $mircdir $+ $gettok($did(335).text, $numtok($did(335).text, 47), 47)
if ($did == 304) { did -o ms.config 319 1 $mircdir $+ $gettok($did(335).text, $numtok($did(335).text, 47), 47) }
}
else {
writeini mircstats.ini $1 botState d
writeini mircstats.ini $1 Log $did(319).text
}
writeini mircstats.ini $1 Config $did(317).text
writeini mircstats.ini $1 HTML $did(322).text
if ($did(325).text != $null) {
writeini mircstats.ini $1 Topic $did(325).text
writeini mircstats.ini $1 SetTopic $did(324).state
writeini mircstats.ini $1 SayTopic $did(337).state
}
else {
writeini mircstats.ini $1 SetTopic 0
writeini mircstats.ini $1 SayTopic 0
did -u ms.config 324
did -b ms.config 325
}
if ($ms.isInChans($1) == $false) {
did -a ms.config 303 $1
did -c ms.config 303 $did(303).lines
writeini mircstats.ini Global Chans $1 $+ $chr(44) $+ $readini mircstats.ini Global Chans
$ms.status(Successfully saved new [ $1 ] channel info)
}
else { $ms.status(Successfully saved [ $1 ] channel info changes) }
}

alias ms.loadChan {
did -o ms.config 302 1 $1
if ($readini mircstats.ini $1 ftpState == e) {
did -c ms.config 326
/ms.ftpstate e
}
else {
did -u ms.config 326
/ms.ftpstate d
}
did -o ms.config 309 1 $readini mircstats.ini $1 ftpHost
did -o ms.config 311 1 $readini mircstats.ini $1 ftpLogin
did -o ms.config 313 1 $readini mircstats.ini $1 ftpPassword
did -o ms.config 315 1 $readini mircstats.ini $1 RemoteLocation
did -o ms.config 317 1 $readini mircstats.ini $1 Config
did -o ms.config 319 1 $readini mircstats.ini $1 Log
did -o ms.config 322 1 $readini mircstats.ini $1 HTML
did -o ms.config 325 1 $readini -n mircstats.ini $1 Topic if (($readini mircstats.ini $1 SetTopic 1) || ($readini mircstats.ini $1 SayTopic 1)) {
if ($readini mircstats.ini $1 SetTopic == 1) { did -c ms.config 324 }
if ($readini mircstats.ini $1 SayTopic == 1) { did -c ms.config 337 }
did -e ms.config 325
}
else {
did -u ms.config 324
did -u ms.config 337
did -b ms.config 325
}
if ($readini mircstats.ini $1 botState == e) {
did -c ms.config 329
/ms.botstate e
else { did -u ms.config 336 }
}
else {
did -u ms.config 329
/ms.botstate d
}
if ($readini mircstats.ini $1 botIncLog == 1) { did -c ms.config 336 }
else { did -u ms.config 336 }
did -o ms.config 328 1 $readini mircstats.ini $1 botftpHost
did -o ms.config 331 1 $readini mircstats.ini $1 botLogin
did -o ms.config 333 1 $readini mircstats.ini $1 botPW
did -o ms.config 335 1 $readini mircstats.ini $1 botLog
$ms.status(Successfully loaded [ $1 ] channel info)
}

alias ms.delChan {
if ($1 == $null) { return }
if ($ms.isInChans($1) == $true) {
set %ms.dCchanstemp $readini mircstats.ini Global Chans
if ($numtok(%ms.dCchanstemp, 44) > 1) { writeini mircstats.ini Global Chans $remtok(%ms.dCchanstemp, $1, 1, 44) }
else { remini mircstats.ini Global Chans }
unset %ms.dCchanstemp
remini mircstats.ini $1
did -d ms.config 303 $2
}
did -r ms.config 302
did -r ms.config 309
did -r ms.config 311
did -r ms.config 313
did -r ms.config 315
did -r ms.config 317
did -r ms.config 319
did -r ms.config 322
did -r ms.config 325
did -u ms.config 324
did -u ms.config 337
did -b ms.config 325
did -c ms.config 326
/ms.ftpstate e
did -u ms.config 329
did -r ms.config 328
did -r ms.config 331
did -r ms.config 333
did -r ms.config 335
did -u ms.config 336
/ms.botstate d
$ms.status(Successfully deleted [ $1 ] channel info)
}

alias ms.newChan {
if ($did(204).state == 0) {
/ms.ftpstate e
did -c ms.config 326
did -r ms.config 309
did -r ms.config 311
did -r ms.config 313
did -r ms.config 315
did -o ms.config 317 1 settings.cfg
did -o ms.config 319 1 $logdir $+ $1 $+ .log
did -o ms.config 322 1 $nofile($did(201).text) $+ html\ $+ $right($1, -1) $+ .html
did -r ms.config 325
did -u ms.config 324
did -u ms.config 337
did -b ms.config 325
did -o ms.config 325 1 Visit the $1 stats page at [url] Last update $chr(36) $+ date(mmm dd), $chr(36) $+ time(HH:nn)
did -u ms.config 329
did -r ms.config 328
did -r ms.config 331
did -r ms.config 333
did -r ms.config 335
did -u ms.config 336
/ms.botstate d
}
did -u ms.config 303 $did(303).sel
$ms.status(New channel detected - don't forget to save!)
}

alias ms.isInChans {
set %ms.iICtemp $readini mircstats.ini Global Chans
if ($istok(%ms.iICtemp, $1, 44) == $true) { unset %ms.iICtemp | return $true }
else { unset %ms.iICtemp | return $false }
}

alias ms.saveOpts {
if ($exists($did(201).text) == $false) { $ms.status(Error: Enter mIRCstats program path and filename) | did -f ms.config 201 | halt }
writeini mircstats.ini Global Program $did(201).text
if ($did(203).state == 1) { writeini mircstats.ini Global State a }
else { writeini mircstats.ini Global State m }
writeini mircstats.ini Global Reuse $did(204).state
if ($did(102).state == 1) {
if (($did(103).text !isnum 1-23) || ($chr(46) isin $did(103).text)) { $ms.status(Error: Enter a value between 1 and 23) | did -f ms.config 103 | halt }
writeini mircstats.ini Global FreqType h
writeini mircstats.ini Global FreqHour $did(103).text
}
if ($did(105).state == 1) {
if (($did(103).text !isnum 1-28) || ($chr(46) isin $did(103).text)) { $ms.status(Error: Enter a value between 1 and 28) | did -f ms.config 106 | halt }
writeini mircstats.ini Global FreqType d
writeini mircstats.ini Global FreqDay $did(106).text
}
$ms.status(Successfully saved global options)
}

alias ms.trueState {
if ($exists( [ $mircdir $+ mircstats.ini ] ) == $false) { return N/A }
if ($readini mircstats.ini Global State == a) { return On }
else { return Off }
}

alias ms.state {
if ($exists( [ $mircdir $+ mircstats.ini ] ) == $false) { return Configure }
if ($readini mircstats.ini Global State == a) { return Disable }
else { return Enable }
}

alias ms.changestate {
if ($exists( [ $mircdir $+ mircstats.ini ] ) == $false) { /mircstats | return }
if ($readini mircstats.ini Global State == a) {
writeini mircstats.ini Global State m
ms.disable
}
else {
writeini mircstats.ini Global State a
ms.enable
}
}

alias ms.doAll {
if ($1 == $null) {
if (%ms.FUnotbytimer == $null) { writeini mircstats.ini Global LTS $date(yyyy.) $+ $ms.dayofyear($date(m), $date(d)) $+ $time(.H) $ctime }
else { unset %ms.FUnotbytimer }
set %ms.dAchanstext $readini mircstats.ini Global Chans
if (%ms.dAchanstext == $null) { $ms.status(Error: No channels defined) | unset %ms.* | return }
set %ms.dAchancount $numtok(%ms.dAchanstext, 44)
set %ms.dAcurrentchan 1
set %ms.dAfullupdate active
}
if ($timer(.ms.enable) != $null) { .timer.ms.enable off }
if ($readini mircstats.ini $gettok(%ms.dAchanstext, %ms.dAcurrentchan, 44) botState == e) { /ms.botdownload $gettok(%ms.dAchanstext, %ms.dAcurrentchan, 44) }
else { /ms.update $gettok(%ms.dAchanstext, %ms.dAcurrentchan, 44) }
}

alias ms.botdownload {
if ($ms.isInChans($1) == $false) { $ms.status(Error: Save channel before Updating Stats) | return }
$ms.status(Download [ $1 ] log from eggdrop FTP...)
write -c $mircdir $+ msftpdn.txt open $readini mircstats.ini $1 botftpHost
write $mircdir $+ msftpdn.txt $readini mircstats.ini $1 botLogin
write $mircdir $+ msftpdn.txt $readini mircstats.ini $1 botPW
write $mircdir $+ msftpdn.txt ascii
write $mircdir $+ msftpdn.txt lcd $left($mircdir, -1)
set %ms.bdLogName $readini mircstats.ini $1 botLog
set %ms.bdLogFile $gettok(%ms.bdLogName, $numtok(%ms.bdLogName, 47), 47)
if ($readini mircstats.ini $1 botIncLog == 1) {
write $mircdir $+ msftpdn.txt rename %ms.bdLogName %ms.bdLogFile $+ .temp
write $mircdir $+ msftpdn.txt get %ms.bdLogFile $+ .temp
write $mircdir $+ msftpdn.txt dele %ms.bdLogFile $+ .temp
write -c $mircdir $+ msftpdn.bat ftp.exe -s: $+ $mircdir $+ msftpdn.txt
write $mircdir $+ msftpdn.bat type %ms.bdLogFile $+ .temp >> %ms.bdLogFile
write $mircdir $+ msftpdn.bat del %ms.bdLogFile $+ .temp
}
else {
write $mircdir $+ msftpdn.txt get %ms.bdLogName
write -c $mircdir $+ msftpdn.bat del $mircdir $+ %ms.bdLogFile
write $mircdir $+ msftpdn.bat ftp.exe -s: $+ $mircdir $+ msftpdn.txt
}
write $mircdir $+ msftpdn.txt bye
write $mircdir $+ msftpdn.bat del $mircdir $+ msftpdn.txt
;write $mircdir $+ msftpdn.bat del $mircdir $+ msftpdn.bat
unset %ms.bdLo*
run $mircdir $+ msftpdn.bat
.timer.ms.checkdlfinish 0 1 /ms.checkdlfinish $1
}

alias ms.checkdlfinish {
if ($exists( [ $mircdir $+ msftpdn.txt ] ) == $false) {
.timer.ms.checkdlfinish off
$ms.status(Download of [ $1 ] log complete)
/ms.update $1
}
}

alias ms.update {
if ($ms.isInChans($1) == $false) { $ms.status(Error: Save channel info before running Update) | return }
if ($exists($nofile( [ $readini mircstats.ini Global Program ] ) $+ $readini mircstats.ini $1 Config) == $false) { $ms.status(Error: Cannot find mIRCstats program file) | return }
if ($exists( [ $readini mircstats.ini $1 Log ] ) == $false) { $ms.status(Error: Cannot find channel log) | /ms.enable | return }
if ($exists( [ $readini mircstats.ini $1 HTML ] ) == $true) { .remove $readini mircstats.ini $1 HTML }
$ms.status(Updating statistics for [ $1 $+ ... ] )
.timer.ms.checkupdatefinish 0 3 /ms.checkupdatefinish $1
run $readini mircstats.ini Global Program $readini mircstats.ini $1 Log $readini mircstats.ini $1 HTML -c $readini mircstats.ini $1 Config
}

alias ms.checkupdatefinish {
if ($exists( [ $readini mircstats.ini $1 HTML ] ) == $true) {
.timer.ms.checkupdatefinish off
$ms.status(Finished updating statistics for [ $1 ] )
if ($readini mircstats.ini $1 ftpState == d) {
/ms.topic $1
if (%ms.dAfullupdate == active) {
if (%ms.dAcurrentchan < %ms.dAchancount) {
inc %ms.dAcurrentchan
/ms.doall %ms.dAcurrentchan
}
else {
$ms.status(Update + Upload of all channels complete)
unset %ms.dA*
if ($readini mircstats.ini Global State == a) { /ms.enable }
}
}
}
elseif (%ms.dAfullupdate == active) {
.timer.ms.uploaddelay 1 10 /ms.upload $1
$ms.status(Waiting to upload .html file)
}
}
}

alias ms.upload {
if ($ms.isInChans($1) == $false) { $ms.status(Error: Save channel before Uploading stats) | return }
if ($exists( [ $readini mircstats.ini $1 HTML ] ) == $false) { $ms.status(Error: No .html file found to upload) | /ms.enable | return }
$ms.status(Uploading [ $1 ] statistics to website...)
write -c $mircdir $+ msftpup.txt open $readini mircstats.ini $1 ftpHost
write $mircdir $+ msftpup.txt $readini mircstats.ini $1 ftpLogin
write $mircdir $+ msftpup.txt $readini mircstats.ini $1 ftpPassword
write $mircdir $+ msftpup.txt ascii
write $mircdir $+ msftpup.txt cd $readini mircstats.ini $1 RemoteLocation
write $mircdir $+ msftpup.txt dele $nopath( [ $readini mircstats.ini $1 HTML ] )
write $mircdir $+ msftpup.txt quote pasv
write $mircdir $+ msftpup.txt put $readini mircstats.ini $1 HTML
write $mircdir $+ msftpup.txt bye
write -c $mircdir $+ msftpup.bat ftp.exe -s: $+ $mircdir $+ msftpup.txt
write $mircdir $+ msftpup.bat del $mircdir $+ msftpup.txt
;write $mircdir $+ msftpup.bat del $mircdir $+ msftpup.bat
run $mircdir $+ msftpup.bat
.timer.ms.checkulfinish 0 1 /ms.checkulfinish $1
}

alias ms.checkulfinish {
if ($exists( [ $mircdir $+ msftpup.txt ] ) == $false) {
/ms.topic $1
.timer.ms.checkulfinish off
$ms.status(Upload of [ $1 ] statistics complete)
if (%ms.dAfullupdate == active) {
if (%ms.dAcurrentchan < %ms.dAchancount) {
inc %ms.dAcurrentchan
/ms.doAll %ms.dAcurrentchan
}
else {
$ms.status(Update + Upload of all channels complete)
unset %ms.dA*
if ($readini mircstats.ini Global State == a) { /ms.enable }
}
}
}
}

alias ms.timediff {
if ($1 == $null) { return }
set %ms.tddiff $calc((($date(yyyy) - $gettok($1, 1, 46)) * 365) + ($ms.dayofyear($date(m), $date(d)) - $gettok($1, 2, 46)))
if ($2 == h) { set %ms.tddiff $calc((%ms.tddiff * 24) + ($time(H) - $gettok($1, 3, 46))) }
return %ms.tddiff
unset %ms.tddiff
}

alias ms.dayofyear {
set %ms.doydayspermonth 31.28.31.30.31.30.31.31.30.31.30.31
set %ms.doymonth 1
set %ms.doydayofyear 0
:ms.doyloop
if (%ms.doymonth == $1) { inc %ms.doydayofyear $2 }
else {
inc %ms.doydayofyear $gettok(%ms.doydayspermonth, %ms.doymonth, 46)
inc %ms.doymonth
goto ms.doyloop
}
return %ms.doydayofyear
unset %ms.doy*
}

alias ms.dayofweek {
set %ms.dowdaysofweek Monday.Tuesday.Wednesday.Thursday.Friday.Saturday.Sunday
return $findtok(%ms.dowdaysofweek, $1, 1, 46)
}

alias ms.enable {
if ($server == $null) { return }
set %ms.efreqtype $readini mircstats.ini Global FreqType
set %ms.elastupdate $readini mircstats.ini Global LTS
set %ms.elastupdate $gettok(%ms.elastupdate, 1, 32)
if (%ms.efreqtype == h) {
set %ms.efreq $readini mircstats.ini Global FreqHour
if ($int($calc(24 / %ms.efreq)) == $calc(24 / %ms.efreq)) {
set %ms.etime $int($calc(((($int($calc($time(H) / %ms.efreq)) + 1) * %ms.efreq) - ($time(H) + ($time(n) / 60) + ($time(s) / 3600))) * 3600))
;echo -s BLAH ms.etime %ms.etime -- ms.elastupdate %ms.elastupdate -- ms.efreqtype %ms.efreqtype -- ms.timediff $ms.timediff(%ms.elastupdate, %ms.efreqtype) -- ms.efreq %ms.efreq -- calc $calc(%ms.efreq * 3600 / 2)
if ((%ms.elastupdate != $null) && ($ms.timediff(%ms.elastupdate, %ms.efreqtype) >= %ms.efreq)) {
$ms.statusecho(Interval exceeded since last update, updating now...)
/ms.doAll
return
}
}
else {
if ((%ms.elastupdate == $null) || ($ms.timediff(%ms.elastupdate, %ms.efreqtype) >= %ms.efreq)) {
$ms.statusecho(Interval exceeded since last update (or 1st time run), updating on top of hour...)
set %ms.etime $int($calc((($time(H) + 1) - ($time(H) + ($time(n) / 60) + ($time(s) / 3600))) * 3600))
}
else {
set %ms.etime $int($calc(((%ms.efreq + $gettok(%ms.elastupdate, 3, 46)) - ($time(H) + ($time(n) / 60) + ($time(s) / 3600))) * 3600))
}
}
}
else {
set %ms.efreq $readini mircstats.ini Global FreqDay
if ($int($calc(%ms.efreq / 7)) == $calc(%ms.efreq / 7)) {
set %ms.etime $int($calc((((7 - $ms.dayofweek($date(dddd))) * 24) + (24 - ($time(H) + ($time(n) / 60) + ($time(s) / 3600)))) * 3600))
if ((%ms.elastupdate != $null) && ($ms.timediff(%ms.elastupdate, %ms.efreqtype) >= %ms.efreq)) {
$ms.statusecho(Interval exceeded since last update, updating now...)
/ms.doAll
return
}
}
else {
if ((%ms.elastupdate == $null) || ($ms.timediff(%ms.elastupdate, %ms.efreqtype) >= %ms.efreq)) {
$ms.statusecho(Interval exceeded since last update (or 1st time run), updating at midnight...)
set %ms.etime $int($calc((24 - ($time(H) + ($time(n) / 60) + ($time(s) / 3600))) * 3600))
}
else {
set %ms.etime $int($calc(((((%ms.efreq + $gettok(%ms.elastupdate, 2, 46)) - $ms.dayofyear($date(m), $date(d))) * 24) + (24 - ($time(H) + ($time(n) / 60) + ($time(s) / 3600)))) * 3600))
}
}
}
$ms.statusecho(Next update scheduled in [ $duration(%ms.etime) ] )
; writeini mircstats.ini Global LTS $date(yyyy.) $+ $ms.dayofyear($date(m), $date(d)) $+ $time(.H) $ctime
.timer.ms.enable 1 %ms.etime /ms.doAll
unset %ms.e*
}

alias ms.disable {
if ($timer(.ms.enable) != $null) { .timer.ms.enable off }
}

alias ms.status {
if ($dialog(ms.config).title != $null) { did -a ms.config 51 $1- }
else { echo -s 2[12m10A12C2] 6-> 14 $+ $1- }
}

alias ms.statusecho {
echo -s 2[12m10A12C2] 6-> 14 $+ $1-
}

alias ms.url {
if ($len( [ $readini mircstats.ini $1 RemoteLocation ] ) == 1) {
return http:// $+ $gettok( [ $readini mircstats.ini $1 ftpHost ] , 1, 32) $+ $chr(47) $+ $nopath( [ $readini mircstats.ini $1 HTML ] )
}
else {
return http:// $+ $gettok( [ $readini mircstats.ini $1 ftpHost ] , 1, 32) $+ $readini mircstats.ini $1 RemoteLocation $+ $chr(47) $+ $nopath( [ $readini mircstats.ini $1 HTML ] )
}
}

alias ms.topic {
if ($server == $null) { return }
set %ms.ttemp $readini mircstats.ini $1 Topic
set %ms.ttemp $replace(%ms.ttemp, [url], $ms.url( [ $1 ] ))
set %ms.ttemp $replace(%ms.ttemp, ^K, $chr(3))
set %ms.ttemp $replace(%ms.ttemp, ^B, $chr(2))
set %ms.ttemp $replace(%ms.ttemp, ^U, $chr(31))
set %ms.ttemp $replace(%ms.ttemp, ^R, $chr(22))
if (($me isop $1) && ($readini mircstats.ini $1 SetTopic == 1)) {
topic $1 %ms.ttemp
}
if (($me ison $1) && ($readini mircstats.ini $1 SayTopic == 1)) {
.raw privmsg $1 : $+ %ms.ttemp
echo $1 2[12m10A12C2] 6-> 14Said in $1 $+ :99 %ms.ttemp
}
unset %ms.ttemp
}

alias ms.ftpstate {
if ($1 == e) {
did -e ms.config 309
did -e ms.config 311
did -e ms.config 313
did -e ms.config 315
}
else {
did -b ms.config 309
did -b ms.config 311
did -b ms.config 313
did -b ms.config 315
}
}

alias ms.botstate {
if ($1 == e) {
did -e ms.config 328
did -e ms.config 331
did -e ms.config 333
did -e ms.config 335
did -e ms.config 336
did -b ms.config 319
did -b ms.config 320
}
else {
did -b ms.config 328
did -b ms.config 331
did -b ms.config 333
did -b ms.config 335
did -b ms.config 336
did -e ms.config 319
did -e ms.config 320
}
}

alias ms.doallpopup {
if ($server != $null) {
set %ms.FUnotbytimer 1
/ms.doall
}
}

1 réponse

cs_jhd Messages postés 338 Date d'inscription mardi 13 août 2002 Statut Membre Dernière intervention 29 novembre 2007
12 sept. 2003 à 13:23
si c le bot stats de nico mail le je pense qu il te repondra avec plesir
jhd ( www.jhdscript.com )
0
Rejoignez-nous