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.

need help

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
k
kikericsy
Voice
Posts: 5
Joined: Tue Jun 09, 2009 8:19 pm

need help

Post by kikericsy »

i want that my tcl work on a scpecified channel, how do i do?

set chan "" is not working

thanks :(
r
raider2k
Op
Posts: 140
Joined: Tue Jan 01, 2008 10:42 am

Post by raider2k »

2 ways to go:

either put

Code: Select all

if { [string equal $chan "#channelname"] } {
code here
}
at the beginning of your proc, or

put

Code: Select all

setudef flag flagname
outside of all procs and then put

Code: Select all

if { [channel get $chan flagname] } {
code here
}
at the beginning of your proc again and activate the channel by using ".chanset #channelname +flagname" on your bots partyline

also be aware that #channelname is case sensitive
k
kikericsy
Voice
Posts: 5
Joined: Tue Jun 09, 2009 8:19 pm

Post by kikericsy »

raider2k
thaks 4 your help, sorry but i´m a musician so i have no clou about scripting :?
this "code here" means that i should write something there or not?
r
raider2k
Op
Posts: 140
Joined: Tue Jan 01, 2008 10:42 am

Post by raider2k »

ok, i guess you would like to apply such a limitation to an existing script, right? if so, please paste the whole script here and ill show you what needs to be changed.
k
kikericsy
Voice
Posts: 5
Joined: Tue Jun 09, 2009 8:19 pm

Post by kikericsy »

i´ve made it (whit help of my friend), thanks a lot raider2k !
now I have another question. :D
i would like to use next.tcl script, this script by adding new user give this mask: *!user@*.domain , but i would like to have this mask: nick!*@*.domain . how can i change it?

hier is the whole script:
http://www.mibbit.com/pb/pQzTpy

(if you have time, could you change the !noidle command? i would like just to kick, not kickban. But this is not so important.More important whith the hostmask).

THANKS THANKS THANKS
r
raider2k
Op
Posts: 140
Joined: Tue Jan 01, 2008 10:42 am

Post by raider2k »

fine it worked out ;)

about the kick, but not kickban thing, you could try to use this one:

Code: Select all

#### noidle #### bantype code based on Moretools.tcl by MC_8

