mIRC Home    About    Download    Register    News    Help

Print Thread
#106252 26/12/04 11:55 PM
Joined: Dec 2004
Posts: 5
N
nebbor Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
N
Joined: Dec 2004
Posts: 5
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 smile

#106253 27/12/04 01:55 AM
Joined: Dec 2004
Posts: 12
D
Pikka bird
Offline
Pikka bird
D
Joined: Dec 2004
Posts: 12
Mmmm. wasn't very clear, but here's what i can make of wat i understood...
Code:
on *:BAN:#:{
  if (!%bannum) { set %bannum 0 )
  var %i = 1
  :next
  while (%banneduser. $+ %i <= %banneduser. $+ %bannum) {
    inc %i
    goto next
  }
  inc %bannum
  set %banneduser. $+ %bannum $address($bnick,1)
}
on *:UNBAN:#:{
  var %i = 1
  :next
  while (%banneduser. $+ %i <= %banneduser. $+ %bannum) {
    if (%banneduser. $+ %i == $address($bnick,1)) {
      echo -a Removed $bnick From List
      unset %banneduser. $+ %bannum
      dec %bannum
    }
    inc %i
    goto next
  }
}
on *:Text:!banlist:#:{
  msg $chan Listing Banned People...
  var %i = 1
  :next
  while (%banneduser. $+ %i < %banneduser. $+ %bannum) {
    msg $chan %banneduser. $+ %i
    inc %i
    goto next
  }
}


Link Copied to Clipboard