egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

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

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
raws17
Voice


Joined: 05 Mar 2008
Posts: 1

PostPosted: Wed Mar 05, 2008 8:03 am    Post subject: [Eggdrop]Check if the bot has +ao @L via !check Reply with quote

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:




#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 !
Back to top
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Wed Mar 05, 2008 8:32 am    Post subject: Reply with quote

'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"?
Back to top
View user's profile Send private message
spijon
Voice


Joined: 27 Aug 2006
Posts: 33

PostPosted: Fri Aug 15, 2008 8:09 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber