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.

NewChanBan Troubles.

Old posts that have not been replied to for several years.
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

NewChanBan Troubles.

Post by Weirdo »

I am making a script to basically kick ban people for a stated amount of time when they do !afk in channel

Its designed to work on only one channel, and the syntax for it cause of the strings is !afk <bantime> <reason>
bind pub - !afk pub:afkkick_kick

proc pub:afkkick_kick {nick uhost hand chan text} {
global testchan kickmsg
set bantime [lindex $text 0]
set reason [lindex $text 1]
set creator "AFKKick Script"
if {$chan != $testchan} { return 0}
putserv "PRIVMSG $chan :Away Kick Engaging"
puthelp "KICK $chan $nick :$kickmsg"
newchanban $chan $uhost $creator $reason $bantime sticky
}
The problem is, that when a person does !afk 1 test8 in the testchannel it creates 2 bans.
! [ 6] ~testy!*@216.105.160.17 (expires at 17:31) (sticky)
AFKKick Script: test8
Created 17:30
* [ 7] *!~testy@216.105.160.17 (Minako!Minako@public2-ward1-6-cust47.manc.broadband.ntl.com) (active 00:32)
This only happened when the newchanban option was set to sticky, but when it wasnt set to sticky, no ban was in effect on the channel at all. What can i do to fix this problem?

Weirdo
d
darko``
Op
Posts: 121
Joined: Sun Sep 08, 2002 5:33 pm
Location: Malta

Post by darko`` »

Ban doesn't have to show in IRC banlist. It is however remembered in eggdrop's own banlist and *will* become active and set on channel if a user matching the bansmask joins. Also, ban number 7 was not placed by the bot itself, but rather by someone else.
Ignorant and lazy people will save 30 minutes by chosing simple config file. Smart ones will save 3000 minutes of *everyone's* time by opting for complete config file.
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

[17:31:51] * Joins: Testy (~testy@216.105.160.17)
[17:31:57] <Testy> !afk
[17:31:58] <Minako> Away Kick Engaging
[17:31:59] * Minako sets mode: +b *!~testy@216.105.160.17
[17:32:01] * Testy was kicked by Minako (Banned)
[17:32:21] * Minako sets mode: -b *!~testy@216.105.160.17
[17:32:49] * Joins: Testy (~testy@216.105.160.17)
[17:32:52] <Testy> !afk
[17:32:54] <Minako> Away Kick Engaging
[17:32:56] * Testy was kicked by Minako (You have requested force timeout from the channel.)
First one was with sticky. Thus kicking without the kick message, and adding a bot list ban, and a chanlist ban that were separate so when the bot list ban expired, the chanlist didnt expire.

The second was without sticky. No ban worked and the user could join anad part freely with no bot intervention

Kinda weird
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

This is really getting damn confusing now. The bans will not work when sticky isnt on, yet i get only the banlist ban, just as i want it, the person is kicked, but they are not banned from the channel on return.

It was mentioned that this ban was set by someone else, this only happens when sticky is set. Is there another way a ban can be added to a person, using a self defined time. Either that, or constuct a simple line of code that removes the channel ban at the same time the banlist ban expires?
s
spyda
Halfop
Posts: 64
Joined: Mon Aug 12, 2002 2:22 am
Location: Australia

Just think this might help you!!

Post by spyda »

1. I was looking over a old script that I made. And I noticed that I had a line in it that you dont have.

Code: Select all

pushmode $chan +b $uhost
This is your script with that added in:

Code: Select all

bind pub - !afk pub:afkkick_kick 

proc pub:afkkick_kick {nick uhost hand chan text} { 
global testchan kickmsg 
set bantime [lindex $text 0] 
set reason [lindex $text 1] 
set creator "AFKKick Script" 
if {$chan != $testchan} { return 0} 
putserv "PRIVMSG $chan :Away Kick Engaging" 
puthelp "KICK $chan $nick :$kickmsg" 
pushmode $chan +b $uhost
newchanban $chan $uhost $creator $reason $bantime  
}
I hope that helps you with the problem with baning without sticky!

2. With the not being a sticky ban now it will expire with what the $bantime is set at/or 60min if nothing is set. You could also add in some checks so the script is more user firendly eg:

Code: Select all

set testchan "#testchan"
set kickmsg "NO AFK. thanx!"
set bantime1 "10"

