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 someone to code this important script for me.

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

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: Select all

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.
Last edited by speechles on Thu Jul 31, 2008 5:06 pm, edited 1 time in total.
s
samhain
Halfop
Posts: 77
Joined: Wed Jan 03, 2007 5:19 am

Post by samhain »

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.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Code: Select all

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.
Last edited by speechles on Thu Aug 07, 2008 2:36 am, edited 4 times in total.
s
samhain
Halfop
Posts: 77
Joined: Wed Jan 03, 2007 5:19 am

Post by samhain »

Thanks so much I'll run it tomorrow when my freakin bot is up :) I really appreciate it. speechless and dark :)
Post Reply