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.
Help for those learning Tcl or writing their own scripts.
-
Nimos
- Halfop
- Posts: 80
- Joined: Sun Apr 20, 2008 9:58 am
Post
by Nimos »
can i make a bind, which is only triggered by people NOT having a flag?
-
nml375
- Revered One
- Posts: 2860
- Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 »
I think you should be able to use the - prefix to flags to specify that the binding should only match if the user does not have these flags.
NML_375
-
Nimos
- Halfop
- Posts: 80
- Joined: Sun Apr 20, 2008 9:58 am
Post
by Nimos »
no if i have
it triggers if someone with +B flag joins the channel...
-
Papillon
- Owner
- Posts: 724
- Joined: Fri Feb 15, 2002 8:00 pm
- Location: *.no
Post
by Papillon »
just make it trigger on everyone and add a
Code: Select all
if {![matchattr <handle> <flags>]} { do_the_thing_you_want }
in the proc
Elen sila lúmenn' omentielvo
-
Nimos
- Halfop
- Posts: 80
- Joined: Sun Apr 20, 2008 9:58 am
Post
by Nimos »
and if the joining person is not registered in the bot?
wouldnt it be better to use
if not {![matchattr * B]} {action}
is there an "if not" funktion in tcl?
-
speechles
- Revered One
- Posts: 1398
- Joined: Sat Aug 26, 2006 10:19 pm
- Location: emerald triangle, california (coastal redwoods)
Post
by speechles »
Nimos wrote:and if the joining person is not registered in the bot?
wouldnt it be better to use
if not {![matchattr * B]} {action}
is there an "if not" funktion in tcl?
sure, your already using it.
Code: Select all
if {[matchattr $hand B]} { #matches do stuff }
if {![matchattr $hand B]} { #no matches do stuff }
This is assuming you use the variable name $hand in association with the handle passed to the proc by the binding.
Code: Select all
proc join:voice-check {nick host hand chan} {
-
Nimos
- Halfop
- Posts: 80
- Joined: Sun Apr 20, 2008 9:58 am
Post
by Nimos »
sure