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.

Stacking autovoice with delay.

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: 1124
Joined: Sun Mar 22, 2015 2:41 pm

Stacking autovoice with delay.

Post by simo »

greetingz,

anyway we can have this stack nicks that need to be autovoice lets say for nicks that join within 5 seconds because current it seems to always voice each nick seperate with +v nick instead of +vvv nick nick nick wich is what we are aiming for.


this is what happens now

19:26:18 Joins: NewMan_InTown-_ uid380041@bb32-3bab-7525-9f6-5f68.helmsley.irccloud.com
19:26:20 Joins: Decorated ~uid701662@5f19-30a3-abb6-5967-9196.uxbridge.irccloud.com
19:26:21 @EggBot Sets Mode on #channel to: +v NewMan_InTown-_
19:26:22 @EggBot Sets Mode on #channel to: +v Decorated

Code: Select all


bind join - * Join:Autovoice

proc Join:Autovoice {nick uhost hand chan} {
	if {[matchattr $hand -|v $chan]} { after [expr {2*1000*1}] [list Join:Auto-voicer $chan $nick] }
}

proc Join:Auto-voicer {chan nick} {
	if {[botisop $chan] && ![isop $nick $chan] && ![ishalfop $nick $chan] && ![isvoice $nick $chan] && ![isbotnick $nick]} {
		pushmode $chan +v $nick
	}
}



thanks in advance.
User avatar
CrazyCat
Revered One
Posts: 1354
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Re: Stacking autovoice with delay.

Post by CrazyCat »

Your script can't stack, it is not intented to do that.

Each time someone joins and has the +v flag, you delay the moment when the +v is sent. Nothing else.

You'd better try to fill a list of users to voice and have a timed proc runned by an independant timer which will voice pple in this list.
User avatar
Arnold_X-P
Master
Posts: 245
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

Re: Stacking autovoice with delay.

Post by Arnold_X-P »

maybe this tcl is what you really need

Code: Select all

#################################auto-voice#############################
# before loading this script make a user
# called "novoice" that contains the hostmasks
# that you don't wish to have +v in the channel
#
bind join - * oj_voice
proc oj_voice {nick uhost hand chan} {
if {$hand != "novoice"} { utimer 5 [list pushmode $chan +v $nick] }
return 0
}
putlog "loaded =AutoVoice= created by _andy updated by RoCkY, stdragon" 
Or it would be better for you to try this tcl which is more complete..
Your main configuration is in this path set sv(delay) 60:99

Code: Select all

# slowvoice.tcl v1.1 by Solbu.
# Repository: https://github.com/solbu/eggdrop-scripts
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License,
# or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
#
# After the recent join spam tactic on FreeNode and EFnet in the fall of 2018,
# I needed something that voiced all users joining a moderated channel,
# but it needed to randomly delay the voicing to between 60 and 99 seconds after they join.
# And this is the result after looking on the internet for ideas.
#
# The Spambots this script is made to protect against deliver their spam withing 60 seconds after join.
# Since I deployed this script on the moderated channels I maintain, the spam is gone.
# The spambots stil join, but they can't deliver their cargo since the channels are moderated
# and they don't have voice within the timeframe they deliver their cargo.
#
# The script has been tested on eggdrop v1.8.3. So it should work fine on this version of eggdrop and
# higher. If you find any bug on this script, you can open a bug repport on Github https://github.com/solbu/eggdrop-scripts

## Features:
# This script will voice any user who joins a channel specified after a preset minimum and maximum time.
# Default is to randomly delay voice to between 60 and 99 seconds.

### Options:
## Delay in seconds before we voice someone:
# x:y random delay; minimum x sec, maximum y sec
set sv(delay) 60:99

## Which channel do you want this script to voice people on?
## If you have more than one channel please leave 
## a space between the channels.(e.g "#channel1 #channel2")
set avchan "#channel1 #channel2"

### Begin Script:
bind join - * join:sv
proc join:sv {nick host hand chan} { global sv
   utimer [expr [lindex [split $sv(delay) :] 0] + [rand [lindex [split $sv(delay) :] 1]]] [list sv:voice $nick $host $hand $chan]
}
bind nick - * nick:sv
proc nick:sv {nick host hand chan newnick} { global sv
   utimer [expr [lindex [split $sv(delay) :] 0] + [rand [lindex [split $sv(delay) :] 1]]] [list sv:voice $newnick $host $hand $chan]
}
proc sv:voice {nick host hand chan} {
   global avchan botnick
 if {$nick == $botnick} {return 0}
 if { [isvoice $nick $chan] == 1 } { return 0 }
 if {$avchan == "" && [botisop $chan]} {
  pushmode $chan +v $nick
  return 0
 }
 set chan [string tolower $chan]
 foreach i [string tolower $avchan] {
  if {$i == $chan && [botisop $chan]} {
   pushmode $chan +v $nick
   return 0
  }
 }
}

foreach c "[channels]" { channel set "$c" -autovoice }
catch { unset $c }

putlog "slowvoice.tcl v1.1 (GPLv3+) by Solbu - Loaded"
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
networks: DALnet #tcls ChatZona #tcl Libera.Chat #tcls
s
simo
Revered One
Posts: 1124
Joined: Sun Mar 22, 2015 2:41 pm

Re: Stacking autovoice with delay.

Post by simo »

Thanks for your reply Arnold but that will voice each joining nick with delay only as well and won't stack the voice modes as each joining nick has a separate timer
Post Reply