rendered paste body### backfill check
proc no:dupe:backfill {nick uhost handle chan arg} {
global nomysql notable nocrap nochan nolength noerror nofilter nolimit noafterpre
putlog "BACKFiLL"
set rls [string map [list "\{" " " "\}" " " "\[\[:cntrl:\]\]" " " "\\" " " "\/" " " "'" " " "*" " "] $arg]
regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $rls "" rls
foreach rls [split $rls] {
set nomysql(conn) [mysqlconnect -host $nomysql(hst) -port $nomysql(prt) -user $nomysql(usr) -password $nomysql(pwd) -db $nomysql(db)]
set nochkdupe [mysqlsel $nomysql(conn) "SELECT $notable(id),$notable(tim),$notable(sec),$notable(rls),$notable(grp),$notable(nick),$notable(fil),$notable(meg),$notable(genre),$notable(nuke),$notable(nuke_tim),$notable(nuke_reason),$notable(unnuke),$notable(unnuke_tim),$notable(unnuke_reason) FROM $nomysql(table) WHERE $notable(rls) LIKE '$rls' ORDER BY $notable(tim) DESC LIMIT 1" -flatlist]
set notable_db_id [lindex $nochkdupe 0]
if {$notable_db_id != "" && [lindex $nochkdupe 2]!=""} {
foreach {id tim sec rls grp nick fil meg genre nuke nuke_tim nuke_reason unnuke unnuke_tim unnuke_reason} $nochkdupe {
if {$tim==""} {continue}
set nothetime [unixtime]
set tim_ago [no:dupe:ago $nothetime $tim]
set tim_day [no:dupe:day $tim]
set unnuke_tim_ago [no:dupe:ago $nothetime $unnuke_tim]
set unnuke_tim_day [no:dupe:day $unnuke_tim]
set bf [expr $noafterpre + $tim]
if { $nothetime > $bf } {
# set backfillinfo "\0039-\00314 (\0034 [no:dupe:ago $nothetime $bf] \00315to late \00314)"
} else {
#set backfillinfo "\0039- \00314(\0039 [no:dupe:ago $bf $nothetime] \00315to go \00314)"
# set backfillinfo "\0039- \00314(\0039 [no:dupe:ago $nothetime $bf] \00315to go \00314)"
}
if { $fil == "0" } {
if {$nuke == "1"} {
putserv "PRIVMSG $chan :\00314- \0039BACKFiLL1 \00314- $bf \00315 $rls \00315 \00314(\0034 $sec \0034\00314)\00315 released\0039 $tim_ago \00315ago\0037 @\00314 $tim_day \0039- \00314(\00314 \00315got \0034nuked\00315 couz of\0034 $nuke_reason \00315 $nuke_tim_ago \0037@\00314 $nuke_tim_day \00314) \0039-\00314 (\0034 $backfillinfo \00314)"
} elseif {$unnuke == "1"} {
putserv "PRIVMSG $chan :\00314- \0039BACKFiLL2 \00314- $bf \00315 $rls \00315 \00314(\0034 $sec \0034\00314)\00315 released\0039 $tim_ago \00315ago\0037 @\00314 $tim_day \0039- \00314(\00314 \00315got \0039unnuked\00315 couz of\0039 $unnuke_reason \00315 $unnuke_tim_ago \0037@\00314 $unnuke_tim_day \00314) \0039-\00314 (\0034 $backfillinfo \00314)"
} else {
putserv "PRIVMSG $chan :\00314- \0039OK \00314- \00315 $rls \00315 \00314(\0034 $sec \0034\00314)\00315 released\0039 $tim_ago \00315ago\0037 @\00314 $tim_day \00314"
}
} else {
set ffil ""; append ffil $fil "FiLES"
set mmeg ""; append mmeg $meg "MB"
if {$nuke == "1"} {
putserv "PRIVMSG $chan :\00314- \0039BACKFiLL4 \00314- $bf \00315 $rls \00314(\0034 $sec \00314)\00315 released\0039 $tim_ago \00315ago\0037 @\0037\00314 $tim_day \00315- \00314(\00314\0039 $ffil \0034/\0039 $mmeg \00314) \0039- \00314( \00315got \0034nuked \00315couz of\0034 $nuke_reason \00315 $nuke_tim_ago \0037@\00314 $nuke_tim_day \00314) \0039-\00314 (\0034 $backfillinfo \00314)"
} elseif {$unnuke == "1"} {
putserv "PRIVMSG $chan :\00314- \0039BACKFiLL5 \00314- $bf \00315 $rls \00315 \00314(\0034 $sec \0034\00314)\00315 released\0039 $tim_ago \00315ago\0037 @\00314 $tim_day \0039- \00314(\00314 \00315got \0039unnuked\00315 couz of\0039 $unnuke_reason \00315 $unnuke_tim_ago \0037@\00314 $unnuke_tim_day \00314) \0039-\00314 (\0034 $backfillinfo \00314)"
} else {
putserv "PRIVMSG $chan :\00314- \0039BACKFiLL6 \00314- $bf \00315 $rls \00314(\0034 $sec \00314)\00315 released\0039 $tim_ago \00315ago\0037 @\0037\00314 $tim_day \00315- \00314(\00314\0039 $ffil \0034/\0039 $mmeg \00314)\0039-\00314 (\0034 $backfillinfo \00314)"
}
}
}
mysqlclose
return -1
break
}
}
}