This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Mirc script to tcl request

Old posts that have not been replied to for several years.
Locked
S
SpAwN
Voice
Posts: 4
Joined: Sun Jan 02, 2005 11:18 am

Mirc script to tcl request

Post by SpAwN »

Hi,

I am totally new to tcl, I can write little bit mirc scripts but I don’t know how to write for tcl.

Let me explain where I use this script for:
We have a lot floods in our channels, flooders use well-known flood script by loading the clones from a proxy list.
However there are only 3 irc servers which lets connect proxies.

I made a script, which does /whois on everyone joining to our channels so this way the script sees where users join from (IRC server)
If we get flooded I set this extra mirc client OP so it bans people joining from those servers, if the flood is over I deop the client where the script is on. It sets only the bans and my own client set the enforced bans so it doesn’t kick our regular users from our channel because they are in my friends list.

This way the flooders don’t even get the change to flood, because they get banned and kicked on their join so there is no time over to flood.

Since I have new eggdrops I thought I can use this on my bots
I did search in the forum and tcl scripts section and I couldn’t find any script, which does this.

If anyone will take a look for me I really appreciate it :)

This is the script:

Code: Select all

raw 311:*.*: { 
  set %channelnick $2
  set %channelident $3
  set %channelhost $4
}

raw 312:*irc.mzima.net*: {
  ban -ku16000 #channel %channelhost
}

raw 312:*irc.choopa.net*: {
  ban -ku16000 #channel %channelhost
}

raw 312:*irc.inet.tele.dk*: {
  ban -ku16000 #channel %channelhost
}

on *:join:#channel: { 
  whois $nick 
}
Thanks :D
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

This should do the trick..

Code: Select all

set proxy(channel) "#channel"
set proxy(servers) {irc.mzima.net irc.choopa.net irc.inet.tele.dk}
set proxy(stuff) {"Bad server or whatever!" 1440}

bind raw - 312 proxy:check
bind join * "${proxy(channel)} *" proxy:whois

# join
proc proxy:whois {nick uhost hand chan} {
  if {[isbotnick $nick] || [matchattr $hand of|of]} {
    return
  }
  puthelp "WHOIS $nick"
}

# raw
proc proxy:check {from key txt} { 
  global proxy
  set network [lindex [split $txt] 2]
  if {[lsearch $proxy(servers) $network] != -1} {
    set nick [lindex [split $txt] 1]
    set chan $proxy(channel)
    set host [getchanhost $nick $proxy(channel)]
    set reason [lindex $proxy(stuff) 0]
    set btime [lindex $proxy(stuff) 1]
    if {[botisop $chan]} {
      putquick "KICK $chan $nick :$reason" -next
    }
    newchanban $chan *!*@[lindex [split $host @] 1] Proxy $reason $btime
  }
}
Once the game is over, the king and the pawn go back in the same box.
S
SpAwN
Voice
Posts: 4
Joined: Sun Jan 02, 2005 11:18 am

Post by SpAwN »

Hi, Thanks, it works perfect indeed!

But i did remove this part so it only sets the bans:

Code: Select all

    if {[botisop $chan]} { 
      putquick "KICK $chan $nick :$reason" -next 
    }
But somehow it is still kicking them out after seting the bans.

Another problem is, i got a small botnet and the other bots are using this tcl script to, the script spose to run on a leaf bot but it is still sharing.
is there a way to make this work only on one bot?

If i make -shared in channel settings it doesnt share its users files i think.
Once again thanks for your time, i really appreciate it :)

EDIT:
___________________________________
Ok i see why the other bots ban same IP because the script ads IP's as banned in user list and since the bots share the user list they ban the IP's on join

Is there a way not to add bans with this script?

The reason why ask for this is that the bot which set the bans shouldnt kick, this way it can set the bans much faster, since we have a channel with 400+ users bot has to do a lot whois onjoin, so if the bot sets the bans and another bot the enforced bans it is better.

The reason why bans shouldnt be added as (sticky) to users list is that the flooder uses a proxy list and can join with more than 100 clones with different IP's so our ban list gets full, and some other users can use same proxy to join and if its in the user list they can never join the channel anymore.

I know i ask to much :P
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

In this case I'd do a timed /who #channel instead of the whois upon join. Anyway, I can easily add a join-flood protection if that's what you want.. The ban is added normaly in the internal channel banlist, not made sticky. If you want a bot to do the check and another to do the banning then use putbot or putallbots. Either search or make yourself one, a channel locker when the channel banslist gets full or something similar.
Once the game is over, the king and the pawn go back in the same box.
S
SpAwN
Voice
Posts: 4
Joined: Sun Jan 02, 2005 11:18 am

Post by SpAwN »

Ok, thanks for your time :)

I'll try to change the script and see if it works.
Locked