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.

Bot should reop - Help with this script

Help for those learning Tcl or writing their own scripts.
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Bot should reop - Help with this script

Post by darton »

Hello!
With this script my bot should reop itself, if it hasn't got op status. But it does not work. What's wrong with it?

Code: Select all

proc needop {n u h c m t} {
global botnick 
if {[botisop $chan]=="0"}
{putquick "PRIVMSG ChanServ :op $c"}
}
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

bound to nothing
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

What? What's bound? I'm german, so my english isn't that good.
I only want that my bot get op when it does not have op. Is the script I made wrong?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Please check the TCL Archive for a script that suits your needs, there should be a tone of them.
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

.chanset #chan need-op putquick "privmsg ChanServ :op #chan"
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

Thanks Sir_Fz. I thought that this option will flood the services, but now I have found out that it only get OP again when it is deoped.
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

Now, just a simple question. How can I disable the need-op command.
".chanset #chan -need-op" doesn't work.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

.chanset #chan need-op
should do.
Once the game is over, the king and the pawn go back in the same box.
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

Is there also a possibility to get halfop?

Code: Select all

.chanset #chan need-halfop putquick "privmsg ChanServ :halfop #chan"
This code doesn't work.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Probably because 'need-halfop' dosen't even exist.
Once the game is over, the king and the pawn go back in the same box.
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

Yes I know.
But why does this script not work?

Code: Select all

set active #SODclan
proc needhalfop {nick uhost hand chan arg} { 
if {[string equal -nocase $chan $::active]} { 
if {[botisop $chan] == 0} {
  putquick "PRIVMSG ChanServ :halfop $chan
  return 0    
  }
 }
}
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

need-halfop is not supported by eggdrop1.6.17, you need a script for that.

Code: Select all

# check every how many seconds?
set nhotime 30

if {[timerexists needhop]==""} {
 utimer $nhotime needhop
}

setudef str need-halfop

proc needhop {} {
 global botnick
 foreach chan [channels] {
  if {![botishalfop $chan] && [set nho [channel get $chan need-halfop]] != ""} {
   set queue [lindex [split $nho] 0]
   set switch [lindex [split $nho] end]
   if {![string equal -nocase "-next" $switch]} {
    set cmd [string trimleft [join [lrange [split $nho] 1 end]] \"]
    set cmd [string trimright $cmd \"]
    set switch "-normal"
   } {
    set cmd [string trimleft [join [lrange [split $nho] 1 end-1]] \"]
    set cmd [string trimright $cmd \"]
   }
   $queue [subst $cmd] $switch
  }
 }
 utimer $::nhotime needhop
}
Usage:
.chanset #channel need-halfop putquick "ChanServ :halfop #channel $botnick"
Edit: Fixed the missing bracket.
Last edited by Sir_Fz on Thu Mar 23, 2006 1:12 pm, edited 3 times in total.
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

Hm...Whats that?
(17:04:40) Tcl error in script for 'timer30':
(17:04:41) unknown putquick option: should be one of: -normal -next
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Check punctuation of putquick command i.e. closing quotes etc.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

When I type .chaninfo, the bot says:
User defined channel strings:
need-halfop: {putquick "ChanServ :halfop #SODclan $botnick"}

I think everything is OK, but I think it has to be {putquick "PRIVMSG..."}
Post Reply