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.

Disregard - removing the script. Can't delete this post!

Help for those learning Tcl or writing their own scripts.
Post Reply
f
fusionx
Voice
Posts: 30
Joined: Sun Jan 16, 2022 1:35 pm

Disregard - removing the script. Can't delete this post!

Post by fusionx »

timer $bantime putserv "MODE $channel -b $nick!*@$nickhost"
That line is throwing the following error:
wrong # args: should be "putserv text ?options?"
A nearly identical line above it that sets the ban works fine:
putserv "MODE $channel +b $nick!*@$nickhost"
Any ideas? I'm using an old anti-idle script. It works perfectly except for this.
Last edited by fusionx on Fri Sep 22, 2023 12:43 pm, edited 1 time in total.
f
fusionx
Voice
Posts: 30
Joined: Sun Jan 16, 2022 1:35 pm

here's the entire script

Post by fusionx »

In case there's something above causing a spurious issue, here's the entire script. ( Pulled from https://github.com/fredsted/eggdrop-scr ... tiidle.tcl ).

Code: Select all

# How to use:
# 1) Enable on channels you wish to use it on:
#		.chanset #example +idlekick
#
# 2) Configure how long users are allowed to idle (in minutes)
#		.chanset #example idlekick-time 15
#
# 3) You may configure the messages below.

# Warning message
set warningmsg "Warning! You will be kicked in 1 minute due to our anti-idle policy."

# Kick message
set kickmsg "Kicked due to inactivity - this channel has an anti-idle policy."

# How many minutes ban user for.
set bantime 2   

# ------------------------------------------------------------------------------------

setudef flag idlekick
setudef str idlekick-time

proc idlekick:tick {minute hour day month year} {
	foreach channel [channels] {
		if {[channel get $channel idlekick] == "1" && [botisop $channel]} {
			foreach iu [chanlist $channel] {
				if {![isbotnick $iu] && [onchan $iu $channel] && ![isop $iu $channel] 
					&& ![ishalfop $iu $channel] && ![isvoice $iu $channel]} {						
					if {[getchanidle $iu $channel] == [expr [channel get $channel idlekick-time] -1]} {
						idlekick:warn $channel $iu
					} 
				
					if {[getchanidle $iu $channel] >= [channel get $channel idlekick-time]} {
						idlekick:kick $channel $iu
					}
				}
			}
		}
	}
}

proc idlekick:warn {channel nick} {
	global warningmsg
	
	putlog "ANTIIDLE: Warning $nick on $channel due to idling"
	
	puthelp "PRIVMSG $channel :$nick: $warningmsg"
}

proc idlekick:kick {channel nick} {
	global kickmsg bantime
	
	putlog "ANTIIDLE: Banning $nick on $channel due to idling"
	
	set nickhost [lindex [split [getchanhost $nick] "@"] 1]
	putserv "MODE $channel +b $nick!*@$nickhost"
	putserv "KICK $channel $nick :$kickmsg"
	
	timer $bantime putserv "MODE $channel -b $nick!*@$nickhost"
}

bind time - "* * * * *" idlekick:tick
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Try with:

Code: Select all

timer $bantime [list putserv "MODE $channel -b $nick!*@$nickhost"]
Once the game is over, the king and the pawn go back in the same box.
f
fusionx
Voice
Posts: 30
Joined: Sun Jan 16, 2022 1:35 pm

Post by fusionx »

Thank you for the assist, but it's throwing the same error.

I'm going to delete this - I'm finding other errors now. It's not parsing idle times correctly. I'll find something else :)
Post Reply