isop function doesn't work ?!

Old posts that have not been replied to for several years.
Locked
User avatar
Jil Larner
Voice
Posts: 14
Joined: Fri Aug 20, 2004 8:28 am
Location: France

isop function doesn't work ?!

Post by Jil Larner »

Hello,

I have a tcl script which detects smilies flood and, when needed, kick or ban the user. Because the bot isn't always op/halfop I have a :

Code: Select all

if {![botisop $channel] && ![botishalfop $channel]} {
return 0
}
The first time, it works, user is notified, and, after, kicked. But just after kick, botisop returns false, and the scripts doesn't work anymore. I need to manually deop and reop bot if I want the script working.

See the entire function here :

Code: Select all

proc scanner:punish:smileyparty {nick uhost channel} {
	if {![botisop $channel] && ![botishalfop $channel]} { return 0 }
	# Protection des +f
	if {[matchattr [nick2hand $nick $channel] "f"]} { 
		putserv "NOTICE $nick :On se calme, mon ami(e)..."
		return 0 
	}

	global flood_Oo_punish flood_Oo_list
	if {[info exists flood_Oo_punish($uhost)]} {
		if {$flood_Oo_punish($uhost) == 1} {
			set flood_Oo_punish($uhost) 2
			putkick $channel $nick "J'aime pas tes smilies, alors arrête."
			return 1
		} elseif {$flood_Oo_punish($uhost) == 2} {
			set flood_Oo_punish($uhost) 3
			set bhost [mkbhost $uhost 1]	
			newchanban $channel $bhost Liantop "\[Smiley Party] T'as pas compris ? J'ai dit STOP" 5
			putkick $channel $nick "T'as pas compris ? J'ai dit STOP"
			return 1
		} elseif {$flood_Oo_punish($uhost) == 3} {
			set flood_Oo_punish($uhost) 4
			set bhost [mkbhost $uhost 2]
			newchanban $channel $bhost Liantop "\[Smiley Party] J'ai horreur de me répéter. Reste dehors." 15
			putkick $channel $nick "J'ai horreur de me répéter. Reste dehors."
			return 1
		} else {
			set flood_Oo_punish($uhost) 4
			set bhost [mkbhost $uhost 2]	
			newban $bhost Liantop "\[Flood Smiley] Tu veux jouer au con, tu vas perdre." 4320
			putkick $channel $nick "Tu veux jouer au con, tu vas perdre."
		}
	} else {
		set flood_Oo_punish($uhost) 1
		putserv "NOTICE $nick : Arrête tes smileys, sinon tu vas mal finir."
	}
}
I don't know if it's a bug of my script or of the eggdrop core... I may have to use a channel list where function must be actived, even if it reports errors when not op...

Using tcl 8.4 and eggdrop 1.6.16

Any idea ?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

I suggest you remove that 'return 1' then it might be okay. :wink:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
Jil Larner
Voice
Posts: 14
Joined: Fri Aug 20, 2004 8:28 am
Location: France

Post by Jil Larner »

Thanks, i gonna try. I just believed that would be quicker
User avatar
Jil Larner
Voice
Posts: 14
Joined: Fri Aug 20, 2004 8:28 am
Location: France

Post by Jil Larner »

With or without return 1, botisop returns false after the first putkick. Any idea ?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Use this type of structure, maybe:

Code: Select all

if {([botisop $channel) || ([botishalfop $channel])} {
..........
........
......
....
}
Last edited by awyeah on Fri Aug 20, 2004 2:35 pm, edited 1 time in total.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
Jil Larner
Voice
Posts: 14
Joined: Fri Aug 20, 2004 8:28 am
Location: France

Post by Jil Larner »

No, on partyline :

Code: Select all

.tcl botisop #ludwig
Tcl: 0
But bot is op on this channel ! :o :cry:
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Weird, hmmmm... is the bot even opped or not?
I am not sure about this halfop thing though!
Give it a good restart at first.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
Jil Larner
Voice
Posts: 14
Joined: Fri Aug 20, 2004 8:28 am
Location: France

Post by Jil Larner »

I tried something :

Code: Select all

if {![botisop $channel] && ![botishalfop $channel]} {
	putquick "PRIVMSG ChanServ :op $channel"
}
So, when the bot thinks it's not anymore opped (what is false because with a putserv "MODE #chan +o otheruser" it works), it uses chanserv to enforce +o mode, but sometimes I have a "need op or halfop", time for the +o mode being caught by the eggdrop.
But it loses its op status sometimes... I don't understand why... I restarted a couple of times the bot, I will see. I use a lot of timers, (more than 80,000 for 10 days), maybe memory is saturated...
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

I use a lot of timers, (more than 80,000 for 10 days), maybe memory is saturated...
Could be true! :roll:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked