|
|
Joined: Feb 2005
Posts: 74
Babel fish
|
OP
Babel fish
Joined: Feb 2005
Posts: 74 |
Hi.. I have a problem.. If nick writes !delete_me bot write his nick in delete_nicks.txt I need that the bot remove his nick after week at the time when his nick was writed in..
PLEASE, HELP!!
[color:red]m[color:blue]IRC[color:green] for EvEr
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
Question.
(1) can delete_nicks.txt have any other info in it besides just the nickname? can it be BOOB 1119692563 BILL 1119692234 FRED 1119645663
the number is $ctime of when they werr added, this way if the bot goes down between adding and removing it can resume the timers on the nicks to be removed.
(2) Does the removing of the nicks have to be exactly correct, ie : added to file at 18th 12:34:56 removed from file at 25th 12:34:56 OR is a removal every 5 minutes of anyone ready to be removed ok?
|
|
|
|
Joined: Feb 2005
Posts: 74
Babel fish
|
OP
Babel fish
Joined: Feb 2005
Posts: 74 |
in delete_nicks.txt i have that: BOOB 20.06.2005 9:11 BILL 22.06.2005 11:22 FRED 21.06.2005 10:22
and i need that the bot deletes them afer week.. FOR EXAMPLE: BOOB 27.06.2005 9:11 BILL 29.06.2005 11:22 FRED 28.06.2005 10:22
Can you help me??
[color:red]m[color:blue]IRC[color:green] for EvEr
|
|
|
|
Joined: Feb 2005
Posts: 74
Babel fish
|
OP
Babel fish
Joined: Feb 2005
Posts: 74 |
[color:red]m[color:blue]IRC[color:green] for EvEr
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
Please don't bump threads, it's annoying and it won't get you help any faster. Try this: alias addnick { write delete_nicks.txt $1 }
alias remnick { write -dw $+ $1 delete_nicks.txt }
on *:text:!delete_me:#:{
addnick $nick
.timer 1 604800 remnick $nick
}
New username: hixxy
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
I just added to Tidy_Trax's code, to include the delete request date as you speced, and a ON START, in case the bot shut down, it well sweep the file for any to remove or any to setup timers for to remove.
alias addnick { write delete_nicks.txt $1 $asctime(dd.mm.yyyy H:nn) }
alias remnick { write -dw" $+ $1 *" delete_nicks.txt }
;
on *:text:!delete_me:#:{
addnick $nick
.timer 1 604800 remnick $nick
}
;
on *:start:{
var %i = $lines(delete_nicks.txt)
while (%i) {
var %line = $read(delete_nicks.txt,nt,%i)
var %nick = $gettok(%line,1,32)
var %ctime = $calc($ctime($gettok(%line,2-,32)) + 604800
if (%ctime <= $ctime) { remnick %nick }
else { .timer 1 $calc(%ctime - $ctime) remnick %nick }
dec %i
}
}
|
|
|
|
Joined: May 2005
Posts: 106
Vogon poet
|
Vogon poet
Joined: May 2005
Posts: 106 |
nice DaveC do you reckon you can take a look at my little problem called lanuage :P
Last edited by Sleepyfreak; 26/06/05 04:23 AM.
and thats the way the scout leader burns
|
|
|
|
Joined: Feb 2005
Posts: 74
Babel fish
|
OP
Babel fish
Joined: Feb 2005
Posts: 74 |
Thanx DaveC.. but i have one more problem.. My bot doesn't work every day and every night. I quit from chat at night and come back at morning.. And timer doesn't work it is stoped.. Is the way if i come back in chat the timer will continue count the time ???
[color:red]m[color:blue]IRC[color:green] for EvEr
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
That is exactly what the code i wrote is for, if you restart mirc it well restart all the timers (well it actually remakes them all)
|
|
|
|
Joined: Feb 2005
Posts: 74
Babel fish
|
OP
Babel fish
Joined: Feb 2005
Posts: 74 |
I know it is possible to set the time when timer do something.. EXAMPLE: /timer 12:00 1 2 /msg $chan bla bla.. If it's possible to set the date and time ???
[color:red]m[color:blue]IRC[color:green] for EvEr
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
If it is possible, then I haven't been able to figure out how. Sorry.
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
|
|
|
|
Joined: Apr 2003
Posts: 701
Hoopy frood
|
Hoopy frood
Joined: Apr 2003
Posts: 701 |
You can only supply time in hours/minutes in the timer. You can however do something like this, scripting the date check yourself:
alias timedstuff { if ($date(yyyymmdd) !isnum 20050630) { ; below test only to not have the timer activated if the date has already passed if ($v1 > $v2) return .timer 1 120 .timer $time(HH:nn) 1 1 timedstuff return } ;do your stuff }
Yes, there's 2 timers in there, otherwise you'll be setting a timer every 1 or 2 seconds until it's one minute later.
|
|
|
|
|
|