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 

need help

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
kikericsy
Voice


Joined: 09 Jun 2009
Posts: 5

PostPosted: Tue Jun 09, 2009 8:25 pm    Post subject: need help Reply with quote

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

set chan "" is not working

thanks Sad
Back to top
View user's profile Send private message
raider2k
Op


Joined: 01 Jan 2008
Posts: 140

PostPosted: Tue Jun 09, 2009 9:59 pm    Post subject: Reply with quote

2 ways to go:

either put

Code:
if { [string equal $chan "#channelname"] } {
code here
}


at the beginning of your proc, or

put

Code:
setudef flag flagname


outside of all procs and then put

Code:
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
Back to top
View user's profile Send private message
kikericsy
Voice


Joined: 09 Jun 2009
Posts: 5

PostPosted: Wed Jun 10, 2009 6:03 am    Post subject: Reply with quote

raider2k
thaks 4 your help, sorry but i´m a musician so i have no clou about scripting Confused
this "code here" means that i should write something there or not?
Back to top
View user's profile Send private message
raider2k
Op


Joined: 01 Jan 2008
Posts: 140

PostPosted: Wed Jun 10, 2009 10:46 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
kikericsy
Voice


Joined: 09 Jun 2009
Posts: 5

PostPosted: Thu Jun 11, 2009 9:25 am    Post subject: Reply with quote

i´ve made it (whit help of my friend), thanks a lot raider2k !
now I have another question. Very Happy
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
Back to top
View user's profile Send private message
raider2k
Op


Joined: 01 Jan 2008
Posts: 140

PostPosted: Thu Jun 11, 2009 11:07 am    Post subject: Reply with quote

fine it worked out Wink

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

Code:

#### 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:

#             |                                      |

#             | next v2.0 by mortician               |

#             |                                      |

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

#             | email: mortician@linux.be            |

#             | www:   www.mortician.tk              |

#             |______________________________________|


Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests 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