bind pub - !pcw pcw:world
bind pub - !world pcw:world
bind pub - !change change:world
proc pcw:world {nick host handle chan text} {
puthelp "NOTICE $nick :\00303[\00312The current PCW World is $world.\00303] \00312- \00303[\00312The PCW was set by $pcwnick.\00303]
}
proc change:world {nick host handle chan text} {
if {[isop $nick $chan] || [ishalfop $nick $chan] == 1} {
set world $text
set pcwnick $nick
puthelp "PRIVMSG $chan :\00303[\00312PC World Update\00303]\00312 The PCW World has been updated!
} }
I tried it, and it doesnt seem to work. I also would like to know, how do I make it so that when an op/halfop changes the world, it will set the time since that world has been changed.
EX: !change 89
!pcw: The PCW World is (World). The PCW World was set (number of minutes ago) by $nick.
bind pub - !pcw pcw:world
bind pub - !world pcw:world
bind pub - !change change:world
proc pcw:world {nick host handle chan text} {
global world pcwnick pcwtime
puthelp "NOTICE $nick :\00303\[\00312The current PCW World is $world.\00303\] \00312- \00303\[\00312The PCW was set by $pcwnick at $pcwtime.\00303\]"
}
proc change:world {nick host handle chan text} {
global world pcwnick pcwtime
if {[isop $nick $chan] || [ishalfop $nick $chan] == 1} {
set world $text
set pcwnick $nick
set pcwtime [ctime [unixtime]]
puthelp "PRIVMSG $chan :\00303\[\00312PC World Update\00303\]\00312 The PCW World has been updated!"
}
}
On the minutes part, I was looking for something like this:
The PCW world was set by $pcwnick 32secs ago.
In mIRC Form: $duration($ctime - %ctime) where %ctime = $ctime when the world was set.
EDIT: Also, Apparently, After I change the world, it doesnt Notice the person when I type !pcw. Even after I rehash the bot and set the world, it doesnt work.
bind pub - !pcw pcw:world
bind pub - !world pcw:world
bind pub - !change change:world
proc pcw:world {nick host handle chan text} {
global world pcwnick pcwtime
puthelp "NOTICE $nick :\00303\[\00312The current PCW World is $world.\00303\] \00312- \00303\[\00312The PCW was set by $pcwnick [expr {[unixtime]-[clock scan $pcwtime]}] ago.\00303\]"
}
proc change:world {nick host handle chan text} {
global world pcwnick pcwtime
if {[isop $nick $chan] || [ishalfop $nick $chan] == 1} {
set world $text
set pcwnick $nick
set pcwtime [ctime [unixtime]]
puthelp "PRIVMSG $chan :\00303\[\00312PC World Update\00303\]\00312 The PCW World has been updated!"
}
}