mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline OP
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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
  }
}

Last edited by Tomao; 04/02/08 07:50 AM.
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
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

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
You want their clients to send you $snicks and then make your bot act on that output.

Joined: Jul 2007
Posts: 1,129
T
Tomao Offline OP
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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.

Last edited by Tomao; 04/02/08 06:15 AM.
Joined: Sep 2007
Posts: 65
X
Babel fish
Offline
Babel fish
X
Joined: Sep 2007
Posts: 65
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.

Last edited by XTZGZoReX; 04/02/08 08:24 AM.

GamerzWoW
The Official GamerzPlanet WoW Server
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
The only way is to actually send the value of $snicks to the bot...

/msg botnick !ban $snicks

for example.


Invision Support
#Invision on irc.irchighway.net
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
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

Joined: Jan 2004
Posts: 509
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
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.

Joined: Jul 2007
Posts: 1,129
T
Tomao Offline OP
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Never mind. I have worked this out. wink

Thank you all for your inputs.

Last edited by Tomao; 05/02/08 09:29 AM.

Link Copied to Clipboard