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.

Join/part

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
User avatar
Thanhas
Op
Posts: 124
Joined: Sat Sep 02, 2006 11:14 am
Location: Ottawa, Canada

Join/part

Post by Thanhas »

Hello,

Dont know if its possible.

i need my Eggdrop Part channel every10 minutes and chnage his nick and then join chnnel back after staying 10 mniutes Part the channel come with a new nick so on every 10 mint Part #channel Chnage $nick join #channel back


if Possible Please code it forme i highly Apprecaite.

Thank you


10 View and no replay
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

Code: Select all

# nick.tcl
# parts a preconfigured channel at a specified frequency for a specified length of time
# chooses a new nick from a preconfigured list on each occasion it parts

# this script MUST be activated with a restart (not a rehash)
# the bot will come online with its normal primary nick as set in the .conf file
# the first nick change occurs after the first scheduled part

# set here the single channel name the bot parts
set vNickChannel #eggtcl

# set here the list of nicks the bot will use
# nicks should be unregistered and not already in use
set vNickList {
    testbot12345
    testbot23456
    testbot34567
    testbot45678
    testbot56789
}

# set here how the bot selects the next nick from the list
# sequentially (1) or randomly (2)
set vNickMode 2

# set here the frequency in minutes for parting the channel
set vNickFrequency 3

# set here the length of time in seconds the bot parts for
# suggested minimum is 10 seconds, allowing bot to change nick before rejoining
set vNickAbsent 30

bind EVNT - init-server pNickStart

proc pNickStart {type} {
    global vNickFrequency
    if {[string is integer -strict $vNickFrequency]} {
        if {$vNickFrequency > 0} {
            pNickSchedule
        }
    }
    return 0
}

proc pNickSchedule {} {
    global vNickFrequency
    foreach schedule [binds TIME] {
        if {[string equal pNickPart [join [lindex $schedule 4]]]} {
            set minute [join [lindex [lindex $schedule 2] 0]]
            set hour [join [lindex [lindex $schedule 2] 1]]
            unbind TIME - "$minute $hour * * *" pNickPart
        }
    }
    set minute [strftime %M [expr {[unixtime] + ($vNickFrequency * 60)}]]
    set hour [strftime %H [expr {[unixtime] + ($vNickFrequency * 60)}]]
    bind TIME - "$minute $hour * * *" pNickPart
    return 0
}

