mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2021
Posts: 48
R
Robert Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Mar 2021
Posts: 48
My code check event on join: i set var %host1 = *!*@ $+ $gettok($ial($nick).host,1,46) $+ .*
Example:
My Bot sets mode: +b *!*@black.*
How to set bot auto unban after 60 mins?
I use this, but not work: .timer_unban 1 3600 mode $chan -b *!* $+ $ial($nick).host,1,46 $+ .* OR .timer_unban 1 3600 mode $chan -b %host1
Thanks all so much for help!

Joined: Jan 2012
Posts: 301
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 301
Try using the following lines of code in your script:
Code
on *:JOIN:#test:{
  
  ;--- code snippet ---
  var %host = $ial($nick).host
  var %host1 = $+(*!*@,$gettok(%host,1,46),.*)
  mode $chan +b %host1
  .timerUNBAN $+ %host 1 3600 mode $chan -b %host1

}

This snippet of code needs to be inserted into your script where the "on JOIN" event is located. For the test, change the timer action value from 3600 to 10 seconds.

To prevent the same timer from being recreated due to a new user join event, need to give the timer a unique name each time.
To do this, you can add the full user host to the timer name ".timerUNBAN $+ %host". In this case, each new user will have their own timer created.

Note: Keep in mind that if the Bot freezes or disconnects from the network, then you risk leaving all users in a permanent ban, whose address will match part of the address in the ban list.


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: Jul 2014
Posts: 317
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jul 2014
Posts: 317
Code
.timer_unban 1 3600 mode $chan -b *!* $+ $gettok($ial($nick).host,1,46) $+ .*


TECO
irc.PTirc.org (Co-Admin)
Joined: Mar 2021
Posts: 48
R
Robert Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Mar 2021
Posts: 48
I sent you the full code in a private message. Please check my code and let me know what you think. I hope to receive your reply soon in a private message. Thanks my friend

Last edited by Robert; 11/09/23 07:06 AM.

Link Copied to Clipboard