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.

help with a script

Old posts that have not been replied to for several years.
Locked
User avatar
mavericku
Halfop
Posts: 62
Joined: Sun Jun 12, 2005 11:32 pm
Location: somewhere in the world
Contact:

help with a script

Post by mavericku »

Hello everybody , i have a script made by ­awyeah and i wonder if anybody can help me add somthing more to it :

This is the script :

#Set the channel on which you want the bot to cycle on
set spamchan "#channel"

#How many minutes should the bot idle in channel before it parts for the cycle (in mins)
set spamdet_idletime "9"

#How many seconds should the bot stay gone in the cycle before rejoining the channel (in secs)
set spamdet_gonetime "10"


bind evnt - connect-server resetinactive
bind evnt - prerehash resetinactive
bind evnt - prerestart resetinactive

if {![string match *spamdetect* [timers]]} {timer $spamdet_idletime spamdetect}


proc resetinactive {type} {
global spamchan
channel set $spamchan -inactive
putlog "INACTIVE: Set channel settings for $spamchan back to -inactive."
return 1
}

proc spamdetect {} {
global botnick spamchan spamdet_idletime spamdet_gonetime
channel set $spamchan +inactive
putlog "CYCLE: Cycling $spamchan to detect spammers."
putlog "CYCLE: Will rejoin $spamchan after $spamdet_gonetime secs."
utimer $spamdet_gonetime "channel set $spamchan -inactive"
if {![string match *spamdetect* [timers]]} {timer $spamdet_idletime spamdetect}
}

-----------------------------


I want to add this if possible :

<bot> !download
<bot> !reload
<bot> !moloz

and after he gives that commands to the channel , he cycles. and if he get's any answer from anywone by notice , msg , ctcp, to report it in another channel

and if u can to be abble to add more words like !download ..

Thank you :roll:
mavericku
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

maybe you shoud've tried to contact awyeah first?

(next time use

Code: Select all

 tags when posting code)
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

You can add these no doubt, through a public trigger, you would have to add some extra pieces of code:

Code: Select all

#Set the flag here for users who can use public commands to cycle the bot
set spamcycleflag "mn|o"

#Set the triggers here for the bot to cycle on:
set spamcycletriggers {
"!download"
"!reload"
"!moloz"
}

###SETTINGS END HERE###

bind pubm $spamcycleflag "*" pub:spamcycle

proc pub:spamcycle {nick uhost hand chan text} {
 global spamcycletriggers
  foreach trigger $spamcycletriggers {
   if {[string equal -nocase $trigger [lindex [split $text] 0]]} {
    break; spamdetect
    }
  }
}
I think, this code should no doubtedly do what you want. Anyway this command will make the bot cycle all channels as defined by the 'spamdetect' proc. If you just want to cycle that particular channel, just put putquick "PART $chan" instead of spamdetect

We wouldn't need to add a putserv for rejoin, since when channels are added into the bot, the bot will join back itself when you part it manually.

If you don't know how todo that also, then:

Code: Select all

proc pub:spamcycle {nick uhost hand chan text} {
 global spamcycletriggers
  foreach trigger $spamcycletriggers {
   if {[string equal -nocase $trigger [lindex [split $text] 0]]} {
    break; putquick "PART $chan"
    }
  }
}
Or another way is to set the channel +inactive and -inactive using this technique for a delayed cycle:

Code: Select all

channel set $chan +inactive
utimer 10 "channel set $chan -inactive"
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
mavericku
Halfop
Posts: 62
Joined: Sun Jun 12, 2005 11:32 pm
Location: somewhere in the world
Contact:

Post by mavericku »

i`m back and happy i`ve done it for my self :D hurayy
now i want something else if possible.

this is the script by awyeah and changed by me .. no copyright stolen .. it's your script man ..

Code: Select all

#Set the channel on which you want the bot to cycle on 
set spamchan "#channel" 

#How many minutes should the bot idle in channel before it parts for the cycle (in mins) 
set spamdet_idletime "3" 

#How many seconds should the bot stay gone in the cycle before rejoining the channel (in secs) 
set spamdet_gonetime "10" 

#the commands that bot says before exiting the channel
set spamsay_1 "!download"
set spamsay_2 "!reload"
set spamsay_3 "!moloz"
set spamsay_4 "login"
set spamsay_5 "!up"



bind evnt - connect-server resetinactive 
bind evnt - prerehash resetinactive 
bind evnt - prerestart resetinactive 

if {![string match *spamdetect* [timers]]} {timer $spamdet_idletime spamdetect} 

proc resetinactive {type} { 
global spamchan 
channel set $spamchan -inactive 
putlog "INACTIVE: Set channel settings for $spamchan back to -inactive." 
return 1 
} 

proc spamdetect {} { 
global botnick spamchan spamdet_idletime spamdet_gonetime spamsay_1 spamsay_2 spamsay_3 spamsay_4 spamsay_5
putserv "PRIVMSG $spamchan : $spamsay_1 "
putserv "PRIVMSG $spamchan : $spamsay_2 "
putserv "PRIVMSG $spamchan : $spamsay_3 "
putserv "PRIVMSG $spamchan : $spamsay_4 "
putserv "PRIVMSG $spamchan : $spamsay_5 "
channel set $spamchan +inactive 
putlog "CYCLE: Cycling $spamchan to detect spammers." 
putlog "CYCLE: Will rejoin $spamchan after $spamdet_gonetime secs." 
utimer $spamdet_gonetime "channel set $spamchan -inactive" 
if {![string match *spamdetect* [timers]]} {timer $spamdet_idletime spamdetect} 
} 

putlog "made by awyeah and changed By Mavericku"
i want if possible to add this :

if somebody responds with notice on the bot to ... send the message to another channel ! i got this only for privmsg.
mavericku
User avatar
mavericku
Halfop
Posts: 62
Joined: Sun Jun 12, 2005 11:32 pm
Location: somewhere in the world
Contact:

Post by mavericku »

nvm i finished this too :P

love you guys :oops:
mavericku
User avatar
mavericku
Halfop
Posts: 62
Joined: Sun Jun 12, 2005 11:32 pm
Location: somewhere in the world
Contact:

Post by mavericku »

damn :( it worked for a while but it stoped ... so please if u can help me i appreciate
mavericku
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

What worked? Help with what now?
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
mavericku
Halfop
Posts: 62
Joined: Sun Jun 12, 2005 11:32 pm
Location: somewhere in the world
Contact:

Post by mavericku »

hey ...

i just want to add to that tcl another part like :

<bot> !download

-nick- ( notice ) blah blah

<bot > #foo - nick messaged me that - blah blah

can u understand ?

if the bot get's messaged/notice in the next 60 secconds since the command !download was given to message the channel #foo : this $nick messaged me $arg

:?:
mavericku
Locked