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.

cycle auto greet checker

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
s
simo
Revered One
Posts: 1078
Joined: Sun Mar 22, 2015 2:41 pm

cycle auto greet checker

Post by simo »

i was wondering if eggdrop could cycle (part join like every 10 min)
and check for pms within like 5 sec of joining and if so to to set ban and kick

so far all i got is this i got from the archives:

Code: Select all

bind msgm - "*" msg:bot

proc msg:bot {nick uhost hand text} {
 if {![matchattr $hand n]} {
  foreach chan [channels] {
  if {[botisop $chan] && [onchan $nick $chan]} {
   pushmode $chan +b *!*@[lindex [split $uhost @] 1]
   putserv "KICK $chan $nick :Do not message me in private!"
   }
  }
  flushmode $chan
 }
}
Last edited by simo on Sat Jun 13, 2020 7:25 am, edited 1 time in total.
s
simo
Revered One
Posts: 1078
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

ive seen some in archieves but they seem to target specific url spam and channel add spam we were looking to target any auto greeter on join of eggbot within specific time frame (5 secs)
w
willyw
Revered One
Posts: 1197
Joined: Thu Jan 15, 2009 12:55 am

Re: cycle auto greet checker

Post by willyw »

simo wrote:i was wondering if eggdrop could cycle (part join like every 10 min)
and check for pms within like 5 sec of joining and if so to to set ban and kick
...

Try this:

Code: Select all


# June 13, 2020
#
# http://forum.egghelp.org/viewtopic.php?t=20793
#
###


bind cron - "*/10 * * * *" do_cycle


###
proc do_cycle {min hour day month weekday} {

	bind msgm - "*" msg:bot

	putserv "part #channel_name_goes_here"

	utimer 5 [list unbind msgm - "*" msg:bot]

}
###

###
proc msg:bot {nick uhost handle text } {

	##  commands to kick/ban go here

}
###


This is un-tested.

The bind cron should accomplish your desire to do something every 10 minutes.
Reference: https://crontab.guru/#*/10_*_*_*_*

You need to edit in the channel name to part. This thing is currently designed to be single channel. For now, see if you can get it to do what you want/need. Then, if you need it to work on more than one channel, maybe then we can doctor on it some more.

It does not actually check that the bot joined #channel, and then begin the 5 second countdown to unbinding. You can see the "5" in there, for now - and you can tweak that to suit.
However, if you find that you DO need it to watch for the bot itself joining, I suppose we could use a bind join for that, and re-write it.

Let's see what happens with this. :)

I hope this helps.
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
s
simo
Revered One
Posts: 1078
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

tnx for the swift response willyw could we use the join bind to start counting time threshold wich will make it more channel settings configurable i presume
w
willyw
Revered One
Posts: 1197
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

simo wrote:...
could we use the join bind to start counting time threshold
You forgot to tell us how this worked, so far. ;)
wich will make it more channel settings configurable i presume
I don't know what you mean, yet.
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
s
simo
Revered One
Posts: 1078
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

oh sorry forgot to give feedback it seems to work well but the thing is using the bind join might provide a little bit more configurablility for channel since ur current code is for general use
w
willyw
Revered One
Posts: 1197
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

simo wrote:oh sorry forgot to give feedback it seems to work well
So you have run it.
Good.
but the thing is using the bind join might provide a little bit more configurablility for channel since ur current code is for general use
You did it again. :)
"might" ?
" a little bit more configurability"

All very vague.

What will happen if either I or somebody else comes along and re-writes it is: you'll get what we want or think of.

You'd be far better off to explain what is on your mind, in detail. Then there is a better chance of getting what you want. ;)
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
s
simo
Revered One
Posts: 1078
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

ur right i wasnt more specific let me try and attempt write it myselve for the join bind part
tnx so far willyw much apreciated
w
willyw
Revered One
Posts: 1197
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

simo wrote:...
let me try and attempt write it myselve for the join bind part
...
Great ! :)

and feel free to post it here if you wish. For help, if need be. Or, for other ideas on it.

Good luck with it.
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Post Reply