Jump to content

Archived

This topic is now archived and is closed to further replies.

chain

CRÉER DU MONDE SUR VOTRE SERVEUR IRC

Recommended Posts

  • Administrators

CRÉER DU MONDE SUR VOTRE SERVEUR IRC

 

Vous êtes root sur un serveur IRC, et vous vous lamentez de ne pas avoir de visite, ou que vos visiteurs s'esquivent trop rapidement par manque de monde. Vous pouvez, à l'aide de ce script, y mirroriser des canaux IRC complets issus d'autres serveurs (tels que ceux du réseau Undernet), ce qui donnera l'impression à vos visiteurs que votre serveur est fortement fréquenté.

 

>1.##################################################################2.#      MUPPET SHOW- PAR Averell ET NiCkOoS                       #3.#      Version 1.14                                              #4.#                                                                #5.#      Je dédis ce script à mon vieux pote DJ-Philo, à l'origine #6.#      de l'appellation "poupées" qui, peut-être, joue encore    #7.#      avec ses pigeons, son fer à souder et ses scripts mirc    #8.#      au paradis, s'il a le bonheur d'y avoir une connexion     #9.#      internet...                                               #10.#                                                                #11.#      Configurer le fichier (jusqu'à la ligne de fin)           #12.#      Lancer depuis un shell par nohup tclsh muppets.tcl &      #13.#                                                                #14.#      Amusez-vous bien !                                        #15.##################################################################16.17.namespace eval proxy {18.    # Serveur espionné: il s'agit du serveur qui devra être répliqué19.    20.    #Realname de la poupée espion21.    variable realname "Kermit la Grenouille"22.    23.    # Ip ou dns du serveur où connecter le bot24.    variable ip "Diemen.NL.EU.Undernet.Org"25.    26.    # Port de connection27.    variable port "7000"28.    29.    # Pseudo du bot30.    variable pseudo "KermitFrog"31.    # Ident du bot32.    variable ident "Frog"33.    34.    # Le salon où se produit l'opération35.    variable salon "#Quebec"36.    37.    38.    # Who a la connection ?39.    # 1 = oui    0 = non40.    variable who "1"41.    42.    # Chat = 1 on parle, Chat = 0 on ne parle pas (aux muppets)43.    variable chat "1"44.	45.	# Les chans de la liste "reels" apparaîtront avec le nom correspondant de la liste "virtuels"46.	variable reels {#Quebec}47.	variable virtuels {#Accueil}48.}49.50.namespace eval poupee {51.    52.    # Serveur miroir (le vôtre...)53.    54.    # Description du serveur de poupées55.    variable servername "Serveur de muppets"56.    57.    # Nom du link (mettre le bloc de link correspondant, genre link serveur.de.muppets ( blah ... )58.    variable link "serveur.de.muppets"59.    60.    # Mot de passe de connection (mettre le bon mot de passe)61.    variable pass "openaccess"62.    63.    # Ip ou dns du serveur où connecter le bot (mon serveur)64.    variable ip "irc.votre-serveur.fr"65.    66.    # Port de connection (mettre le port de link correspondant)67.    variable port "6667"68.    69.    # Realname des poupées anonymes sur chan (n'est jamais dévoilé sur le serveur espionné)70.    variable realname "Un nouveau muppet..."71.    variable ident "Muppet"72.    variable host "Anonymous.Muppet"73.    74.    # Nom du service75.    variable nameserv "dollyserv"76.    variable identserv "service"77.    variable hostserv "localhost.net"78.    variable realnameserv "Service de gestion des poupées"79.    80.	81.	# Commandes pour faire agir un bot82.    variable saymsg "say"83.	variable actmsg "act"84.	variable notcmsg "notice"85.	variable modemsg "mode"86.	variable kickmsg "kick"87.	88.    # Commande pour quitter tout et stopper le process89.    variable diemsg "die"90.    91.    #Commande pour rafraîchir le chan (en cas de modification coté serveur miroir)92.    variable resetmsg "reset"93.    94.    #Commande pour changer de chan principal95.    variable setchanmsg "setchan"96.    97.    #Commande pour joindre le chan principal98.    variable joinmsg "join"99.    100.    #Commande pour partir d'un chan (par exemple: /msg Fozzy leave #channel)101.    variable leavemsg "leave"102.    103.    #Commande pour forcer une commande irc (genre /msg Fozzy raw mode #chan +o untel)104.    variable rawmsg "raw"105.    106.    # Qui suis-je (qui est l'owner du bot)?107.    variable me "Tom"108.    109.    # Flood (3:5 signifie: 3 joins en moins de 5 secondes)110.    variable flood "3:5"111.    112.    # Permettre ou non le changement de topic113.    variable changetopic "1"114.	115.    # Divers messages configurables116.    117.    variable LIGNE_1 "Attention!! %pseudo s'est déconnecté!"118.    variable LIGNE_2 "Le salon %salon n'existe pas!!"119.    variable LIGNE_3 "net.com split.com"120.    variable LIGNE_4 "L'espion %pseudo a été kické!"121.    variable LIGNE_5 "C'est bon, je quitte!"122.    variable LIGNE_6 "Reset total envoyé !"123.    variable LIGNE_7 "OK, nouveau salon: %salon"124.    variable LIGNE_8 "Non c'est pas bon!"125.    variable LIGNE_9 "OK, j'ai joint %salon"126.    variable LIGNE_10 "Non je ne peux pas partir du salon principal!"127.    variable LIGNE_11 "OK, je suis parti de %salon"128.    variable LIGNE_12 "Non c'est pas bon!"129.    variable LIGNE_13 "Parti du channel!"130.    variable LIGNE_14 "Parti!"131.    variable LIGNE_15 "Bye everybody!"132.    variable LIGNE_16 "Commande %commande exécutée!"133.    variable LIGNE_17 "Pardon?"134.    variable LIGNE_18 "Le pseudo %pseudo est déja pris. Choisissez-en un autre"135.    variable LIGNE_19 "Le channel %salon est plein!"136.    variable LIGNE_20 "Le channel %salon est en +i (invite only)!"137.    variable LIGNE_21 "Votre robot est banni du channel %salon !"138.    variable LIGNE_22 "Le channel %salon est protégé par une clé!"139.	140.    variable debug "0"141.}142.143.######### FIN DE LA PARTIE CONFIGURABLE - A PARTIR D'ICI, DEFENSE DE RIEN TOUCHER :)  ###########144.145.set ::poupee(protocol) "unreal32"146.147.##### DEBUG ###########148.149.proc print { arg } {150.    if {$poupee::debug == "1"} { puts "[clock format [clock seconds] -format {[%H:%M:%S]}] [join $arg]" }151.}152.153.##### FONCTIONS DE GESTION DES FLAGS ###########154.155.proc acces { lname } {156.    if { $lname == "" } { return "" }157.    return [lindex $lname 0]158.}159.160.proc pondere { signe } {161.    if { $signe == "" } { return 0 }162.    return [expr [string map { + 1 % 2 @ 3 & 4 ~ 5 } $signe]]163.}164.165.proc insere { lname signe } {166.    upvar 1 $lname liste167.    168.    set liste2 ""169.    170.    for {set i 0} { $i  [pondere $signe] } {  lappend liste2 [lindex $liste $i] } else { break }172.    }173.    174.    if { $liste == "" } { lappend liste2 $signe } elseif { [lindex $liste $i] != $signe } { lappend liste2 $signe }175.    176.    for { } { $i = 0} {219.        set tabflood($i) 0220.        incr i -1221.    }222.}223.224.proc poupee::flood { } {225.    global floodnum floodtime tabflood226.    227.    # global botnick228.    if {$floodnum == 0} {229.        return 0230.    }231.    set i [expr $floodnum - 1]232.    while {$i >= 1} {233.        set tabflood($i) $tabflood([expr $i - 1])234.        incr i -1235.    }236.    set tabflood(0) [clock seconds]237.    if {[expr [clock seconds] - $tabflood([expr $floodnum - 1])]  -1 } { lappend liste [list [lindex $signes($s) $i] $s] }331.    }332.    return $liste333.}334.335.proc poupee::replaceall {lui parlui } {336.    global salons users miroir comchan337.    338.    foreach s $salons {339.        set i [lsearch -exact $users($s) $lui]340.        if { $i = 0 } { lappend miroir([string toupper $salon]) $user423.               if { [lsearch -exact $comchan($user) [string toupper $salon]]  -1 } {688.                                set signe [acces [lindex $signes([string toupper $chan]) $i]]689.                                if { $signe == "" || $signe == "+" } { puts $::socket(poupee) ":$user MODE $user +o"; print "ircop depuis mode" }690.                            }691.                        }692.                        # Seul un ircop peut changer les modes s'il n'a pas le flag approprié693.                        694.                        poupee::mode $user [lindex $cible 0] $chan [lindex $cible 1] [lindex $cible 2] }695.                }696.                if {$sedeoppe == 1} { poupee::mode $user "-o" $chan $user pseudo }697.            }698.        }699.        "PART" {700.            print $arg701.            set user [lindex [split [string trim [lindex $arg 0] :] "!"] 0]702.            set chan [rvv [string trim [lindex $arg 2] :]]703.            set msg [lrange $arg 3 end]704.            705.            poupee::part $user $chan $msg706.            707.        }708.        "KICK" {709.            print $arg710.            set user [lindex [split [string trim [lindex $arg 0] :] "!"] 0]711.            set chan [rvv [string trim [lindex $arg 2] :]]712.            set cible [lindex $arg 3]713.            set msg [lrange $arg 4 end]714.            715.            poupee::creer [string trim [lindex $arg 0] :] $chan $poupee::realname -1716.            # Seul un ircop peut kicker si extérieur au chan717.            718.            set i [lsearch -exact $users([string toupper $chan]) $user]719.            if { $i > -1 } {720.                set signe [acces [lindex $signes([string toupper $chan]) $i]]721.                if { $signe == "" || $signe == "+" } { puts $::socket(poupee) ":$user MODE $user +o"; print "ircop depuis kick" }722.            }723.            # Seul un ircop peut kicker s'il n'a pas les flags appropriés724.            725.            poupee::kick $user $chan $cible $msg726.            727.            if { $cible == $proxy::pseudo } {728.                regsub %pseudo $poupee::LIGNE_4 $proxy::pseudo LIGNE_4b729.                puts $::socket(poupee) ":$poupee::nameserv NOTICE $poupee::me :$LIGNE_4b"730.                poupee::megasplit731.                puts $::socket(proxy) "JOIN [vvr $chan]"732.            }733.        }734.        "NICK" {735.            print $arg736.            set user [lindex [split [string trim [lindex $arg 0] :] "!"] 0]737.            set newnick [string trim [lindex $arg 2] :]738.            if {[poupee] == ""} { poupee::creer [string trim [lindex $arg 0] :] [rvv $proxy::salon] $poupee::realname 1 }739.            # Le changement de nick n'a pas lieu sur un chan particulier. Pb si changement de pseudo au moment du join (latence du /who)740.            741.            puts $::socket(poupee) ":$user NICK $newnick"742.            poupee::replaceall $user $newnick743.        }744.        "QUIT" {745.            print $arg746.            set user [lindex [split [string trim [lindex $arg 0] :] "!"] 0]747.            set msg [lrange $arg 2 end]748.            poupee::quit $user $msg749.        }750.    }751.}752.753.proc poupee::connect { user ident host realname } {754.    755.    puts $::socket(poupee) "NICK $user 1 [clock seconds] $ident $host $poupee::link :$realname"756.    puts $::socket(poupee) ":$user MODE $user +i"757.}758.759.760.proc poupee::commande { user cmd } {761.    global quitter salons762.    763.	if { [string compare -nocase [lindex $cmd 0] ":$poupee::saymsg"] == 0 } {764.        puts $::socket(poupee) ":[lindex $cmd 1] PRIVMSG [lindex $cmd 2] :[join [lrange $cmd 3 end]]"765.		766.    } elseif { [string compare -nocase [lindex $cmd 0] ":$poupee::actmsg"] == 0 } {767.        puts $::socket(poupee) ":[lindex $cmd 1] PRIVMSG [lindex $cmd 2] :\001ACTION [join [lrange $cmd 3 end]]\001"768.		769.    } elseif { [string compare -nocase [lindex $cmd 0] ":$poupee::notcmsg"] == 0 } {770.        puts $::socket(poupee) ":[lindex $cmd 1] NOTICE [lindex $cmd 2] :[join [lrange $cmd 3 end]]"771.		772.    } elseif { [string compare -nocase [lindex $cmd 0] ":$poupee::modemsg"] == 0 } {773.        puts $::socket(poupee) ":[lindex $cmd 1] MODE [join [lrange $cmd 2 end]]"774.		775.    } elseif { [string compare -nocase [lindex $cmd 0] ":$poupee::kickmsg"] == 0 } {776.        puts $::socket(poupee) ":[lindex $cmd 1] KICK [lindex $cmd 2] [lindex $cmd 3] :[join [lrange $cmd 4 end]]"777.		778.    } elseif { [string compare -nocase [lindex $cmd 0] ":$poupee::diemsg"] == 0 } {779.	780.        puts $::socket(poupee) ":$poupee::nameserv NOTICE $poupee::me :$poupee::LIGNE_5"781.        puts $::socket(proxy) "QUIT :$poupee::LIGNE_15"782.        783.    } elseif { [string compare -nocase [lindex $cmd 0] ":$poupee::resetmsg"] == 0 } {784.        785.        puts $::socket(poupee) ":$poupee::nameserv NOTICE $poupee::me :$poupee::LIGNE_6"786.        poupee::megasplit787.        foreach s $salons {788.            puts $::socket(proxy) "NAMES [vvr $s]"789.        }790.        puts $::socket(proxy) "WHO $proxy::salon"791.        792.    } elseif { [string compare -nocase [lindex $cmd 0] ":$poupee::setchanmsg"] == 0 } {793.        if [regexp {^#} [lindex $cmd 1]] { set proxy::salon [vvr [lindex $cmd 1]]794.            regsub %salon $poupee::LIGNE_7 $proxy::salon LIGNE_7b795.            puts $::socket(poupee) ":$poupee::nameserv NOTICE $poupee::me :$LIGNE_7b"796.        } else { puts $::socket(poupee) ":$poupee::nameserv NOTICE $poupee::me :$poupee::LIGNE_8" }797.        798.    } elseif { [string compare -nocase [lindex $cmd 0] ":$poupee::joinmsg"] == 0 } {799.        if [regexp {^#} [lindex $cmd 1]] { set proxy::salon [vvr [lindex $cmd 1]]800.        puts $::socket(proxy) "JOIN $proxy::salon"801.        regsub %salon $poupee::LIGNE_9 $proxy::salon LIGNE_9b802.        puts $::socket(poupee) ":$poupee::nameserv NOTICE $poupee::me :$LIGNE_9b"803.        } else { puts $::socket(poupee) ":[lindex $cmd 1] JOIN [lindex $cmd 2]" }804.    } elseif { [string compare -nocase [lindex $cmd 0] ":$poupee::leavemsg"] == 0 } {805.        if [regexp {^#} [lindex $cmd 1]] {806.            if { [string compare -nocase [vvr [lindex $cmd 1]] $proxy::salon] == 0 } {807.                puts $::socket(poupee) ":$poupee::nameserv NOTICE $poupee::me :$poupee::LIGNE_10"808.                return809.            }810.            puts $::socket(proxy) "PART [vvr [lindex $cmd 1]]"811.            regsub %salon $poupee::LIGNE_11 [lindex $cmd 1] LIGNE_11b812.            puts $::socket(poupee) ":$poupee::nameserv NOTICE $poupee::me :$LIGNE_11b"813.            poupee::masspart [rvv [lindex $cmd 1]]814.			# On force rvv mais normalement on n'a pas à le faire car il faut spécifier un chan virtuel815.        } else { puts $::socket(poupee) ":[lindex $cmd 1] PART [lindex $cmd 2] :[join [lrange $cmd 3 end]]" }816.    } elseif { [string compare -nocase [lindex $cmd 0] ":$poupee::rawmsg"] == 0 } {817.        puts $::socket(proxy) "[join [lrange $cmd 1 end]]"818.        regsub %commande $poupee::LIGNE_16 [lindex $cmd 1] LIGNE_16b819.        puts $::socket(poupee) ":$poupee::nameserv NOTICE $poupee::me :$LIGNE_16b"820.    } else {821.        puts $::socket(poupee) ":$poupee::nameserv NOTICE $poupee::me :$poupee::LIGNE_17"	 }822.}823.824.proc poupee::part { user salon msg } {825.global comchan826.827.    poupee::virer $user [string toupper $salon]828.    if [info exists comchan($user)] {829.        if {$msg == ""} {	puts $::socket(poupee) ":$user PART $salon" } else {	puts $::socket(poupee) ":$user PART $salon [join $msg]" } 			830.        if { [lsearch -exact $comchan($user) [string toupper $salon]] > -1 } { 831.            enleve comchan($user) [string toupper $salon]832.        } 833.		if { $comchan($user) == "" } { poupee::quit $user ":$poupee::LIGNE_14" }834.        835.    }836.}837.838.proc poupee::quit { user msg } {839.global comchan840.841.    poupee::virer $user ""842.    if [info exists comchan($user)] {843.        puts $::socket(poupee) ":$user QUIT [join $msg]"844.        unset comchan($user)845.    }846.}847.848.proc poupee::mode { user mode salon cible pseudo } {849.    global signes users850.    851.        if { $mode != "+i" && $mode != "+l" && $mode != "+k" } { puts $::socket(poupee) ":$user MODE $salon $mode $cible" }852.	# Problème du chan bloqué (+ilk)853.    854.    if {$pseudo != ""} {855.        set i [lsearch -exact $users([string toupper $salon]) $cible]856.        set signe [lindex $signes([string toupper $salon]) $i]857.        858.        switch -exact -- $mode {859.            "+o" { insere signe @ }860.            "-o" { enleve signe @ }861.            "+h" { insere signe % }862.            "-h" { enleve signe % }863.            "+v" { insere signe + }864.            "-v" { enleve signe + }865.            "+a" { insere signe & }866.            "-a" { enleve signe & }867.            "+q" { insere signe ~ }868.            "-q" { enleve signe ~ }869.        }870.        set signes([string toupper $salon]) [lreplace $signes([string toupper $salon]) $i $i $signe]871.    }872.}873.874.proc poupee::kick { user salon cible msg } {875.global comchan876.877.    poupee::virer $cible [string toupper $salon]878.    if [info exists comchan($cible)] {879.        puts $::socket(poupee) ":$user KICK $salon $cible [join $msg]"880.        881.        if { [lsearch -exact $comchan($cible) [string toupper $salon]] > -1 } { 882.            enleve comchan($cible) [string toupper $salon]883.        } 884.		if { $comchan($cible) == "" } { poupee::quit $cible ":Kické!" }885.    }886.}887.888.proc poupee::kicklocal { salon user } {889.    global miroir comchan890.	891.    if [info exists comchan($user)] {892.	893.        if {[lsearch -exact $comchan($user) [string toupper $salon]]  -1 } { ldelete miroir([string toupper $salon]) $j }896.        897.    }898.}899.900.901.proc poupee::demarrage {} {902.    puts $::socket(proxy) "MODE $proxy::pseudo +iB"903.    puts $::socket(proxy) "JOIN $proxy::salon"904.    poupee::connect $poupee::nameserv $poupee::identserv $poupee::hostserv $poupee::realnameserv905.    puts $::socket(poupee) ":$poupee::nameserv MODE $poupee::nameserv +iB"906.}907.908.set quitter 0909.vwait quitter910. 

Link to comment
Share on other sites



×
×
  • Create New...