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.

+bitch and public command tcl's

Old posts that have not been replied to for several years.
Locked
F
Fluxism
Halfop
Posts: 47
Joined: Mon Aug 05, 2002 8:58 am

+bitch and public command tcl's

Post by Fluxism »

I have my bot set to +bitch on all its channels. But after I added a public command tcl, I've noticed that any +o user can op anyone, regardless as to weather or not the user being op'ed has got the +o flag for that channel. If the just oped user then changes nick, the bot deops them.
I think whats happening is the public command script is giving a standard +o user 'pseudo' +m status as it were, and just opping anyone asked of it, rather than call an internal routine to see if the user should be op'ed in the first place.
I've tried 3 different public command scripts so far, and they all have this problem. Has anyone else encountered this? Or made a work around for it? Perhaps found a script which checks the user list before it ops someone?

Thanks.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Code: Select all

if {![matchattr [nick2hand $text $chan] o]} { return }
if u add this line of code in the script it checks if the one beeing oped has the +o flag, that should solve your prob
Elen sila lúmenn' omentielvo
F
Fluxism
Halfop
Posts: 47
Joined: Mon Aug 05, 2002 8:58 am

Post by Fluxism »

Thanks for the reply,

Two questions though, can I add the line anywhere? Though I'm thinking it should go at the start of the script.
Also in your line of code, is the exclamation mark part of the code, or does it signify the command character used to op? eg !op. As I have mine set to a % character, so am thinking I need to change this maybe?

Thanks again.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

No need to change this, as you tried to guess, it's part of the code.

The "if" command, performs actions, based on a set of tests.

These tests can either equal TRUE or FALSE.

Running the command "[matchattr [nick2hand $text $chan] o]" is testing to see if the user, that might be opped (IE - %op ppslim - it tests ppslim). If he is +o in the userfile, the it returns TRUE, if not, FALSE.

Using ! negates a answer.

So, the above command becomes, if ppslim is NOT +o, then return TRUE, else, return FALSE.

As for where to place the line, it realy depends on the script you are using.
F
Fluxism
Halfop
Posts: 47
Joined: Mon Aug 05, 2002 8:58 am

Post by Fluxism »

As ever, thanks for the reply,

I checked the tcl script, and this is the part which calls the op procedure;

Code: Select all

putserv "privmsg $nick :$tex"
}

proc op {www liquid2k com slash xzziroz} {
set nick [lindex $xzziroz 0]
  if {$nick != ""}\
{putserv "mode $slash +o $nick" -next
}     else {putserv "mode $slash +o $www" -next}
}

proc deop {www liquid2k com slash xzziroz} {
So would I be right in saying I can just add Papillon's line of code above the 'proc op' line? Or is my lack of tcl know how showing? Or might it have to be included into the current if argument?

Code: Select all

if {![matchattr [nick2hand $text $chan] o]} { return }
proc op {www liquid2k com slash xzziroz} {
set nick [lindex $xzziroz 0]
  if {$nick != ""}\
{putserv "mode $slash +o $nick" -next
}     else {putserv "mode $slash +o $www" -next}
}

Thanks.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

While the code in there is rather up the wall, and inforrect (You would have to read toher threads to see why). You can simply add that line, below, the "proc op" line.

You will also need to change the line to

Code: Select all

if {![matchattr $com o $slash]} { return }
While there is nothing to stop a scripter from doing it, it's odd to see variable names like that.
F
Fluxism
Halfop
Posts: 47
Joined: Mon Aug 05, 2002 8:58 am

Post by Fluxism »

I added the line as suggested, so I now have;

Code: Select all

proc op {www liquid2k com slash xzziroz} {
if {![matchattr $com o $slash]} { return }
set nick [lindex $xzziroz 0]
  if {$nick != ""}\
{putserv "mode $slash +o $nick" -next
}     else {putserv "mode $slash +o $www" -next}
}
But I still have the same problem, the bot ops people it shouldn't be.
Pehaps though, as you have pointed out that the script is non too correct, maybe I should stop using it, and try altering another script..
Open to suggestions though.
Locked