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.

A script

Old posts that have not been replied to for several years.
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

A script

Post by metroid »

Code: Select all

bind mode - "+o" op:nick
bind mode - "*+o*" op:nick

proc op:nick {nick uhost hand chan mode} {
      if {$mode == "+o"} {
      if {$nick == "$botnick" || [matchattr $nick "o"]) {
      putserv "PRIVMSG $chan :Why thank you $nick"
} else {
      putquick "MODE $chan -o $botnick"
      putserv "PRIVMSG $chan :Please do not op me $nick"
      }
   }
}
}
It doesnt seem to work...

It might seem like a strange script but i want the bot to only be opped by people in its userlist.

So if it gets opped by someone else, it deops itself, but the code here doesnt seem to work :(
-edit : Can someone fix it?
Last edited by metroid on Sun Jul 04, 2004 1:47 pm, edited 1 time in total.
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Gah, i need this to be fixed :(
User avatar
Aron
Halfop
Posts: 86
Joined: Sat Mar 15, 2003 8:35 am

Post by Aron »

Processes triggered by "bind mode" have the following form:

Code: Select all

proc-name {nick host hand chan mode victim} { }
You forgat the victim.
The person being opped is the victim, in this case.
The best way to start learning is to start helping.
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

[23:01] Tcl error [op:nick]: syntax error in expression "$nick == "$::botnick" || [matchattr $nick o]) {
[23:01:09] <sheeptest> putserv "PRI...": extra tokens at end of expression

:E
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

try something like this:

Code: Select all

if {($nick == $::botnick) || ([matchattr $hand o])} {
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Code: Select all

if {$nick == "$botnick" || [matchattr $nick "o"]) {
Change to (as gb posted):

Code: Select all

if {($nick == $::botnick) || ([matchattr $hand o])} {
Notice absence of quotation marks and also notice the right brace you missed putting in.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Here give this a try, it should work.

Code: Select all

bind mode - "*+o*" op:nick 

proc op:nick {nick uhost hand chan mode target} { 
 global botnick
  if {($mode == "+o") && ($target == $botnick)} { 
  if {([matchattr $hand o])} { 
  putserv "PRIVMSG $chan :Why thank you $nick!" 
  } 
  if {(![matchattr $hand o])} { 
  putquick "MODE $chan -o $botnick" 
  putserv "PRIVMSG $chan :Please do not op me $nick!" 
  } 
 } 
} 
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Ill put it in right now, and see if it works :)
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Works perfectly :)

Thanks for fixing it
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

When I make it, it always has to work! :lol:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
d
dollar
Op
Posts: 178
Joined: Tue Oct 28, 2003 3:47 pm
Location: Netherlands

Post by dollar »

Why doesn't anyone use isbotnick? :cry:
dollar (or something similar) at:
#eggdrop / #tcl - undernet
#egghelp / #tcl / #eggtcl - efnet
#eggdrop.support / #tcl - quakenet
#eggdrop - ircnet
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

I do.

/me puts hand up

:)
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

$target == $botnick is not necesarly correct cos foo is not equal with FOO or FoO and so on, so either "string tolower" them or use "string equal -nocase $target $botnick"

This has been discussed 100 times before, why don't you understand it once and for all?
Once the game is over, the king and the pawn go back in the same box.
d
dollar
Op
Posts: 178
Joined: Tue Oct 28, 2003 3:47 pm
Location: Netherlands

Post by dollar »

caesar wrote:$target == $botnick is not necesarly correct cos foo is not equal with FOO or FoO and so on, so either "string tolower" them or use "string equal -nocase $target $botnick"

This has been discussed 100 times before, why don't you understand it once and for all?
String equal BAAAAD, isbotnick GOOOOD!
dollar (or something similar) at:
#eggdrop / #tcl - undernet
#egghelp / #tcl / #eggtcl - efnet
#eggdrop.support / #tcl - quakenet
#eggdrop - ircnet
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I was kinda talking in general. :P I haven't mentioned nothing about the isbotnick cos you've done it before me so there was no point on repeating the same thing, I just pointed out that thre is a BIG difference and should be taken in consideration. :mrgreen:
Last edited by caesar on Tue Jul 06, 2004 2:08 pm, edited 1 time in total.
Once the game is over, the king and the pawn go back in the same box.
Locked