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 

Bot should reop - Help with this script
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
darton
Op


Joined: 21 Jan 2006
Posts: 155

PostPosted: Sun Feb 26, 2006 12:28 pm    Post subject: Bot should reop - Help with this script Reply with quote

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:
proc needop {n u h c m t} {
global botnick
if {[botisop $chan]=="0"}
{putquick "PRIVMSG ChanServ :op $c"}
}
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sun Feb 26, 2006 3:11 pm    Post subject: Reply with quote

bound to nothing
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
darton
Op


Joined: 21 Jan 2006
Posts: 155

PostPosted: Sun Feb 26, 2006 3:40 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Sun Feb 26, 2006 4:56 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Feb 26, 2006 6:14 pm    Post subject: Reply with quote

Code:
.chanset #chan need-op putquick "privmsg ChanServ :op #chan"

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
darton
Op


Joined: 21 Jan 2006
Posts: 155

PostPosted: Mon Feb 27, 2006 7:34 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
darton
Op


Joined: 21 Jan 2006
Posts: 155

PostPosted: Thu Mar 09, 2006 10:39 am    Post subject: Reply with quote

Now, just a simple question. How can I disable the need-op command.
".chanset #chan -need-op" doesn't work.
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Thu Mar 09, 2006 1:41 pm    Post subject: Reply with quote

Code:

.chanset #chan need-op

should do.
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
darton
Op


Joined: 21 Jan 2006
Posts: 155

PostPosted: Wed Mar 22, 2006 10:45 am    Post subject: Reply with quote

Is there also a possibility to get halfop?
Code:
.chanset #chan need-halfop putquick "privmsg ChanServ :halfop #chan"
This code doesn't work.
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Wed Mar 22, 2006 11:27 am    Post subject: Reply with quote

Probably because 'need-halfop' dosen't even exist.
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
darton
Op


Joined: 21 Jan 2006
Posts: 155

PostPosted: Wed Mar 22, 2006 11:37 am    Post subject: Reply with quote

Yes I know.
But why does this script not work?
Code:
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   
  }
 }
}
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Mar 22, 2006 11:37 am    Post subject: Reply with quote

need-halfop is not supported by eggdrop1.6.17, you need a script for that.
Code:
# 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:
Quote:
.chanset #channel need-halfop putquick "ChanServ :halfop #channel $botnick"


Edit: Fixed the missing bracket.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts


Last edited by Sir_Fz on Thu Mar 23, 2006 1:12 pm; edited 3 times in total
Back to top
View user's profile Send private message Visit poster's website
darton
Op


Joined: 21 Jan 2006
Posts: 155

PostPosted: Wed Mar 22, 2006 12:06 pm    Post subject: Reply with quote

Hm...Whats that?
(17:04:40) Tcl error in script for 'timer30':
(17:04:41) unknown putquick option: should be one of: -normal -next
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Wed Mar 22, 2006 12:14 pm    Post subject: Reply with quote

Check punctuation of putquick command i.e. closing quotes etc.
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
darton
Op


Joined: 21 Jan 2006
Posts: 155

PostPosted: Wed Mar 22, 2006 12:23 pm    Post subject: Reply with quote

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..."}
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
Goto page 1, 2  Next
Page 1 of 2

 
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