mIRC Homepage
Posted By: Tomao I need help with this snippet - 04/02/08 04:48 AM
I've come up with this snippet, but what I would like it to do is, when other people select a nickname from their mirc nick list, and when he or she types in !ban, the selected person gets a kick and ban by my bot.

* So far it only works for me when I do it via my own bot, but not my hosts. I need your help to make it happen for others instead of myself.


Code:
on *:TEXT:!ban:#: {
  if ($nick isop #) {
    hadd -m banlist Room $chan
    hadd banlist $ial($snick($active,1)).user Set by $me
    msg # $utfencode($snick($active,1)) $+ 's gate: $ial($snick($active,1)).user has been added to the banlist.
    ban $chan $address($nick,2) was banned by $me on $date at $time(h:nn:ss tt) Violation.
    kick # $snick(#,1) Violation.
    hsave -o banlist banlist.txt
  }
}

on *:JOIN:*: {
  if ($hget(banlist,$ial($nick).user,1)).data { 
    kick # $nick
  }
}
Posted By: genius_at_work Re: I need help with this snippet - 04/02/08 05:36 AM
Your request doesn't make sense when compared to your code.

You can't read someone else's $snick list. Your script looks like a combination of both the scripts (the user's and the bot's).

-genius_at_work
Posted By: 5618 Re: I need help with this snippet - 04/02/08 06:04 AM
You want their clients to send you $snicks and then make your bot act on that output.
Posted By: Tomao Re: I need help with this snippet - 04/02/08 06:11 AM
So then it's not possible? Is there a workaround to make it work per my request?

I can have a nickname selected on my bot's nick list, while other hosts type !ban to execute my bot to kick that chosen nickname. The way I want it to be is to let them choose their own nickname from their client's nick list and then execute my bot to act on their selections.
Posted By: XTZGZoReX Re: I need help with this snippet - 04/02/08 08:24 AM
It's always possible if the end user has a script to send the request to the bot... But that beats the purpose of the bot.
Posted By: Riamus2 Re: I need help with this snippet - 04/02/08 11:10 AM
The only way is to actually send the value of $snicks to the bot...

/msg botnick !ban $snicks

for example.
Posted By: genius_at_work Re: I need help with this snippet - 04/02/08 03:18 PM
You need to have separate codes for the users and the bot.

Users code:

Code:

alias bban if ($snick($active,1)) msg $active !ban $v1




Bots code:

Code:

on *:TEXT:!ban &:#:{
  if ($nick !isop $chan) return

  %bannick = $1

  ; Your ban code goes here, %bannick contains nick to be banned

}



-genius_at_work
Posted By: LostShadow Re: I need help with this snippet - 04/02/08 03:30 PM
Originally Posted By: Tomao
I've come up with this snippet, but what I would like it to do is, when other people select a nickname from their mirc nick list, and when he or she types in !ban, the selected person gets a kick and ban by my bot.


How is your bot supposed to know what people have selected in their nick list?

How are other people supposed to know what you have selected in your nick list?

Originally Posted By: Tomao
* So far it only works for me when I do it via my own bot, but not my hosts. I need your help to make it happen for others instead of myself.


Perhaps maybe $snick($active,1) only returns your own $snick but not others?

-Neal.
Posted By: Tomao Re: I need help with this snippet - 05/02/08 09:17 AM
Never mind. I have worked this out. wink

Thank you all for your inputs.
© mIRC Discussion Forums