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.

[Eggdrop]Check if the bot has +ao @L via !check

Help for those learning Tcl or writing their own scripts.
Post Reply
r
raws17
Voice
Posts: 1
Joined: Wed Mar 05, 2008 7:59 am

[Eggdrop]Check if the bot has +ao @L via !check

Post by raws17 »

Hello,

i test it but there is an error.
I want the bot to check via a command (!check)
if he's op in every channel except my main channel.
And if hes not OP he should write a message in the chan and part it.

Code: Select all




#BINDS

bind Pub n "!checkall" start:check


	proc start:check { nickname hostname handle channel arguments } {


		# Userchannel
		#set userchannel [lindex $arguments 0]

		# Main channel
		set main "##raw"

		# Checks if we are opped on channel.
		if {[botisop [channels]]
		return 0



		# Wenn nicht -->
{

		if {[info exists chlist]} {lappend chlist $chan} {set chlist [channels]}

		# checken
		putserv "PRIVMSG $userchannel : Kein +ao - Ich leave
		putserv "PRIVMSG $main : Habe kein +ao in $userchannel - Raus da!
		channel remove $userchannel

	}

	# prozess beenden
	return 1
}

# Gives some nice credits :P~
putlog "--Just a test--"

thx alot !
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

'botisop' does not accept a list of channels (which is what 'channels' returns) and your command starting with "{" makes no sense at all.
You'll need a loop to check each channel ('foreach' would be the obvious choice, as you're looping through the elements of a list of channel names)

I suggest you start by learning tcl's syntax, then read some other scripts to get an idea about what commands might be useful for you (and check their details in the relevant manual/doc-file)

Native tcl commands
eggdrop commands: doc/tcl-commands.doc (in your eggdrop dir)


...or maybe you're looking for the Script Requests forum?
Have you ever read "The Manual"?
s
spijon
Voice
Posts: 33
Joined: Sun Aug 27, 2006 9:55 pm

Post by spijon »

Did you finish the script?

Look for more or less the same but to work on Quakenet.org

!check-all or auto check

The bot "jump" the channels its haven't got +a or +o on.
And msg chan "give me voice/op or i part" and if not +v or +o after like 10min its parts. And msg the "main" chan with the info.

Best regards
Spijon
Post Reply