bind pub - !afk pub:afkkick_kick

proc pub:afkkick_kick {nick uhost hand chan text} { 
 global testchan kickmsg bantime1
 set bantime [lindex $text 0] 
 set reason [lindex $text 1]  
 if {$bantime == ""} {set bantime $bantime1}
 if {$reason == ""} {set reason "Auto AFKKick Script"}
 set creator "AFKKick Script"
 if {$chan != $testchan} { return 0} 
 putserv "PRIVMSG $chan :Away Kick Engaging" 
 puthelp "KICK $chan $nick :$kickmsg" 
 pushmode $chan +b $uhost
 newchanban $chan $uhost $creator $reason $bantime
}  
Hope that all helps you..

------------
ThePope
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

Thank you very much.

Putting this into a script. What i just finished testing was a script that allowed you to do !w3rk (time left in channel) which would restrict the time you had in channel if you need to get some work done. !afk is the instant ban version.

Very very big thank you indeed :)))
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

actually, quick bit of help debugging

Eggdrop gives this error
[14:04:59] <Minako> [14:05] Tcl error in script for 'timer149':
[14:04:59] <Minako> [14:05] invalid command name ""
and this is the timer command
timer $warntime {[putserv "Mode $runchan +b $kickhost "] [putserv "KICK $runchan $kicknick :$kickmsg2 "]}
Where would this error be caused? I am certain its the syntax, cant be anything else. Whatever it is, it affects the length of the timer. As it bans immediately almost 5 seconds, rather than a minute which it should be doing
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

For the AFK kick script, it still sets two bans. And still thinks the bot didnt set the ban. Even without sticky, it leaves exactly the same effect as before, which is a bit of a bugger.

<Minako> ! [ 6] sebreid!*@public2-ward1-6-cust47.manc.broadband.ntl.com (expires at 14:45)
<Minako> Minako: Test
<Minako> Created 14:44
<Minako> * [ 7] *!sebreid@public2-ward1-6-cust47.manc.broadband.ntl.com (Minako!Minako@public2-ward1-6-cust47.manc.broadband.ntl.com) (active 00:10)
<Minako> [14:46] No longer banning sebreid!*@public2-ward1-6-cust47.manc.broadband.ntl.com on #weirdo (expired)

When the newchanban expires it still leaves...

<Minako> * [ 6] *!sebreid@public2-ward1-6 cust47.manc.broadband.ntl.com (Minako!Minako@public2-ward1-6-cust47.manc.broadband.ntl.com) (active 01:19)

That.

Code: Select all

bind pub - !afk pub:afkkick_kick
proc pub:afkkick_kick {nick uhost hand chan text} {
	global runchan defbantime defreason botnick
	set bantime [lindex $text 0 ]
	if {$bantime == ""} {set bantime $defbantime}
	set reason [lindex $text 1 ]
	if {$reason == ""} {set reason $defreason}
	set creator $botnick
	set kickmsg "You have requested force timeout from the channel for $bantime minutes."
	putserv "PRIVMSG $runchan :Away Kick Engaging"	
	puthelp "KICK $runchan $nick :$kickmsg"	
	pushmode $runchan +b $uhost"
	newchanban $runchan $uhost $creator $reason $bantime 
}
Thats the current code as is. And it still has the same effects as before. Any other ideas ?
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

well...

Code: Select all

pushmode $runchan +b $uhost" 
newchanban $runchan $uhost $creator $reason $bantime
doesn't that tell the bot to ban twice?
Elen sila lúmenn' omentielvo
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

Yes, i need a ban with an expiration. the newchanban provides this. But it doesnt actually add a ban to a channel when it is added.... unless its sticky, when it becomes sticky, it adds a real channel ban, which doesnt get removed when the ban expires. The hope was to push a ban before the newchanban with the same function, host etc, it would treat it as the same ban, but it didnt

All i need is a ban that expires after $bantime

