on *!:join:#help:{
var %n = 1, %chan = #mainchan
while ($ibl(%chan,%n)) {
var %b = $ifmatch
if (%b iswm $fulladdress) msg #help $nick has banned on #mainchan from $gettok($ibl(%chan,%n).by,1,33) For $duration($calc($ctime - $ibl(%chan,%n).ctime)) Adress: ( %b )
inc %n
}
}
namespace eval banCheck {
set setup(help) "#help"
set setup(main) "#mainchan"
set setup(message) "%bywho banned %ban on %channel %when ago"
set setup(duration) {
604800 {" week" " weeks"}
86400 {" day" " days"}
3600 {" hour" " hours"}
60 {" minute" " minutes"}
1 {" second" " seconds"}
}
# don't edit past this line unless you know what you are doing
bind join * * [namespace current]::check
proc check {nick uhost hand chan} {
variable setup
if {[isbotnick $nick] || ![string equal -nocase $setup(help) $chan]} return
if {![validchan $setup(main)] || ![botonchan $setup(main)]} return
set chanbans [chanbans $setup(main)]
set mask "$nick!$uhost"
foreach {ban bywho age} [join $chanbans] {
if {[string match -nocase $ban $mask]} {
set when [elapsedTime $age]
set bywho [lindex [split $bywho "!"] 0]
set message [string map [list "%bywho" $bywho "%ban" $ban "%channel" $setup(main) "%when" $when] $setup(message)]
puthelp "PRIVMSG $chan :$message"
}
}
}
# user's awesome duration http://forum.egghelp.org/viewtopic.php?p=79046#79046
proc elapsedTime {time} {
variable setup
foreach {secs names} $setup(duration) {
if {$time<$secs} continue
set val [expr {$time/$secs}]
lappend out $val[lindex $names [expr {$val!=1}]]
if {![incr time [expr {-$val*$secs}]]} break
}
join $out
}
}
If i got this right with my limited knowledge of mIRC's scripting language then give this a try cos i haven't done any testing what so ever so let me know if dose/doesn't do what you asked for.
Feel free to change the message or the order of the words as you please as long as you keep the %variable as is and it will be replaced with the actual value.
Edit: Fixed.
Last edited by caesar on Thu Jul 14, 2016 1:09 am, edited 1 time in total.
Once the game is over, the king and the pawn go back in the same box.