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 

Join/part
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Thanhas
Op


Joined: 02 Sep 2006
Posts: 124
Location: Ottawa, Canada

PostPosted: Wed Aug 19, 2009 11:00 am    Post subject: Join/part Reply with quote

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



Quote:
10 View and no replay
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Wed Aug 19, 2009 6:15 pm    Post subject: Reply with quote

Code:

# 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
Back to top
View user's profile Send private message
Thanhas
Op


Joined: 02 Sep 2006
Posts: 124
Location: Ottawa, Canada

PostPosted: Thu Aug 20, 2009 3:18 am    Post subject: Thank yu Reply with quote

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

[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
Quote:
[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..
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Aug 20, 2009 3:35 am    Post subject: Reply with quote

@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).
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Thu Aug 20, 2009 5:07 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Thanhas
Op


Joined: 02 Sep 2006
Posts: 124
Location: Ottawa, Canada

PostPosted: Thu Aug 20, 2009 5:39 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Thu Aug 20, 2009 7:47 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Thu Aug 20, 2009 10:27 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message MSN Messenger
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Thu Aug 20, 2009 11:06 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Aug 20, 2009 12:10 pm    Post subject: Reply with quote

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.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Thu Aug 20, 2009 12:55 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Aug 20, 2009 1:37 pm    Post subject: Reply with quote

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.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Sydneybabe
Op


Joined: 27 Apr 2007
Posts: 106
Location: Philippines

PostPosted: Thu Jul 07, 2011 2:21 am    Post subject: Reply with quote

Good day sir arfer I'm encountering a problem similar to this stuff:

Quote:
# 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.
Back to top
View user's profile Send private message
Sydneybabe
Op


Joined: 27 Apr 2007
Posts: 106
Location: Philippines

PostPosted: Sat Jul 09, 2011 11:02 pm    Post subject: Reply with quote

I wonder no reply on my request? Or just ignoring it.
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sun Jul 10, 2011 12:01 pm    Post subject: Reply with quote

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, idling at #eggdrop@IrcNET
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
Goto page 1, 2  Next
Page 1 of 2

 
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