| View previous topic :: View next topic |
| Author |
Message |
alphax Voice
Joined: 27 May 2017 Posts: 4
|
Posted: Sat May 27, 2017 4:28 pm Post subject: Welcome TCL for users |
|
|
Hey there,
i have trouble with that code. That code notification for all. But i want to notification for just users not ops.
So when op joins help channel no notification. i want to notification for just users. and dont notification for oper and admins.
i need a little help. Ty.
| Code: | bind join - * channel:welcome
proc kanal:welcome {nick uhost handle chan} {
global botnick
if {$nick == $botnick} { return 0 }
if {[string match -nocase "#helpchannel" $chan]} {
putquick "PRIVMSG #opchannel :# $nick wait in#helpchannel"
putquick "PRIVMSG $nick :Please wait you will be get help soon."
}
|
|
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sat May 27, 2017 6:32 pm Post subject: Re: Welcome TCL for users |
|
|
First :
| Code: |
bind join - * channel:welcome
proc kanal:welcome {nick uhost handle chan} {
...
|
The proc called by the bind join is not the proc shown here.
Perhaps it is just some sort of typo... ?
Next:
I'm thinking that you might want to cut this line:
| Code: |
putquick "PRIVMSG $nick :Please wait you will be get help soon."
|
and put it in a separate proc.
Then, you can call that proc, after a delay - using utimer .
This idea is to give time for Chanserv to op.
Then, in this proc, check to see if the user is op'd.
If op'd, just quit. If not, then do the announcement.
Go here:
http://docs.eggheads.org/mainDocs/tcl-commands.html
and text search for
utimer
and
isop
and read about them, and how to use them.
I hope this helps.
Perhaps someone else will be along with a different idea, too. _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
| Back to top |
|
 |
alphax Voice
Joined: 27 May 2017 Posts: 4
|
Posted: Sun May 28, 2017 12:46 pm Post subject: |
|
|
Hey there,
First of all thank you for your answer. Everything is okay now. But there is a one little problem. it see other channel to i want it just for help channel. Can you help me to solve that? By the way i tried .chanset command but there is no solution. Thank you.
| Code: | bind join -|- * new_join
setudef flag join
set receiver "#Op"
set exemptchan "#Help"
proc new_join {nick uhost handle chan} {
global receiver exemptchan
if {![channel get $chan join] && ![botisop $chan]} {return 0}
utimer 1 [list check:after $nick $chan ]
}
proc check:after {nick chan} {
global receiver exemptchan
if {![isop $nick $chan] && ![string equal -nocase $exemptchan $chan]} {
putserv "PRIVMSG @$receiver :WARNING: $nick waits for help."
}
} |
|
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sun May 28, 2017 1:20 pm Post subject: |
|
|
See that
setudef
command and then in the proc, see the
channel get
command? It is looking at the value of that User defined channel flag created by the setudef command.
In partyline, do:
.chaninfo #channelname
and see the section: User defined channel flags:
You should see one named: join
If it is -join , then this line in the script:
| Code: |
if {![channel get $chan join] && ![botisop $chan]} {return 0}
|
will cause it to quit right there.
If you want it to be "on" in some channel, then you do:
.chanset #channelname +join
to change its value.
Simply check it again, with another .chaninfo #channelname to be sure.
Then test your script again. _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
| Back to top |
|
 |
alphax Voice
Joined: 27 May 2017 Posts: 4
|
Posted: Sun May 28, 2017 1:54 pm Post subject: |
|
|
Thank you for your reply. I tried what you said to me. But it does not work.
I look with .chaninfo command it is -join but it still give notification. i changed several times for be sure. it is the same
.chanset #channel -join does not work.
<X-Bot> -noidle -antividle -antididle -join
I ask your help one more time  |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sun May 28, 2017 2:13 pm Post subject: |
|
|
| alphax wrote: |
...
I look with .chaninfo command it is -join but it still give notification.
...
|
See this line:
| Code: |
if {![channel get $chan join] && ![botisop $chan]} {return 0}
|
and experiment with and without the ! for botisop command.
I don't know which way you really want it.
I tested it, and it works for me.
I hope this helps.
Edit:
This line:
| Code: |
putserv "PRIVMSG @$receiver :WARNING: $nick waits for help."
|
has an @ in it. I did remove that when I tested. _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
| Back to top |
|
 |
alphax Voice
Joined: 27 May 2017 Posts: 4
|
Posted: Sun May 28, 2017 3:43 pm Post subject: |
|
|
| yes sir you are right it works but it notification other channels too. i want notification just for help channel. Bot is in another channels and i do not want to notification from another channels. and when i tried for other channels .chanset #channel -join it keep notification to op channel too |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sun May 28, 2017 3:57 pm Post subject: |
|
|
| alphax wrote: | | yes sir you are right it works but it notification other channels too. i want notification just for help channel. Bot is in another channels and i do not want to notification from another channels. and when i tried for other channels .chanset #channel -join it keep notification to op channel too |
See this line:
| Code: |
bind join -|- * new_join
|
Then see this for reference:
http://www.eggheads.org/support/egghtml/1.6.21/tcl-commands.html
and text search it to find : bind join
Part of what can be learned there is:
| Quote: |
The mask in the bind is matched against "#channel nick!user@host" and can contain wildcards.
|
So if you want to limit this to just one channel, you could edit that bind line so that it only triggers on one channel. However, using .chanset with the User defined channel flag should do it too. _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon May 29, 2017 2:07 am Post subject: |
|
|
| Code: |
namespace eval welcome {
set setup(help) "#helpchannel"
set setup(op) "#opchannel"
bind join - * [namespace current]::joined
proc joined {nick uhost handle chan} {
global setup
if {[isbotnick $nick]} return
if {![string equal -nocase $chan $setup(help)]} return
utimer 3 [list [namespace current]::welcome $chan $nick]
}
proc welcome {chan nick} {
global setup
if {[isop $nick $chan]} return
puthelp "PRIVMSG $setup(op) :$nick wait in $setup(help)"
puthelp "PRIVMSG $nick :Please wait you will be get help soon."
}
}
|
Haven't tested.
Edit: Corrected lil typo. _________________ Once the game is over, the king and the pawn go back in the same box.
Last edited by caesar on Mon May 29, 2017 11:46 am; edited 1 time in total |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Mon May 29, 2017 10:39 am Post subject: |
|
|
the : namepsace eval welcome {
should probably be :
namespace eval welcome { |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon May 29, 2017 11:45 am Post subject: |
|
|
Heh. Lil typo. Thanks simo.  _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
|