proc next.pub:noidle {nick uhost handle chan arg} {

        global botnick botname next

        if {[string tolower $chan] != $next(chan)} { return 0 }

        if {![next.check:authed $nick $uhost $handle]} { return 0 }

        if {[next.getlevel $handle] >= 2} {

        if {[lindex [split $arg] 0] == ""} {putserv "NOTICE $nick :Usage: .noidle <nick>"

        return}

        if {[next.getlevel [nick2hand [lindex [split $arg] 0] $next(chan)]] >= 1} {

          putnotc $nick "[lindex [split $arg] 0] is allowed to idle on $next(chan)!"; return}

        if {[onchan [lindex [split $arg] 0] $next(chan)]} {set index [lsearch -exact $next(list) [lindex [split $arg] 0]]

        if {$index >= 0} {

        set next(list) [lreplace $next(list) $index $index ]

        }

                switch $next(bantype) {

                  0 {set ban "*![string range [getchanhost [lindex [split $arg] 0] $next(chan)] [string first ! [getchanhost [lindex [split $arg] 0] $next(chan)]] e]"}

                  1 {set ban "*!*[string trimleft [string range [getchanhost [lindex [split $arg] 0] $next(chan)] [expr [string first ! [getchanhost [lindex [split $arg] 0] $next(chan)]]+1] e] "~"]"}

                  2 {set ban "*!*[string range [getchanhost [lindex [split $arg] 0] $next(chan)] [string first @ [getchanhost [lindex [split $arg] 0] $next(chan)]] e]"}

                  3 {set ident [string range [getchanhost [lindex [split $arg] 0] $next(chan)] [expr [string first ! [getchanhost [lindex [split $arg] 0] $next(chan)]]+1] [expr [string last @ [getchanhost [lindex [split $arg] 0] $next(chan)]]-1]] ; set ban "*!*[string trimleft $ident "~"][string range [maskhost [getchanhost [lindex [split $arg] 0] $next(chan)]] [string first @ [maskhost [getchanhost [lindex [split $arg] 0] $next(chan)]]] e]"}

                  4 {set ban "*!*[string range [maskhost [getchanhost [lindex [split $arg] 0] $next(chan)]] [string last "@" [maskhost [getchanhost [lindex [split $arg] 0] $next(chan)]]] e]"}

                  5 {set ban "[lindex [split $arg] 0]![string range [getchanhost [lindex [split $arg] 0] $next(chan)] [string first ! [getchanhost [lindex [split $arg] 0] $next(chan)]] e]"}

                  6 {set nick [string range [getchanhost [lindex [split $arg] 0] $next(chan)] 0 [expr [string first "!" [getchanhost [lindex [split $arg] 0] $next(chan)]]-1]] ; set ident [string range [getchanhost [lindex [split $arg] 0] $next(chan)] [expr [string first "!" [getchanhost [lindex [split $arg] 0] $next(chan)]]+1] [expr [string last "@" [getchanhost [lindex [split $arg] 0] $next(chan)]]-1]] ; set ban "[lindex [split $arg] 0]!*[string trimleft $ident "~"][string range [getchanhost [lindex [split $arg] 0] $next(chan)] [string last "@" [getchanhost [lindex [split $arg] 0] $next(chan)]] e]"}

                  7 {set nick [string range [getchanhost [lindex [split $arg] 0] $next(chan)] 0 [expr [string first "!" [getchanhost [lindex [split $arg] 0] $next(chan)]]-1]] ; set ban "[lindex [split $arg] 0]!*[string range [getchanhost [lindex [split $arg] 0] $next(chan)] [string last "@" [getchanhost [lindex [split $arg] 0] $next(chan)]] e]"}

                  8 {set nick [string range [getchanhost [lindex [split $arg] 0] $next(chan)] 0 [expr [string first "!" [getchanhost [lindex [split $arg] 0] $next(chan)]]-1]] ; set ident [string range [getchanhost [lindex [split $arg] 0] $next(chan)] [expr [string first "!" [getchanhost [lindex [split $arg] 0] $next(chan)]]+1] [expr [string last "@" [getchanhost [lindex [split $arg] 0] $next(chan)]]-1]] ; set ban "[lindex [split $arg] 0]!*[string trimleft $ident "~"][string range [maskhost [getchanhost [lindex [split $arg] 0] $next(chan)]] [string last "@" [maskhost [getchanhost [lindex [split $arg] 0] $next(chan)]]] e]"}

                  9 {set nick [string range [getchanhost [lindex [split $arg] 0] $next(chan)] 0 [expr [string first "!" [getchanhost [lindex [split $arg] 0] $next(chan)]]-1]] ; set ban "[lindex [split $arg] 0]!*[string range [maskhost [getchanhost [lindex [split $arg] 0] $next(chan)]] [string last "@" [maskhost [getchanhost [lindex [split $arg] 0] $next(chan)]]] e]"}

                  default {set ban "*!*[string range [getchanhost [lindex [split $arg] 0] $next(chan)] [string first "@" [getchanhost [lindex [split $arg] 0] $next(chan)]] e]"}

                }

                set nnick [lindex [split $ban !] 0]

                set iident [string range $ban [expr [string first ! $ban]+1] [expr [string last @ $ban]-1]]

                set hhost [string range $ban [expr [string last @ $ban]+1] e]

                if {$iident != [set temp [string range $iident [expr [string length $iident]-9] e]]} {set iident *[string trimleft $temp *]}

                if {$hhost != [set temp [string range $hhost [expr [string length $hhost]-63] e]]} {set hhost *[string trimleft $temp *]}

                set next(ban) "$nnick!$iident@$hhost"

        if {[string match "$next(ban)" "$botname"]} {putserv "NOTICE $nick :The ban ( $next(ban) ) matches me ..."

        return }

        newchanban $next(chan) $next(ban) $nick "$next(noidle)" $next(bantime)

        pushmode $chan -o [lindex [split $arg] 0]

        #pushmode $chan +b $next(ban)

        putkick $chan [lindex [split $arg] 0] "$next(noidle)"

        return }

        putserv "NOTICE $nick :[lindex [split $arg] 0] isn't on $next(chan)"

        return }

}
notice, that - 5 lines above - i only put a # in front of the line to make it kind of deactivated so it wont ban anymore. thats everything you need to do, put a # in front of it, nothing more, no other changes in the script. but try again ^^

regarding the new user hostmask i have to tell you that im sorry, please talk to the owner of the script

Code: Select all

#             |                                      |

#             | next v2.0 by mortician               |

#             |                                      |

#             | IRC:   irc.undernet.org - #mortician |

#             | email: mortician@linux.be            |

#             | www:   www.mortician.tk              |

#             |______________________________________|
;)
Post Reply