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.

halfop unbinding, part 2

Old posts that have not been replied to for several years.
Locked
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

halfop unbinding, part 2

Post by Weirdo »

Hi

this topic isnt so old, you helped me recently to restrict the ban functions to ops only, so halfops coulnt use them. After doing some more of that, only i came up with some problems

Code: Select all

unbind dcc o|o "say" *dcc:say
bind dcc ol|ol "say" *dcc:say
unbind dcc o|o "act" *dcc:act
bind dcc ol|ol "act" *dcc:act
I want to let them use the bot chatting facilities. Well, its a female bot... and you get the idea, the channel could use some livening up. Problem is, although i have rebinded them, it still gives the

"You are not a channel op on #cometanime"
"what, you need .help?"

Which means the access dont work, am i doing something wrong?

Also, how i can i remove the .help references for halfops. As they still see the +ban, -ban +invite... ones still. Want to clean this up a little, and completely hide the unnecessary ones from the help file. Maybe add a little .say reference so they can see it :)

Can you offer any help?

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

Post by ppslim »

I havn't looked, so don't hold me too it.

A lot of functions in eggdrop, do internal checking, as well as on the binds.

If you havn't got the flags for a bind, you get "you need help", but if there is internal checking, then the function will usualy warn and complain.

You could simply work around this, with small Tcl scripts.
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

IE replace the .say command with a different one which links to it in a tcl script. Its possible :)

where is the internal checking held?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Internal commands, are built using Tcl, and called in a Tcl wrapping function (confuzzled yet).

So when a bind is triggered, eggdrop will search it's bind lists, call any internal functions, then call any Tcl scripts, depending on the type of bind.

Just like a Tcl procedure, that is called by an event triggered bind, the same applies to the C functions.

To use Tcl as an example (it's quicker, and you will understand it more).

Code: Select all

bind pub - "!test" test
proc test {nick uh hand chan arg} {
  if {![matchattr $hand o|o $chan]} {
    puthelp "PRIVMSG $nick :You don't have operator access"
    return
  }
  Triiger code
}

Instead of doing the flga checking in the bind, the script is doing it. It allow a certain flexibility, and is job dependant. In simple scripts, keep to using flags in binds.

Like in my example, the C functions will check the users flags, before allowing him access to the commands.

So even though the user has half-op flags, and the bind allows him to trigger it (simalar to the fact, the bind in the example, allows any1 to trigger it), a check inside the function is stopping him.

The simplest way to locate the files with the functions, is to look in the modules related with the task being done (EG: server, irc, channels and possibly core (IE, eggdrop, not a module)), the files are usualy named so that you can see what there contents are (usualy have Tcl in for code that provides command that can be used in script, cmds for functions that provide bind based commands).
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

Hmmm, and since it is a windrop that i do my scripting on, this becomes impossible without a C compiler. Modules are all Dlls :P

Damn.

Is it possible i could unbind the .say command from the module, and then bind the .say command to a script using the eggdrop.conf unbinding thingy. As its possible to rename commands, "ident" to "logon", isnt it therefor possible to reallocate the commands unbinded to different procedures.

I think it should be ok to script a replacement .say and .act thing. As long as i can find the variable that gives the channel the console is set to.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Yes, this is possible.

Simply unbind the command, like you can do with all commands.

THen create a script, as if the command was never there in the first place.
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

perfect :)

before i just go ahead with this. The proc is called dcc:hosay, so doing this will look like the code below?

unbind dcc o|o "say" *dcc:say
bind dcc ol|ol "say" *dcc:hosay
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Yes this will work.

However, try not to use * in your own procedure names.

The * is used in eggdrop, to signify a builtin command, however, I do not know how this came about.

If you use * in your scripts, it could come to confuse you later on
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

bind dcc ol|ol "say" dcc:hosay

so just that then, kewl :)
Locked