egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

script: string's problems

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
Progeny
Guest





PostPosted: Fri Nov 08, 2002 6:38 pm    Post subject: script: string's problems Reply with quote

Quote:
### ChanServ's list synchronizer v1.2 for eggdrop
### Written by Progeny <progeny@azzurra.org>
###
### Now your eggdrop may be sinchronized to the channel's op list.
### You don't add manually any op to your eggdrop!

### Thanks to C|ty_Hunter, Neiken for the helpful test

set csrehash 15

set tmpchans ""
set dyntmpchan ""
set tmpnick ""
set gnick ""
set gchan ""
set gcmd ""

set csmask "ChanServ!service@azzurra.org"
set liststrig "*list di*"
set xoplist "*) * (*) by *"
set stopcode "Fine della Lista"

bind pub - !op giveop
bind pub - !deop takeop
bind pub - !ban buser
bind pub - !kick kickuser
bind pub n !csrehash rehashlists
bind raw - "NOTICE" addoptolist
bind raw - 307 setid

set flood-msg 0

proc checkid {nick} {
putserv "whois $nick"
}

proc setid {from keyword text} {
global gnick gchan gcmd
checkop $gnick $gchan $gcmd
}

proc checkop {nick channel comando} {
global tmpchans greason
foreach tmpchan $tmpchans {

set dynnick [lindex [split $tmpchan ":"] 0]
set dynchan [lindex [split $tmpchan ":"] 1]
if {([string tolower $nick] == [string tolower $dynnick]) && ([string tolower $channel] == [string tolower $dynchan])} {
if {[string tolower $comando] == "op"} { putserv "mode $channel +o $nick" }
if {[string tolower $comando] == "deop"} { putserv "mode $channel -o $nick" }
if {[string tolower $comando] == "kick"} { putserv "kick $channel $nick :$greason" }
if {[string tolower $comando] == "ban"} { putserv "mode $channel +b [getchanhost $nick]"
putserv "kick $channel $nick :$greason"
}

}
}
}

proc giveop {nick uhost handle channel text} {
global gcmd gchan gnick
set gnick $nick
set gchan $channel
set gcmd "op"
checkid $nick
}

proc takeop {nick uhost handle channel text} {
global gcmd gchan gnick
set gnick $nick
set gchan $channel
set gcmd "deop"
checkid $nick
}

proc buser {nick uhost handle channel text} {
global gcmd gchan gnick greason
set gnick [lindex $text 0]
set gchan $channel
set gcmd "ban"
set greason [lrange $text 1 end]
checkid $nick
}

proc kickuser {nick uhost handle channel text} {
global gcmd gchan gnick greason
set gnick [lindex $text 0]
set gchan $channel
set gcmd "kick"
set greason [lrange $text 1 end]
checkid $nick
}

proc rehashlists {nick uhost handle channel text} {
sendrehash
}

proc sendrehash {} {
global tmpchans csrehash
set tmpchans ""
foreach chan [channels] {
puthelp "PRIVMSG ChanServ :aop $chan list"
puthelp "PRIVMSG ChanServ :sop $chan list"
puthelp "PRIVMSG ChanServ :cf $chan list"
}
dccbroadcast "CS Synch: Updating CS lists."
timer $csrehash sendrehash
}

proc addoptolist {from keyword text} {
global csmask liststrig xoplist tmpchans dyntmpchan tmpnick stopcode
if {[string tolower $from] == [string tolower $csmask]} {

if {[string match [string tolower $liststrig] [string tolower $text]]} {
set dyntmpchan [lindex $text 4]
regsub -all "\002" $dyntmpchan "" dyntmpchan
}
}

if {[string match [string tolower $xoplist] [string tolower $text]]} {
set tmpnick [lindex $text 3]
regsub -all "\002" $tmpnick "" tmpnick
lappend tmpchans "$tmpnick:$dyntmpchan"
}
}

timer $csrehash sendrehash
putlog "ChanServ's list synchronizer"


This is my script. It works fine but if the nick of user to kick or ban contains bad chars don't works! i.e. if the nick to kick contains the char 0, tcl don't works!
Anyone has suggestions?
Back to top
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber