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.

matchattr question

Old posts that have not been replied to for several years.
Locked
J
Jag
Halfop
Posts: 90
Joined: Fri Sep 19, 2003 10:06 am

matchattr question

Post by Jag »

someone knows how to build a command that when i write to the eggdrop in private:

Code: Select all

!access
it will send me a privmsg of all my flags?
example: Your flags are: +jkmnoptx
Thanks :)
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

bind msg - * !access return:flags

proc return:flags {nick uhost hand arg} {
 if {[lindex [split $arg] 0] == ""} {
  putserv "PRIVMSG $nick :[chattr $hand]"
} elseif {[string match [lindex $arg 0] "#*"]} {
  putserv "PRIVMSG $nick :[chattr $hand [lindex [split $arg] 0]]"
 }
}
untested.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Sir_Fz wrote:

Code: Select all

bind msg - * !access return:flags

proc return:flags {nick uhost hand arg} {
 if {[lindex [split $arg] 0] == ""} {
  putserv "PRIVMSG $nick :[chattr $hand]"
} elseif {[string match [lindex $arg 0] "#*"]} {
  putserv "PRIVMSG $nick :[chattr $hand [lindex [split $arg] 0]]"
 }
}
untested.
Change:

Code: Select all

} elseif {[string match [lindex $arg 0] "#*"]} {
To:

Code: Select all

} elseif {[string match "#*" [lindex [split $arg] 0]]} {
(you had the string match backwards (2nd time you've done that, heh), and forgot the split even though you remembered it on the following line).

Also, fyi, channels can start with characters other than # (ie: ! and &)
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

thanx for the correction, but i never saw a channel starting with ! or &, what do you mean ?
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

For example, on EFNet, if you join a channel beginning with & instead of #, say for example &eggdrop,
that channel is available only on the server you are on, and not available to the entire network.

Other networks have similar concepts, eggdrop has the built-in support for most (if not all) of them.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

oh okay, but i dont think it would matter for him, he's probably using a normal channel # :p
J
Jag
Halfop
Posts: 90
Joined: Fri Sep 19, 2003 10:06 am

Post by Jag »

10x!!!! :P
Locked