egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

text to specific names

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Fire-Fox
Master


Joined: 23 Sep 2006
Posts: 270
Location: /dev/null

PostPosted: Tue Nov 20, 2007 6:47 pm    Post subject: text to specific names Reply with quote

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
View user's profile Send private message MSN Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Tue Nov 20, 2007 6:59 pm    Post subject: Reply with quote

Create a list. Wink

See this post for inspiration: http://forum.egghelp.org/viewtopic.php?t=14185&highlight=lists
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Fire-Fox
Master


Joined: 23 Sep 2006
Posts: 270
Location: /dev/null

PostPosted: Wed Nov 21, 2007 8:41 am    Post subject: Reply with quote

Alchera wrote:
Create a list. Wink

See this post for inspiration: http://forum.egghelp.org/viewtopic.php?t=14185&highlight=lists


Thanks for the help. But now im noob to tcl how whot i implement it Smile
_________________
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
Back to top
View user's profile Send private message MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Nov 22, 2007 7:43 am    Post subject: Re: text to specific names Reply with quote

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
View user's profile Send private message Visit poster's website
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Thu Nov 22, 2007 7:49 am    Post subject: Re: text to specific names Reply with quote

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
View user's profile Send private message Visit poster's website
Fire-Fox
Master


Joined: 23 Sep 2006
Posts: 270
Location: /dev/null

PostPosted: Thu Nov 22, 2007 4:35 pm    Post subject: Re: text to specific names Reply with quote

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 Smile
_________________
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
Back to top
View user's profile Send private message MSN Messenger
Fire-Fox
Master


Joined: 23 Sep 2006
Posts: 270
Location: /dev/null

PostPosted: Thu Nov 22, 2007 5:24 pm    Post subject: Re: text to specific names Reply with quote

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 Smile


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
View user's profile Send private message MSN Messenger
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Thu Nov 22, 2007 10:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
Fire-Fox
Master


Joined: 23 Sep 2006
Posts: 270
Location: /dev/null

PostPosted: Tue Nov 27, 2007 5:39 pm    Post subject: Reply with quote

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 ... Smile
_________________
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
Back to top
View user's profile Send private message MSN Messenger
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Tue Nov 27, 2007 5:45 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Fire-Fox
Master


Joined: 23 Sep 2006
Posts: 270
Location: /dev/null

PostPosted: Tue Nov 27, 2007 7:22 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Tue Nov 27, 2007 8:22 pm    Post subject: Reply with quote

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). Wink
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Tue Nov 27, 2007 10:06 pm    Post subject: Reply with quote

Seriously, you've been here over a year. I learned tcl in 2 months. It's really not that hard.
Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Wed Nov 28, 2007 4:00 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Fire-Fox
Master


Joined: 23 Sep 2006
Posts: 270
Location: /dev/null

PostPosted: Wed Nov 28, 2007 3:05 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber