|
|
Joined: Dec 2006
Posts: 46
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2006
Posts: 46 |
I was wondering how to go about writing a script that users could type !logout, would start an 18 hour countdown timer. Then be able to type !time, to see how much time was left. Then !login to shut the timer off.
Thanks
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Use this:
on *:text:*:#: {
if ($1 == !logout) {
.timerlogout 1 64800 msg $chan Logged Out.
msg $chan Starting logout.
}
elseif ($1 == !login) {
if ($timer(logout)) {
.timerlogout off
msg $chan Logout terminated.
}
else msg $chan Not logging out.
}
elseif ($1 == !time) {
if ($timer(logout)) {
msg $chan $duration($timer(logout).secs) left until logged out.
}
else msg $chan Not logging out.
}
}
Note that you can change the messages if you want.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Dec 2006
Posts: 46
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2006
Posts: 46 |
WOW I figured I would just get some help with it, not it wrote out for me. Thank you VERY much
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Heh. No problem. If you want an explanation of what it does, just ask.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Please note that Riamus' code is a general code, not one that tracks on a nick by nick basis. This means that if Person1 does !logout and then half an hour later Person2 does !logout, the logout timer will reset to the start point from when Person2 issued the command, so the logout message would be given 18 hours after that, not 18 hours after Person1 used the command.
|
|
|
|
Joined: Dec 2006
Posts: 46
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2006
Posts: 46 |
Please note that Riamus' code is a general code, not one that tracks on a nick by nick basis. This means that if Person1 does !logout and then half an hour later Person2 does !logout, the logout timer will reset to the start point from when Person2 issued the command, so the logout message would be given 18 hours after that, not 18 hours after Person1 used the command. oh, I did not know this, would it be a long pain to code it so that each persons timer would be separate? Thanks again
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Not at all..Here you go on *:text:*:#: {
if ($1 == !logout) {
$+(.timerlogout,$nick) 1 64800 msg $chan Logged Out.
msg $chan Starting logout.
}
elseif ($1 == !login) {
if $timer($+(logout,$nick)) {
$+(.timerlogout,$nick) off
msg $chan Logout terminated.
}
else msg $chan Not logging out.
}
elseif ($1 == !time) {
if $timer($+(logout,$nick)) {
msg $chan $duration($timer($+(logout,$nick)).secs) left until logged out.
}
else msg $chan Not logging out.
}
|
|
|
|
|
|