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 

[SOLVED] Chan. Notice:not to send notice to a kick/ban usr

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
panasonic
Voice


Joined: 15 Sep 2007
Posts: 25

PostPosted: Fri Nov 02, 2007 3:15 pm    Post subject: [SOLVED] Chan. Notice:not to send notice to a kick/ban usr Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Fri Nov 02, 2007 6:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
panasonic
Voice


Joined: 15 Sep 2007
Posts: 25

PostPosted: Sat Nov 03, 2007 1:39 am    Post subject: Reply with quote

sorry sir, i got this from web generator
anyone mind to help me to modify it coz im just a user Confused
Back to top
View user's profile Send private message
panasonic
Voice


Joined: 15 Sep 2007
Posts: 25

PostPosted: Mon Nov 12, 2007 2:40 pm    Post subject: Reply with quote

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


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Mon Nov 12, 2007 3:36 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
panasonic
Voice


Joined: 15 Sep 2007
Posts: 25

PostPosted: Mon Nov 12, 2007 4:54 pm    Post subject: Reply with quote

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 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
Page 1 of 1

 
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