mIRC Home    About    Download    Register    News    Help

Topic Options
#194424 - 04/02/08 04:48 AM I need help with this snippet
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
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
  }
}


Edited by Tomao (04/02/08 07:50 AM)

Top
#194425 - 04/02/08 05:36 AM Re: I need help with this snippet [Re: Tomao]
genius_at_work Offline
Hoopy frood

Registered: 08/10/05
Posts: 1741
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

Top
#194426 - 04/02/08 06:04 AM Re: I need help with this snippet [Re: Tomao]
5618 Offline
Hoopy frood

Registered: 18/06/07
Posts: 933
You want their clients to send you $snicks and then make your bot act on that output.

Top
#194427 - 04/02/08 06:11 AM Re: I need help with this snippet [Re: 5618]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
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.


Edited by Tomao (04/02/08 06:15 AM)

Top
#194428 - 04/02/08 08:24 AM Re: I need help with this snippet [Re: Tomao]
XTZGZoReX Offline
Babel fish

Registered: 22/09/07
Posts: 65
Loc: Denmark
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.


Edited by XTZGZoReX (04/02/08 08:24 AM)
_________________________
GamerzWoW
The Official GamerzPlanet WoW Server

Top
#194431 - 04/02/08 11:10 AM Re: I need help with this snippet [Re: Tomao]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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

Top
#194433 - 04/02/08 03:18 PM Re: I need help with this snippet [Re: Tomao]
genius_at_work Offline
Hoopy frood

Registered: 08/10/05
Posts: 1741
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

Top
#194434 - 04/02/08 03:30 PM Re: I need help with this snippet [Re: Tomao]
LostShadow Offline
Fjord artisan

Registered: 12/01/04
Posts: 509
Loc: Chicago, Illinois, U.S.A.
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.

Top
#194485 - 05/02/08 09:17 AM Re: I need help with this snippet [Re: LostShadow]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
Never mind. I have worked this out. wink

Thank you all for your inputs.


Edited by Tomao (05/02/08 09:29 AM)

Top