| View previous topic :: View next topic |
| Author |
Message |
Jerry Voice
Joined: 23 Nov 2006 Posts: 9
|
Posted: Sat Nov 25, 2006 1:14 am Post subject: Script Help |
|
|
| Code: | 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. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Nov 25, 2006 8:34 am Post subject: |
|
|
the world and pcwnick should be global variables and the brackets in the msgs should be skipped. (+ the quotes are not closed in the puthelp argument)
| Code: | 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!"
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Jerry Voice
Joined: 23 Nov 2006 Posts: 9
|
Posted: Sat Nov 25, 2006 4:14 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Nov 25, 2006 9:15 pm Post subject: |
|
|
| Code: | 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!"
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Jerry Voice
Joined: 23 Nov 2006 Posts: 9
|
Posted: Sat Nov 25, 2006 11:35 pm Post subject: |
|
|
| Ok so that displays the seconds. I want it to display like this: 1hr 2min 37secs |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
|