I'm currently making a feature for my bot so it can give a list of banned users.
i was wondering if there was anyway to make a feature so when
on *:BAN:#: etc. etc., i would be able to
set %banneduser.(number)
where the (number) is set according to what has been before, i'll give an example.
guy1 gets banned on #coolchannel, so this happens
{ set %banneduser.1 $fulladdress }
guy 2 gets banned on #coolchannel, so this happens
{ set %banneduser.2 $fulladdress }
I want the script to check if %banneduser.1 is set, and if not
{ set %banneduser.1 $fulladdress }
on it's own, which is the easy part i suppose, something like
if (%banneduser.1 == $null)
set %banneduser.1 $fulladdress
i need a solution so the number after banneduser will go up to an infinite amount, and then be able to user the amount of bannedusers to set the amount of /notice ' s to send, and the script will check which numbers have been used, and obviously use the lowest possible number.
I'm sure I haven't been clear, so i'll post a snippet of my experimentation here -
;;;
;;;
;;;
on *:BAN:#:{
set %bannednick.1 $bnick
set %bannedmask.1 *!*@ $+ $site
set %bantime.1 $time
set %bandate.1 $date
set %banuser.1 $fulladdress
}
on *:UNBAN:#:{
{ if ($fulladdress == %banuser.1) }
{ unset %banuser.1 }
{ unset %bannednick.1 }
{ unset %bannedmask.1 }
{ unset %bantime.1 }
{ unset %bandate.1 }
}
on *:TEXT:!banlist:#:{
{
if (%bannednick.1 == $null ) notice $nick The ban list is empty.
}
{
else
{ notice $nick Banned User - %bannednick.1 ( $+ %bannedmask.1 $+ ), ban set on %bandate.1 at %bantime.1 and is %banuser.1 $+ .
}
}
{
if (%bannednick.2 != $null) notice $nick Banned User - %bannednick.2 ( $+ %bannedmask.2 $+ ), ban set on %bandate.2 at %bantime.2 $+ .
}
;;;
;;;
;;;
Also, i would be very grateful if someone could suggest an alternative for $fulladdress in the obvious event of nick changes and IP changes.
Thank you