mIRC Home    About    Download    Register    News    Help

Print Thread
REMOVE nick #123602 25/06/05 08:35 AM
Joined: Feb 2005
Posts: 74
S
SkyD Offline OP
Babel fish
OP Offline
Babel fish
S
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

Re: REMOVE nick #123603 25/06/05 09:47 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
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?

Re: REMOVE nick #123604 25/06/05 10:08 AM
Joined: Feb 2005
Posts: 74
S
SkyD Offline OP
Babel fish
OP Offline
Babel fish
S
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

Re: REMOVE nick #123605 25/06/05 01:57 PM
Joined: Feb 2005
Posts: 74
S
SkyD Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2005
Posts: 74
Help please..!!


[color:red]m[color:blue]IRC[color:green] for EvEr

Re: REMOVE nick #123606 25/06/05 02:12 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
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:

Code:
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
Re: REMOVE nick #123607 26/06/05 01:01 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
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.


Code:
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
  }
}

Re: REMOVE nick #123608 26/06/05 04:21 AM
Joined: May 2005
Posts: 106
S
Sleepyfreak Offline
Vogon poet
Offline
Vogon poet
S
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
Re: REMOVE nick #123609 26/06/05 09:14 AM
Joined: Feb 2005
Posts: 74
S
SkyD Offline OP
Babel fish
OP Offline
Babel fish
S
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

Re: REMOVE nick #123610 26/06/05 12:14 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
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)

Re: REMOVE nick #123611 26/06/05 02:05 PM
Joined: Feb 2005
Posts: 74
S
SkyD Offline OP
Babel fish
OP Offline
Babel fish
S
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

Re: REMOVE nick #123612 26/06/05 04:11 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
If it is possible, then I haven't been able to figure out how. Sorry.

Re: REMOVE nick #123613 26/06/05 10:54 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
its not

Re: REMOVE nick #123614 28/06/05 10:47 PM
Joined: Apr 2003
Posts: 701
K
Kelder Offline
Hoopy frood
Offline
Hoopy frood
K
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.