| View previous topic :: View next topic |
| Author |
Message |
panasonic Voice
Joined: 15 Sep 2007 Posts: 25
|
Posted: Fri Nov 02, 2007 3:15 pm Post subject: [SOLVED] Chan. Notice:not to send notice to a kick/ban usr |
|
|
| Code: |
set welc(msg1) "Message in 1st line"
set welc(msg2) "Message in 2nd line"
set welc(chan) "#MyChannel"
set welc(type) "1"
bind join - #MyChannel* givewelcome
proc givewelcome {nick uhost hand chan} {
global welc
set welctxt1 $welc(msg1)
set welctxt2 $welc(msg2)
regsub -all "%nick" $welctxt1 "$nick" welctxt1
regsub -all "%nick" $welctxt2 "$nick" welctxt2
regsub -all "%chan" $welctxt1 "$chan" welctxt1
regsub -all "%chan" $welctxt2 "$chan" welctxt2
switch $welc(type) {
1 {
puthelp "NOTICE $nick :$welctxt1"
puthelp "NOTICE $nick :$welctxt2"
}
2 {
puthelp "PRIVMSG $nick :$welctxt1"
puthelp "PRIVMSG $nick :$welctxt2"
}
}
}
putlog "Channel Greeting - Generated by http://www.egginfo.org - Frostbyte"
|
Hi!
I do have a simple channel notice generated as above.
but the problem is, if there is a mass clones (which will then been kicked and banned from channel), the bot still sending notice to them eventhough they have been kicked out from channel
How to modify the script so the bot won't send notices to those who have been kicked out of channel
I found that my bot will Excess Flood by sending notices non-stop to them...
thanks in advanced
Last edited by panasonic on Mon Nov 12, 2007 4:51 pm; edited 2 times in total |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Fri Nov 02, 2007 6:36 pm Post subject: |
|
|
One iea might be to use timers (utimer) to delay the message a few seconds, and do a simple check wether the target is still inside the channel (onchan).
See doc/tcl-commands.doc for syntaxes. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
panasonic Voice
Joined: 15 Sep 2007 Posts: 25
|
Posted: Sat Nov 03, 2007 1:39 am Post subject: |
|
|
sorry sir, i got this from web generator
anyone mind to help me to modify it coz im just a user  |
|
| Back to top |
|
 |
panasonic Voice
Joined: 15 Sep 2007 Posts: 25
|
Posted: Mon Nov 12, 2007 2:40 pm Post subject: |
|
|
ok, there is slight modification to utimer and the timers is now working
but i still have problem with onchan (to make sure that the bot didnt send the notice/messages to any kick/banned user)
here is the codes:
| Code: |
set welc(msg1) "1st line message"
set welc(msg2) "2nd line message"
set welc(chan) "#MyChannel"
set welc(type) "1"
bind join - #MyChannel* givewelcome
proc givewelcome {nick uhost hand chan} {
global welc
set welctxt1 $welc(msg1)
set welctxt2 $welc(msg2)
regsub -all "%nick" $welctxt1 "$nick" welctxt1
regsub -all "%nick" $welctxt2 "$nick" welctxt2
regsub -all "%chan" $welctxt1 "$chan" welctxt1
regsub -all "%chan" $welctxt2 "$chan" welctxt2
switch $welc(type) {
if { [onchan $nick $chan] }
1 {
utimer 10 [puthelp "NOTICE $nick :$welctxt1"]
utimer 10 [puthelp "NOTICE $nick :$welctxt2"]
}
2 {
utimer 10 [puthelp "PRIVMSG $nick :$welctxt1"]
utimer 10 [puthelp "PRIVMSG $nick :$welctxt2"]
}
}
}
putlog "Channel Greeting - Generated by http://www.egginfo.org - Frostbyte"
|
the bot is still sending messages to a kick/banned user
please help me to check the codes
thanks in advanced! |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Mon Nov 12, 2007 3:36 pm Post subject: |
|
|
The problem is that you dont check if the user is STILL on the channel AFTER the 10 seconds.
| Code: | set welc(msg1) "1st line message"
set welc(msg2) "2nd line message"
set welc(chan) "#MyChannel"
set welc(type) "1"
bind join - #MyChannel* welcome:join
proc welcome:join {nick uhost hand chan} {
global welc
set welctxt1 $welc(msg1)
set welctxt2 $welc(msg2)
regsub -all "%nick" $welctxt1 "$nick" welctxt1
regsub -all "%nick" $welctxt2 "$nick" welctxt2
regsub -all "%chan" $welctxt1 "$chan" welctxt1
regsub -all "%chan" $welctxt2 "$chan" welctxt2
utimer 10 [list welcome:sendmsg $nick $chan $welc(type) $welctxt1]
utimer 10 [list welcome:sendmsg $nick $chan $welc(type) $welctxt2]
}
proc welcome:sendmsg {nick chan type text} {
if {![onchan $nick $chan]} { return }
if {$type == "1"} {
puthelp "NOTICE $nick :$text"
} elseif {$type == "2"} {
puthelp "PRIVMSG $nick :$text"
}
}
putlog "Channel Greeting - Generated by http://www.egginfo.org - Frostbyte" |
Not tested - should work... _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
panasonic Voice
Joined: 15 Sep 2007 Posts: 25
|
Posted: Mon Nov 12, 2007 4:54 pm Post subject: |
|
|
thanks a lot, Tosser^^
the bot is now able to perform delay time before sending msg to user and no longer sending msg to a kicked/banned user
since the code has changed, i have to learn it and try to understand it again
thank you so much  |
|
| Back to top |
|
 |
|