But it doesnt do it :(
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Code: Select all

bind pub - !afk pub:afkkick_kick 
proc pub:afkkick_kick {nick uhost hand chan text} { 
   global runchan defbantime defreason botnick 
   set bantime [lindex [split $text] 0 ] 
   if {$bantime == ""} {set bantime $defbantime} 
   set reason [lrange [split $text] 1 end] 
   if {$reason == ""} {set reason $defreason} 
   set creator $botnick 
   set kickmsg "You have requested force timeout from the channel for $bantime minutes." 
   putserv "PRIVMSG $runchan :Away Kick Engaging"    
   puthelp "KICK $runchan $nick :$kickmsg"    
   newchanban $runchan [maskhost "$nick!$uhost"] $creator $reason $bantime 
}
I tested this on my bot and it worked fine 4 me, it kicked, banned and the ban expired. Is the chan ur using it on +dynamicbans ?
Elen sila lúmenn' omentielvo
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

You changed it in little ways. None of these helped when i edited my code to be identical to yours. Although yours is a little neater :)
<Minako> Away Kick Engaging
* You were kicked by Minako (You have requested force timeout from the channel for 1 minutes.)
* Attempting to rejoin channel #weirdo
* Rejoined channel #weirdo
* ChanServ sets mode: +o Weirdo

<Minako> ! [ 6] sebreid!*@public2-ward1-6-cust47.manc.broadband.ntl.com (expires at 15:41)
<Minako> Minako: Test
<Minako> Created 15:40
I tested it on myself. Without the extra pushmode bit, that is what happened. I am using it in a brand new channel, using the default modes
-inactive +statuslog -secret +shared
+greet -seen +cycle +dontkickops
+protectops +protectfriends -revenge -revengebot
-bitch +autoop +autovoice -nodesynch
+enforcebans +dynamicbans +userbans +autohalfop
-protecthalfops
+dynamicexempts +userexempts +dynamicinvites +userinvites
As i am bot owner, would this affect the banning?

I used a webchat to test the script. Here the Results
[15:47:41] <Testy> !afk 1 test
[15:47:43] <Minako> Away Kick Engaging
[15:47:45] * Testy was kicked by Minako (You have requested force timeout from the channel for 1 minutes.)
[15:47:58] * Joins: Testy (~testy@216.105.160.17)

[15:48:11] <Minako> ! [ 6] ~testy!*@216.105.160.17 (expires at 15:48)
[15:48:11] <Minako> Minako: test
[15:48:11] <Minako> Created 15:47
It made the ban, yet didnt set mode +b

My Eggdrop info is
[15:49:28] <Minako> I am Minako, running eggdrop v1.6.12: 14 users (mem: 577k)
[15:49:28] <Minako> Online for 03:57 (background) CPU 01:42 cache hit 45.0%
[15:49:28] <Minako> Admin: Weirdo
[15:49:28] <Minako> Config file: eggdrop.conf
[15:49:28] <Minako> OS: CYGWIN_NT-5.1 1.3.12(0.54/3/2)
[15:49:28] <Minako> Tcl library: D:/Misc/Minako 2002#/lib/tcl8.3
[15:49:28] <Minako> Tcl version: 8.3.4 (header version 8.3.4)
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

[15:47:41] <Testy> !afk 1 test
[15:47:43] <Minako> Away Kick Engaging
[15:47:45] * Testy was kicked by Minako (You have requested force timeout from the channel for 1 minutes.)
[15:47:58] * Joins: Testy (~testy@216.105.160.17)

[15:48:11] <Minako> ! [ 6] ~testy!*@216.105.160.17 (expires at 15:4
[15:48:11] <Minako> Minako: test
[15:48:11] <Minako> Created 15:47
Note. The ban mask used is incorrect. It is trying to ban a nickname ~testy.

Are you using any scripts that replace the maskhost function?
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

Once script uses maskhost in its banning system

Code: Select all

proc notriggers_maskban {nick uhost} {
	global notriggers_setting
	switch -- $notriggers_setting(bantype) {
		1 { set ban "*!*@[lindex [split $uhost @] 1]" }
		2 { set ban "*!$uhost" }
		3 { set ban "$nick!*@[lindex [split $uhost @] 1]" }
		4 { set ban "$nick!$uhost" }
		5 { set ban [maskhost $uhost] }
		default { set ban "*!*@[lindex [split $uhost @] 1]" }
	}
	return $ban
}
Only script in the bot that uses banning of any sort apart from the one i have been building. And cause i am a bit of a n00b writing my own, i didnt know about its existance :)
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

try unloading that script and try again :)
Elen sila lúmenn' omentielvo
Locked