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.
Fire-Fox
Master
Posts: 299 Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null
Post
by Fire-Fox » Tue Nov 20, 2007 6:47 pm
hey
how can i rewrite this so ONLY some ppl on that liste can access the giving command
lets say fiddo is one on the list..
then i need to type name in a string.
hope all understand....
Code: Select all
########################
### only for some ppl ###
######################
set chans "#chan"
set nynewtext2 "some text"
proc pub_staff {nick uhost hand chan text} {
global mynewtext2
if {[isop $nick $chan]} {
putserv "PRIVMSG $chan : $nick $mynewtext2"
} else { putnoobuser $chan $nick }
}
########################
### End ###
######################
Alchera
Revered One
Posts: 3344 Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:
Post
by Alchera » Tue Nov 20, 2007 6:59 pm
Add [SOLVED] to the thread title if your issue has been.
Search |
FAQ |
RTM
Fire-Fox
Master
Posts: 299 Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null
Post
by Fire-Fox » Wed Nov 21, 2007 8:41 am
Thanks for the help. But now im noob to tcl how whot i implement it
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Thu Nov 22, 2007 7:43 am
Fire-Fox wrote: hey
how can i rewrite this so ONLY some ppl on that liste can access the giving command
lets say fiddo is one on the list..
then i need to type name in a string.
hope all understand....
Code: Select all
########################
### only for some ppl ###
######################
set chans "#chan"
set nynewtext2 "some text"
proc pub_staff {nick uhost hand chan text} {
global mynewtext2
if {[isop $nick $chan]} {
putserv "PRIVMSG $chan : $nick $mynewtext2"
} else { putnoobuser $chan $nick }
}
########################
### End ###
######################
You have to be more clear about your request.
Online
CrazyCat
Revered One
Posts: 1359 Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:
Post
by CrazyCat » Thu Nov 22, 2007 7:49 am
I guess you want to have a fixed list of allowed pple and match independantly of their status on the chan:
Code: Select all
set chans "#chan"
set authppl {"fido" "noob"}
set nynewtext2 "some text"
proc pub_staff {nick uhost hand chan text} {
global mynewtext2
if {[lsearch $::authppl [string tolower $nick]]} {
putserv "PRIVMSG $chan :$nick $mynewtext2"
} else { putserv "PRIVMSG $chan :$nick is not authorized to use this" }
}
Fire-Fox
Master
Posts: 299 Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null
Post
by Fire-Fox » Thu Nov 22, 2007 4:35 pm
CrazyCat wrote: I guess you want to have a fixed list of allowed pple and match independantly of their status on the chan:
Code: Select all
set chans "#chan"
set authppl {"fido" "noob"}
set nynewtext2 "some text"
proc pub_staff {nick uhost hand chan text} {
global mynewtext2
if {[lsearch $::authppl [string tolower $nick]]} {
putserv "PRIVMSG $chan :$nick $mynewtext2"
} else { putserv "PRIVMSG $chan :$nick is not authorized to use this" }
}
Thanks i'll try it
Fire-Fox
Master
Posts: 299 Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null
Post
by Fire-Fox » Thu Nov 22, 2007 5:24 pm
Fire-Fox wrote: CrazyCat wrote: I guess you want to have a fixed list of allowed pple and match independantly of their status on the chan:
Code: Select all
set chans "#chan"
set authppl {"fido" "noob"}
set nynewtext2 "some text"
proc pub_staff {nick uhost hand chan text} {
global mynewtext2
if {[lsearch $::authppl [string tolower $nick]]} {
putserv "PRIVMSG $chan :$nick $mynewtext2"
} else { putserv "PRIVMSG $chan :$nick is not authorized to use this" }
}
Thanks i'll try it
set authppl {"name"}
set mynewtext6 "access"
proc pub_admin {nick uhost and chan text} {
global mynewtext6
if {[lsearch [string tolower $::authppl] [string tolower $nick]]} {
putserv "PRIVMSG $chan :$nick $mynewtext6"
} else {
putserv "PRIVMSG $chan :$nick is not authorized to use this"
}
}
This does not work all can access the command... even with the set authppl is filled
rosc2112
Revered One
Posts: 1454 Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania
Post
by rosc2112 » Thu Nov 22, 2007 10:01 pm
if {[lsearch $::authppl [string tolower $nick]]} {
is not the same as
{[lsearch [string tolower $::authppl] [string tolower $nick]]}
because you converted a LIST into a STRING and lsearch only works with lists.
Fire-Fox
Master
Posts: 299 Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null
Post
by Fire-Fox » Tue Nov 27, 2007 5:39 pm
rosc2112 wrote: if {[lsearch $::authppl [string tolower $nick]]} {
is not the same as
{[lsearch [string tolower $::authppl] [string tolower $nick]]}
because you converted a LIST into a STRING and lsearch only works with lists.
How can i make it right ...
Online
CrazyCat
Revered One
Posts: 1359 Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:
Post
by CrazyCat » Tue Nov 27, 2007 5:45 pm
Just put lowercase entries in you list: YOU manage it, so YOU can choose if it muste be lowercase or case sensitive.
Fire-Fox
Master
Posts: 299 Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null
Post
by Fire-Fox » Tue Nov 27, 2007 7:22 pm
CrazyCat wrote: Just put lowercase entries in you list: YOU manage it, so YOU can choose if it muste be lowercase or case sensitive.
Im n00b to the tcl world so please help to write the script
Alchera
Revered One
Posts: 3344 Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:
Post
by Alchera » Tue Nov 27, 2007 8:22 pm
Fire-Fox wrote: CrazyCat wrote: Just put lowercase entries in you list: YOU manage it, so YOU can choose if it muste be lowercase or case sensitive.
Im n00b to the tcl world so please help to write the script
Then become "un-n00b" and at least make some effort on your own behalf; these forums are full of hints/tips (apart from what you have been told already).
Add [SOLVED] to the thread title if your issue has been.
Search |
FAQ |
RTM
rosc2112
Revered One
Posts: 1454 Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania
Post
by rosc2112 » Tue Nov 27, 2007 10:06 pm
Seriously, you've been here over a year. I learned tcl in 2 months. It's really not that hard.
Online
CrazyCat
Revered One
Posts: 1359 Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:
Post
by CrazyCat » Wed Nov 28, 2007 4:00 am
Fire-Fox wrote: Im n00b to the tcl world so please help to write the script
Just use the code I gave you and fill authppl with lowercase nicks.
It's not a tcl problem, it's simply logical.
Fire-Fox
Master
Posts: 299 Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null
Post
by Fire-Fox » Wed Nov 28, 2007 3:05 pm
CrazyCat wrote: Fire-Fox wrote: Im n00b to the tcl world so please help to write the script
Just use the code I gave you and fill authppl with lowercase nicks.
It's not a tcl problem, it's simply logical.
Hey okay i'll try
Lowercase = text with no big chars ?
Uppercase = LIKE THIS