![]() |
|
|||||||
| Tcl scripting Tcl scripting related questions |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
TCB & Ratings projects Member, #Mythic representative
|
Am si eu nevoie de un script anti boti (sau persoane infectate) care dak ii iei la privat trimit automat un mesaj care contine spam. Eu ma gandeam la ceva care la join da automat un mesaj gen: Sunt un bot bla bla bla NU RASPUNDE LA ACEST MESAJ SAU VEI FI BANAT, iar daca raspunde sa ii dea automat ban. Prima parte e usor de facut dar partea cu banul in caz ca raspunde nush cum sa o fac... Ideea mea era sa setez o variabila si sa pun un timer care sa o dezactiveze, iar dak la un measaj privat variabila (care contine si informatii despre respectivul user, nick & host) este inca activa sa il baneze.
Asta e ce am facut eu, astept suggestii spre a il face functional:P Code:
bind join - * clone:check
setudef flag clonecheck
proc clone:check {nick uhost hand chan} {
if {![channel get $chan clonecheck]} {return}
puthelp "PRIVMSG $nick :-ATENTIE- Sunt un robot al canalului $chan si verific daca esti o persoana virusata si faci reclama pe privat!Nu raspunde la acest mesaj deoarece vei fi considerat virusat si vei primi ban! Multumesc. ;-)"
set clonecheck($nick,$uhost) 1
timer 10[list unset punished($nick)]
}
bind msg - * pub:clone:execute
proc pub:clone:execute {nick uhost hand chan} {
golbal punished($nick,$uhost)
if {punished($nick,$uhost) == "1"} {
newchanban $chan $uhost "Out clona"
}
}
puthelp "anticlone tcl loaded"
|
|
|
|
|
|
#2 (permalink) |
|
Member
Join Date: Jun 2004
Location: In the NeXuS
Posts: 160
Rep Power: 37 ![]() |
Incearca ceva de genu dar mai trebuie sa lucrezi la el
Code:
bind join - * clone:check
setudef flag clonecheck
proc clone:check {nick uhost hand chan} {
if {![channel get $chan clonecheck]} {return}
if { [matchattr $hand f|f $chan]} {return}
global punished
puthelp "PRIVMSG $nick :-ATENTIE- Sunt un robot al canalului $chan si verific daca esti o persoana virusata si faci reclama pe privat!Nu raspunde la acest mesaj deoarece vei fi considerat virusat si vei primi ban! Multumesc. :-)"
set punished($nick,$uhost) "$chan"
timer 10[list unset punished($nick,$uhost)]
}
bind msgm - * pub:clone:execute
proc pub:clone:execute {nick uhost hand arg} {
global punished botnick
if {[info exists punished($nick,$uhost)] } {
set ban "*!*@[lindex [split $uhost @] 1]"
newchanban $punished($nick,$uhost) $ban $botnick "reason for ban" 15m sticky
}
}
putlog ".... tcl loaded"
Last edited by lsn; 31-01-2006 at 18:20. |
|
|
|
|
|
#4 (permalink) |
|
TCB & Ratings projects Member, #Mythic representative
|
aleck ia ia dacilea
Code:
bind join - * clone:check
setudef flag anticlone
proc clone:check {nick uhost hand chan} {
if {![channel get $chan anticlone]} {return}
if {[matchattr $hand f|f $chan]} {return}
global punished
puthelp "PRIVMSG $nick :-ATENTIE- Sunt un robot al canalului $chan si verific daca esti o persoana virusata si faci reclama pe privat!Nu raspunde la acest mesaj deoarece vei fi considerat virusat si vei primi ban! Multumesc. :-)"
set punished($nick,$uhost) "$chan"
timer 10[list unset punished($nick,$uhost)]
}
bind msgm - * pub:clone:execute
proc pub:clone:execute {nick uhost hand arg} {
global punished botnick
if {[info exists punished($nick,$uhost)]} {
set ban *!*@[lindex [split $uhost @] 1]
newchanban $punished($nick,$uhost) $ban $botnick "Ai grija s-ar putea sa ai scriptul infectat. Intra pentru #dmsetup, #nohack sau #vh pentru a verifica!" 15m sticky
}
}
putlog "anticlone tcl loaded"
A da si vezi k in randul asta: Code:
timer 10[list unset punished($nick,$uhost)] |
|
|
|
|
|
#6 (permalink) |
|
Administrator
aka aqwzsx |
Code:
if {![channel get $chan anticlone]} {return}
if {[matchattr $hand f|f $chan]} {return}
Code:
timer 10[list unset punished($nick,$uhost)] Code:
if {[info exists punished($nick,$uhost)]} {
Code:
set punished($nick,$uhost) "$chan" Code:
if {[info exists punished($nick,$uhost)]} {
In plus, nu sunt sigur ca cel mai optimal timer e de zece secunde, script`urile infectate pot avea si lag apropos, ca fac publicitate la greu :) Deasemenea unii au script care automat in privat poate sa spuna "bla bla sunt away" sau "bla bla am cel mai tare script". Adica eu as sugera sa vezi cum sunt facute alte script`uri de asa gen, si sa postezi ceva mai amplu/complex, si ca proceduri de verificare si ca cod de executie. La putlog posteaza autorul si ar fi bine reteaua si canalul. Ca sa fie mai informativ si ca sa nu te miri ca poimaine apare script`ul tau undeva fara copyright. In plus, inainte de a posta, sa verificati script`urile mai atent. In special pe canale si cu nick/ident cu semne speciale de gen {{[\. |
|
|
|
|
|
#7 (permalink) |
|
Member
Join Date: Dec 2004
Location: Under a rock!
Posts: 116
Rep Power: 32 ![]() |
Eu unu am facut un hash md5 la $nick:$uhost (parca) si am memorat asta intr-o variabila. Cand primeam raspuns, simplu verificam daca hash-ul pe care il facem atunci exista in lista mea, iar de canale pur si simplu le luam pe toate la rand pe care era eggdrop-ul. Codul meu arata asa:
Code:
## ¤ dronecheck.tcl
# version 1.0
# author: caesar
# e-mail: <cezarica01 [at] yahoo [dot] com>
# IRC: #eggdrop @ Undernet.org
##
# ¤ Description:
# Will send a private message upon join to check either or not that person is in fact a drone not a real person.
##
# ¤ Available commands:
# Where Flag Command Description
# ----- ---- ------- -----------
# PUB : N/A
# MSG : N/A
# DCC : n|n .chanset Use .chanset to set what protections to active for the particular channel or not.
# Example: .chanset #mychan +dronecheck
# .chanset #otherchan -dronecheck
##
# ¤ Notes:
# This script was tested to work properly on eggdrop 1.6.17 or greater. Please upgrade
# your eggdrop or remove/unload the script.
#
# Some sort of feedback will be appreciated!
##
# ¤ Custom channel flags:
# Flag: Description:
# ----- ------------
# +dronecheck Will send that on join message.
#
# ¤ Notes:
# By default the channel flag 'dronechek' is disabled. Enable it on the channels you wish.
# The only things that you should change are 'drone(*)' (where * stands for a specific setting).
package require Tcl 8.3
package require eggdrop 1.6
namespace eval drone {
##
# .1. Message that will be sent to users upon joining to check either or not it's a drone or a real person:
set drone(join) {Hi. I'm a bot of $chan channel and I'm checking either or not you are a drone. Please don't reaply to this message because you will get banned if you do. Thank you for your cooperation.}
##
# .2. Define the flasg that should be excepted from the on join message:
set drone(flags) {f|f}
##
# .3. Reason for banning the drones:
set drone(reason) {Begone drone!}
##
# .4. How much time the ban should last:
set drone(bantime) {15m}
##
# .5. Define the type of the banmask:
# 0/1 ~> *!*foo@*.bar.com
# 2 ~> *!*@moo.bar.com
# 3 ~> *!*@*.bar.com
# 4 ~> *!*foo@moo.bar.com
# 5 ~> *!*foo@*
set drone(type) {2}
#
## ¤ Don't edit past here unless you know TCL! ¤
#
variable version {1.0}
setudef flag dronecheck
variable binds {join:check msgm:execute time:t1mer}
# quick cleanup
foreach elem [binds] {
foreach {type flags name hits proc} $elem {
if {[string match [namespace current]::* $proc]} {
unbind $type $flags $name $proc
}
}
}
foreach elem $binds {
scan $elem {%[^:]:%s} bind name
bind $bind - * [namespace current]::$name
}
# taken from xchannel.tcl by demond@demond.net
proc maskhost {nuhost {type 0}} {
scan $nuhost {%[^!]!%[^@]@%s} nick user host
scan [set mask [::maskhost $nuhost]] {%*[^@]@%s} mhost
switch $type {
0 - 1 { return $mask } ;# *!*foo@*.bar.com
2 { return *!*@$host } ;# *!*@moo.bar.com
3 { return *!*@$mhost } ;# *!*@*.bar.com
4 { return *!*$user@$host } ;# *!*foo@moo.bar.com
5 { return *!*$user@* } ;# *!*foo@*
6 { return $nuhost }
}
}
proc check {nick uhost hand chan} {
variable drones; variable drone
if {![channel get $chan dronecheck] || [matchattr $hand $drone(flags) $chan]} return
if {![botisop $chan] || [isbotnick $nick]} return
set hash [md5 $nick,$uhost]
if {[info exists drones($hash)]} return
puthelp "PRIVMSG $nick :[subst $drone(join)]"
set drones($hash) [unixtime]
}
proc execute {nick uhost hand text} {
variable drones; variable drone
set hash [md5 $nick,$uhost]
if {![info exists drones($hash)]} return
foreach chan [channels] {
if {![channel get $chan dronecheck] || ![onchan $nick $chan] || ![botisop $chan]} continue
newchanban $chan [maskhost $nick!$uhost $drone(type)] Drone? $drone(reason) $drone(bantime)
}
purge $hash
}
proc t1mer {min hour day month year} {
variable drones
foreach {hash data} [array get drones] {
if {[expr [unixtime] - [set ts [lindex $data 0]]] >= 60} {
purge $hash
}
}
}
proc purge {hash} {
variable drones
if {![info exists drones($hash)]} return
unset drones($hash)
}
putlog "dronecheck.tcl v$version loaded.."
}
|
|
|
|
|
|
#8 (permalink) |
|
Junior Member
Join Date: Jun 2006
Posts: 1
Rep Power: 0 ![]() |
am luat acest script si l`am pus intr`un fisier spam.tcl . l`am uploadat pe shell l`am pus in folder`ul pentru tcl`uri, iar in eggdrop.conf am setat source scripts/spam.tcl ....
am dat rehash la bot intrebarea mea este cum pun botul sa dea acele mesaje ce mai trebuie sa fac. Sunt incepator in tcl`uri si am nevoie de ajutor ... ma puteti ajuta ? Multumesc anticipat Last edited by lsn; 10-08-2006 at 15:48. |
|
|
|
|
|
#10 (permalink) |
|
Junior Member
|
ca sa iti mearga pe de pe canal, trebuie sa adaugi anticlone in procesu de ChanSet, care-l gasesti in fisieru a&a_22_a_local_n.tcl din folderu /ascript/
Un exemplu unde l-ai putea pune este linia asta: Code:
[regexp {^[+-](anticlone|auto(op|voice)|bitch|cycle|revenge(bot|)|dontkickops|nodesynch|(dynamic|enforce|user)bans|inactive|protect(friends|ops)|secret|greet|seen|anti(pub|colour|bold|underline|notice|url|reverse|repeat|action)|limit|secure|voice|op|enforcetopic)$} $mode]} {channel set $chan $mode} elseif {
Last edited by lsn; 10-08-2006 at 15:49. Reason: varianta pentru ascript de adaugare chanset |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Modify script] Spam Script | zappu | Tcl scripting | 5 | 07-09-2008 12:53 |
| Anti-Idle TCL | GoRaPiD | Tcl scripting | 4 | 15-01-2005 21:22 |
| Anti Repeat | GoRaPiD | Tcl scripting | 1 | 10-12-2004 01:59 |