| View previous topic :: View next topic |
| Author |
Message |
dhalus Voice
Joined: 10 Jan 2012 Posts: 1
|
Posted: Tue Jan 10, 2012 12:38 am Post subject: When eggdrop has no op on channel |
|
|
When eggdrop has no op on channel,to take op with command /opmode #channel +o nick.
I have a irc server, and i have an eggdrop caled help.. is the best eggdrop but is missing one of best part ... i wanna the eggdrop to take autoop on channel with oper,if some one try to deop him to give kill!! with command /kill nick to lazy! to the client. thank you who can help me with tcl script  |
|
| Back to top |
|
 |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Thu Jan 19, 2012 11:54 am Post subject: |
|
|
I didn't test this, but it sounds like something you want.
| Code: |
# Auto TCL - istok @ IRCSpeed.org
# $Id: auto.tcl,v1 20/01/2012 04:37:42am GMT +12 (NZST) istok Exp $
bind join - * join:op
proc join:op {nick uhost hand chan} {
if {![isbotnick $nick]} {return}
utimer 5 check:status
}
proc check:status {} {
global botnick
foreach chan [channels] {
if {![isop $botnick $chan]} {
putquick "opmode $chan +o $botnick"
}
}
}
bind mode - "-o" deop:check
proc deop:check {nick uhost hand chan mode {target ""}} {
global botnick
if {$botnick != $target} {return}
putquick "kill $nick :too lazy!"
}
putlog "Loaded: auto.tcl"
|
Hope it works. _________________ We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri Jan 20, 2012 2:24 am Post subject: |
|
|
Why don't you use isbotnick (in all places) and botisop built-in functions?
Instead of:
| Code: |
if {![isop $botnick $chan]} {
|
would be:
| Code: |
if {![botisop $chan]} {
|
Also, why not take advantage on the 'bind need' (again, a built-in function) instead of that utimer (useless) check? Or you've could have used a cron bind instead of it too.
| Code: |
bind need - "% op" bot:needop
proc bot:needop {chan type} {
putquick "opmode $chan +o $::botnick"
}
|
_________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Fri Jan 20, 2012 6:25 am Post subject: |
|
|
| Quote: | | Why don't you use isbotnick (in all places) and botisop built-in functions? |
I was going to, and did use it (isbotnick) within the join procedure, but I got lazy. I'm self taught, mostly by reading other peoples code. I just do things the way I know works. _________________ We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals. |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Fri Jan 20, 2012 9:55 am Post subject: |
|
|
| caesar wrote: |
...
Also, why not take advantage on the 'bind need' (again, a built-in function)
...
|
Wouldn't this (built in) accomplish it too, and be the most simple? :
http://www.egghelp.org/commands/channels.htm#chaninfo
and see:
need-op tcl command to execute when the bot doesn't have ops
Thus something like:
.chanset #channel need-op "whatever commands you want go here" |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sat Jan 21, 2012 4:26 am Post subject: |
|
|
Sure, but then if he has multiple channels would have to issue the same command for each channel. This ways is easier.  _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sat Jan 21, 2012 10:58 am Post subject: |
|
|
I had not considered that possibility.
But then something like this should do it:
.chanset * need-op "whatever commands you want go here" |
|
| Back to top |
|
 |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Tue Jan 24, 2012 12:24 pm Post subject: |
|
|
I didn't bother with need-op because that wasn't what the user asked for. Also, it tends to flood services, most people add a "chanserv op" command to their bot, so anytime anyone deops the bot it will autoop again. This can cause issues, in a desync, with flooding, etc. My code triggers a single time, making sure that it doesn't attempt to op itself if already opped. _________________ We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Wed Jan 25, 2012 12:09 pm Post subject: |
|
|
| Get_A_Fix wrote: | | My code triggers a single time, making sure that it doesn't attempt to op itself if already opped. |
really?
| Code: |
utimer 5 check:status
|
then what this do?
The need of OP is triggered only when the bot needs OP, not every 5 seconds like in your case. Anyway, if he wants to have the bot on a channel where it doesn't have op then he can add a user defined channel flag (see 'setudef') and then check if that flag is on/off for that channel and proceed with what command he wishes to issue.
Example:
| Code: |
setudef flag botneeds
bind need - "% op" bot:needop
proc bot:needop {chan type} {
if {![channel get $chan botneeds]} return
putquick "opmode $chan +o $::botnick"
}
|
The need bind can be extended to fill the other needs too (join, limit, ban, key, etc.) if needed. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
|