| View previous topic :: View next topic |
| Author |
Message |
Fire-Fox Master

Joined: 23 Sep 2006 Posts: 270 Location: /dev/null
|
Posted: Tue Nov 20, 2007 6:47 pm Post subject: text to specific names |
|
|
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: | ########################
### 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 ###
###################### |
_________________ GreatZ
Fire-Fox | Denmark
Scripts: Relay | Store Text | TvMaze |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
|
| Back to top |
|
 |
Fire-Fox Master

Joined: 23 Sep 2006 Posts: 270 Location: /dev/null
|
Posted: Wed Nov 21, 2007 8:41 am Post subject: |
|
|
Thanks for the help. But now im noob to tcl how whot i implement it  _________________ GreatZ
Fire-Fox | Denmark
Scripts: Relay | Store Text | TvMaze |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Nov 22, 2007 7:43 am Post subject: Re: text to specific names |
|
|
| 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: | ########################
### 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. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Thu Nov 22, 2007 7:49 am Post subject: Re: text to specific names |
|
|
I guess you want to have a fixed list of allowed pple and match independantly of their status on the chan:
| Code: |
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" }
} |
_________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
Fire-Fox Master

Joined: 23 Sep 2006 Posts: 270 Location: /dev/null
|
Posted: Thu Nov 22, 2007 4:35 pm Post subject: Re: text to specific names |
|
|
| CrazyCat wrote: | I guess you want to have a fixed list of allowed pple and match independantly of their status on the chan:
| Code: |
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  _________________ GreatZ
Fire-Fox | Denmark
Scripts: Relay | Store Text | TvMaze |
|
| Back to top |
|
 |
Fire-Fox Master

Joined: 23 Sep 2006 Posts: 270 Location: /dev/null
|
Posted: Thu Nov 22, 2007 5:24 pm Post subject: Re: text to specific names |
|
|
| 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: |
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  |
| Quote: | 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 _________________ GreatZ
Fire-Fox | Denmark
Scripts: Relay | Store Text | TvMaze |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Thu Nov 22, 2007 10:01 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Fire-Fox Master

Joined: 23 Sep 2006 Posts: 270 Location: /dev/null
|
Posted: Tue Nov 27, 2007 5:39 pm Post subject: |
|
|
| 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 ...  _________________ GreatZ
Fire-Fox | Denmark
Scripts: Relay | Store Text | TvMaze |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Tue Nov 27, 2007 5:45 pm Post subject: |
|
|
Just put lowercase entries in you list: YOU manage it, so YOU can choose if it muste be lowercase or case sensitive. _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
Fire-Fox Master

Joined: 23 Sep 2006 Posts: 270 Location: /dev/null
|
Posted: Tue Nov 27, 2007 7:22 pm Post subject: |
|
|
| 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 _________________ GreatZ
Fire-Fox | Denmark
Scripts: Relay | Store Text | TvMaze |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Tue Nov 27, 2007 8:22 pm Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Tue Nov 27, 2007 10:06 pm Post subject: |
|
|
| Seriously, you've been here over a year. I learned tcl in 2 months. It's really not that hard. |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Wed Nov 28, 2007 4:00 am Post subject: |
|
|
| 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. _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
Fire-Fox Master

Joined: 23 Sep 2006 Posts: 270 Location: /dev/null
|
Posted: Wed Nov 28, 2007 3:05 pm Post subject: |
|
|
| 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 _________________ GreatZ
Fire-Fox | Denmark
Scripts: Relay | Store Text | TvMaze |
|
| Back to top |
|
 |
|