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 someone to code this important script for me.
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Thu Jul 31, 2008 4:58 pm    Post subject: Reply with quote

samhain wrote:
what If I want to do it after every minute? I have to change utimer '10' to '60' ?

Then use the time binding originally given. Or use a timer similar to how I've used the utimer. The best both can do is every minute. If you mean 45 seconds up to 90 seconds. Put the timermin at 45, and timermax at 90 and somewhere in that range the script will randomly pick each time to pull it's name list. Keep in mind the other script has no range, doesn't randomize it''s polling so eventually services may get disturbed a bot is doing this. Randomly polling gives the impression of human behavior.

To keep the randomness and use minutes:
Code:
set modeD(channel) "#yourchan"
set modeD(timermin) "10"'
set modeD(timermax) "15"

This is the only part you really need to tailor..Change all the timermin/timermax values to reflect minutes (they currently are set to values in seconds, remember) and change the word utimer into timer in 2 places.
_________________
speechles' eggdrop tcl archive


Last edited by speechles on Thu Jul 31, 2008 5:06 pm; edited 1 time in total
Back to top
View user's profile Send private message
samhain
Halfop


Joined: 03 Jan 2007
Posts: 77

PostPosted: Thu Jul 31, 2008 5:06 pm    Post subject: Reply with quote

Can you please modify it and give me the full code once again. I can modify those two things. but my english is not good and can't fully understand what you just said.
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Thu Jul 31, 2008 5:10 pm    Post subject: Reply with quote

Code:
set modeD(channel) "#yourchan"
# time in minutes to poll
set modeD(timermin) "1" ;#minimum time wait until poll
set modeD(timermax) "3" ;#maximum time wait until poll

bind RAW - 355 modeD:receives:names
bind RAW - 352 modeD:receives:who

proc modeD:send:names { } {
        global modeD
        if {[validchan $modeD(channel)]} {
                if {[regexp {D|d} [lindex [getchanmode $modeD(channel)] 0]]} {
                        putquick "NAMES -d $modeD(channel)"
                }
        }
        timer [expr $modeD(timermin)+[rand [expr $modeD(timermax)-$modeD(timermin)]]] [list modeD:send:names]
}

proc modeD:receives:names { from raw text } {
        global modeD
        set chan [lindex [split $text] 2]
        set nicklist [lindex [split $text :] 1]
        if {[string tolower $chan] == [string tolower $modeD(channel)] && $nicklist != "" } {
                foreach user [split $nicklist] {
                        puthelp "WHO $user"
                }
        }
}

proc modeD:receives:who { from raw text } {
        global modeD
        set identd [lindex [split $text] 2]
        set host [lindex [split $text] 3]
        set nick [lindex [split $text] 5]
        set chan $modeD(channel)
        if {![matchban $nick!$identd@$host] && ![matchban $nick!$identd@$host $chan]} {
                if {[onchan X $chan]} {
                        utimer [rand 8] [list puthelp "PRIVMSG X :voice $chan $nick"]
                }
        }
        # hidden user appear in ".channel #chan" command and
        # stays there even when they parts or disconnect.
        resetchan $chan
}

timer [expr $modeD(timermin)+[rand [expr $modeD(timermax)-$modeD(timermin)]]] [list modeD:send:names]

Every 1-3 minutes the script will poll the names list and act upon it. If instead you wanted seconds, use the script I posted which used utimer. It's events were based upon seconds.
_________________
speechles' eggdrop tcl archive


Last edited by speechles on Thu Aug 07, 2008 2:36 am; edited 4 times in total
Back to top
View user's profile Send private message
samhain
Halfop


Joined: 03 Jan 2007
Posts: 77

PostPosted: Thu Jul 31, 2008 5:50 pm    Post subject: Reply with quote

Thanks so much I'll run it tomorrow when my freakin bot is up Smile I really appreciate it. speechless and dark Smile
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 Previous  1, 2
Page 2 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