mIRC Homepage
Posted By: Robert How to auto unban this ban pls? thanks all - 10/09/23 05:21 PM
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!
Posted By: Epic Re: How to auto unban this ban pls? thanks all - 10/09/23 05:55 PM
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.
Posted By: TECO Re: How to auto unban this ban pls? thanks all - 10/09/23 09:02 PM
Code
.timer_unban 1 3600 mode $chan -b *!* $+ $gettok($ial($nick).host,1,46) $+ .*
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
© mIRC Discussion Forums