proc pNickPart {minute hour day month year} {
    global vNickAbsent vNickChannel
    if {[regexp -- {^#} $vNickChannel]} {
        if {![channel get $vNickChannel inactive]} {
            if {[validchan $vNickChannel]} {
                if {[botonchan $vNickChannel]} {
                    channel set $vNickChannel +inactive
                    utimer $vNickAbsent pNickJoin
                    utimer 3 pNickChange
                }
            }
        }
    }
    pNickSchedule
    return 0
}

proc pNickChange {} {
    global nick vNickChannel vNickList vNickMode
    switch -- [llength $vNickList] {
        0 {}
        1 {
            if {![string equal -nocase $nick [join $vNickList]]} {set nick [join $vNickList]}
        }
        default {
            set oldidx [lsearch -exact $vNickList $nick]
            switch -- $oldidx {
                -1 {
                    switch -- $vNickMode {
                        1 {set newidx 0}
                        2 {set newidx [rand [llength $vNickList]]}
                        default {}
                    }
                }
                default {
                    switch -- $vNickMode {
                        1 {
                            set newidx [incr oldidx]
                            if {$newidx == [llength $vNickList]} {set newidx 0}
                        }
                        2 {
                            set newlist [lreplace $vNickList $oldidx $oldidx]
                            set newnick [lindex $newlist [rand [llength $newlist]]]
                            set newidx [lsearch -exact $vNickList $newnick]
                        }
                        default {}
                    }
                }
            }
            if {[info exists newidx]} {
                set nick [lindex $vNickList $newidx]
            }
        }
    }
    return 0
}

proc pNickJoin {} {
    global vNickChannel
    channel set $vNickChannel -inactive
    return 0
}

# eof
I must have had nothing to do
User avatar
Thanhas
Op
Posts: 124
Joined: Sat Sep 02, 2006 11:14 am
Location: Ottawa, Canada

Thank yu

Post by Thanhas »

Thank you so much i apprecaite this
it really works just a few bugs need to be fixed i hope you can do it here are the logs

Partyline
[00:06] <(ChitChat> [07:07] * IRC NICK CHANGE: ChitChat -> Cam-Girl1
[00:07] <(ChitChat> [07:07] ChitChat joined #chataway.
[00:07] <(ChitChat> [07:07] Regained nickname 'Cam-Girl1'.
[00:07] <(ChitChat> [07:07] -NickServ (service@dal.net)- The nickname Cam-Girl1 is not registered.
Channel
[00:07] * ChitChat (chitchat@204.188.211.21) has left #chataway
[00:07] * ChitChat (chitchat@204.188.211.21) has joined #chataway
[00:07] * ChitChat is now known as Cam-Girl1
[00:13] <stelppA> .
the bot did part but join and changed nick, in the channel and 2nd after the bot joined did not chnage nick again,... it was happen only one time...

thanks alot.. please fix that if you have time..
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

@arfer, in my opinion it's better practice to issue the nick-change after the bot parts the channel and then rejoin after the bot changes its nick instead of using timers (bind on bot's part and nick-change instead).
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

Sir_Fz, I tried to bind on the bot's part but it didn't work. I'm assuming that a PART bind doesn't trigger for the botnick (even though a JOIN bind does trigger for the botnick). I'm interested in a second opinion here. Is this correct?

Thanhas, there would be no reason to get that message from nickserv unless the bot was attempting to identify (or doing a \ns INFO <botnick>) when it changed nick. Check what other scripts you have loaded. I have tested this script quite extensively and found it to work continuously as expected for sequential nick changes and random nick changes with no such nickserv message.
I must have had nothing to do
User avatar
Thanhas
Op
Posts: 124
Joined: Sat Sep 02, 2006 11:14 am
Location: Ottawa, Canada

Post by Thanhas »

hello Thanks for Replay
yah i am not Pointing something about what nickserv says

its not Working as i said...
It do join part but only one time when i restart and he complete the set time i did in is 3 minute. and yah it dose not do join/part after that.. just one time it happens i checked on simple Eggdrop1.6.19 and there is no more TCL added in...

thanks
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

OK, problem solved I think.

The bot was trying to change to a nick that was banned on one of its other channels. This would have the same effect as trying to change to a nick that was already in use. ie. not possible.

The -nickserv- message has nothing to do with this script.

I would appreciate some feedback on the PART bind issue. It seems like it does not respond to the botnick parting which is somewhat inconvenient since I think Sir_fz's suggestion otherwise has merit. I'm not a big fan of timers/utimers.
I must have had nothing to do
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

bind part responds to the bot parting, or so it does for myself, either way you could always bind to raw part to overcome the issue
r0t3n @ #r0t3n @ Quakenet
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

Yes thanks I could use a raw. This is getting ridiculous though, I can't seem to get a trigger from a PART bind for the botnick.
I must have had nothing to do
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

I just tested it on my bot and seems to be working correctly, it does trigger on the bot's part. Recheck your code, maybe you added some flags in the bind or some if-checks in the procedure that caused the odd behavior? I tested it on Eggdrop1.6.19 (in case we're using different versions). Otherwise you'll have to use the RAW bind.
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

In the partyline of my bot osmosis

[17:47] <arfer> .tcl bind PART - * pUserPart
[17:48] <arfer> .tcl proc pUserPart {nick uhost hand chan msg} {putlog "$nick parted $chan"}
[17:50] <arfer> .tcl channel set #eggtcl +inactive

In the channel
[17:50] * @osmosis has left #EggTCL

No further partyline message to indicate that the PART bind triggered, but if I part #eggtcl

[17:53] <osmosis> [17:53] arfer parted #EggTCL

Only thing I can think of is that the channel being set +inactive in order to make the bot part, is preventing the bind triggering
I must have had nothing to do
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Yes, you are right, when it parts after setting the channel to +inactive the bind is not triggered (weird). But the RAW bind seems to do the job perfectly.
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

Good day sir arfer I'm encountering a problem similar to this stuff:
# AntiSpamBot basic settings
# You can edit all these settings as you wish
# example: set antispam(nick) AntiSpamBot
set antispam(nick) $altnick
set antispam(altnick) ${altnick}1
# ADD HERE
set antispam(nicks) {
nick1
nick2
nick3
}
...
putlog "\002AP\002: AntiSpamBot: Cycling $c..."
putdcc $antispam(idx) "part $c"
# ADD:
putdcc $antispam(idx) "nick [lindex $antispam(nicks) [rand [llength $antispam(nicks)]]"
# REPLACE: putdcc $antispam(idx) "join $c" WITH:
timer 5 [list putdcc $antispam(idx) "join $c"]
The bot part/change nick only once and just idle. I don't know what is the problem I hope u can help me thanks a lot in advance.
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

I wonder no reply on my request? Or just ignoring it.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Sydneybabe,
You are posting in a thread that has not had any activity for the last two years, and your posted piece of code is not related to any of the posted solutions to the OP request. There is also little to none information on the actual script you are using. Don't hi-jack random threads.

If you'd like to ask support for a script, use the "Script Support & Release" forum; if there is a specific thread for your script, post there - otherwize start a new thread with a proper topic.
NML_375
Post Reply