| View previous topic :: View next topic |
| Author |
Message |
darton Op
Joined: 21 Jan 2006 Posts: 155
|
Posted: Sun Feb 26, 2006 12:28 pm Post subject: Bot should reop - Help with this script |
|
|
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 |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sun Feb 26, 2006 3:11 pm Post subject: |
|
|
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 |
|
 |
darton Op
Joined: 21 Jan 2006 Posts: 155
|
Posted: Sun Feb 26, 2006 3:40 pm Post subject: |
|
|
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 |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sun Feb 26, 2006 4:56 pm Post subject: |
|
|
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 |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Feb 26, 2006 6:14 pm Post subject: |
|
|
| Code: | | .chanset #chan need-op putquick "privmsg ChanServ :op #chan" |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
darton Op
Joined: 21 Jan 2006 Posts: 155
|
Posted: Mon Feb 27, 2006 7:34 am Post subject: |
|
|
| 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 |
|
 |
darton Op
Joined: 21 Jan 2006 Posts: 155
|
Posted: Thu Mar 09, 2006 10:39 am Post subject: |
|
|
Now, just a simple question. How can I disable the need-op command.
".chanset #chan -need-op" doesn't work. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Thu Mar 09, 2006 1:41 pm Post subject: |
|
|
| 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 |
|
 |
darton Op
Joined: 21 Jan 2006 Posts: 155
|
Posted: Wed Mar 22, 2006 10:45 am Post subject: |
|
|
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 |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Wed Mar 22, 2006 11:27 am Post subject: |
|
|
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 |
|
 |
darton Op
Joined: 21 Jan 2006 Posts: 155
|
Posted: Wed Mar 22, 2006 11:37 am Post subject: |
|
|
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 |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Mar 22, 2006 11:37 am Post subject: |
|
|
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 |
|
 |
darton Op
Joined: 21 Jan 2006 Posts: 155
|
Posted: Wed Mar 22, 2006 12:06 pm Post subject: |
|
|
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 |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Wed Mar 22, 2006 12:14 pm Post subject: |
|
|
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 |
|
 |
darton Op
Joined: 21 Jan 2006 Posts: 155
|
Posted: Wed Mar 22, 2006 12:23 pm Post subject: |
|
|
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 |
|
 |
|