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 

Ignore nick when ..

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
gembels
Voice


Joined: 07 Jul 2012
Posts: 26

PostPosted: Wed Jul 31, 2013 8:07 pm    Post subject: Ignore nick when .. Reply with quote

Hi,

I am using this snippet

Code:
proc throttled {id time} {
   global throttled
   if {[info exists throttled($id)]} {
      return 1
   } {
      set throttled($id) [clock sec]
      utimer $time [list unset throttled($id)]
      return 0
   }
}


Example

Code:
if {[throttled $nick 30]} {
      tggamemsgd3 $nick "$nick, please try again in 30 seconds"
   } else {
      tggamemsgd2 $chan "$text: test success"
}


I forgot where the source come from, anyway, there is any way to optimize this code, because this what happen:

[09:55] <Grievers> 111
[09:55] <Grievers> 222
[09:55] <%bots> 222: test success

the first text, always be ignored by bot, only the second one bot will be start counting. I have no idea why that happen. After "222" it start counting 30s , but why not on "111" ? why the bot didn't reply on 111 ?

If new nick type something, the first text also have problem.

or there is anyway to stop ppl doing flood !rank on game ? without kick or banned them.

Thanks in advance
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Wed Jul 31, 2013 8:28 pm    Post subject: Re: Ignore nick when .. Reply with quote

It probably came from user.
http://forum.egghelp.org/viewtopic.php?p=75097#75097
http://forum.egghelp.org/viewtopic.php?p=45537#45537

Example use:
http://forum.egghelp.org/viewtopic.php?p=95961#95961
Back to top
View user's profile Send private message
gembels
Voice


Joined: 07 Jul 2012
Posts: 26

PostPosted: Thu Aug 01, 2013 12:07 am    Post subject: Re: Ignore nick when .. Reply with quote

you are right, its from there .. there is no solution ? they don't have this problem
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Thu Aug 01, 2013 2:43 am    Post subject: Reply with quote

The snippet is indeed from one of user's posts, and from what I can see it's correct. The only thing that pop-out is the fact that to send that message you use two different messaging processes (tggamemsgd2 and tggamemsgd3) and have two different destinations: first is sent to nick and the second is sent to the channel.

Why don't you replace them with a simple puthelp like:
Code:

if {[throttled $nick 30]} {
      puthelp "PRIVMSG $chan :$nick, please try again in 30 seconds"
   } else {
      puthelp "PRIVMSG $chan :$text: test success"
}

and see what happens.
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
gembels
Voice


Joined: 07 Jul 2012
Posts: 26

PostPosted: Thu Aug 01, 2013 5:35 am    Post subject: Reply with quote

even without any puthelp or anything, same problem occur..

Code:

proc tggamemsgd2 {tgchan what} {
        putserv "PRIVMSG $tgchan :$what"
}
proc tggamemsgd3 {nick what} {
        putserv "PRIVMSG $nick :$what"
}


actually in the real code I didn't put any puthelp or putserv Smile just for triggering something .. anyway I try you code, same problem occur...
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 -> Scripting Help 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