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 

Welcome TCL for users

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


Joined: 27 May 2017
Posts: 4

PostPosted: Sat May 27, 2017 4:28 pm    Post subject: Welcome TCL for users Reply with quote

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
View user's profile Send private message
willyw
Owner


Joined: 15 Jan 2009
Posts: 925

PostPosted: Sat May 27, 2017 6:32 pm    Post subject: Re: Welcome TCL for users Reply with quote

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
View user's profile Send private message
alphax
Voice


Joined: 27 May 2017
Posts: 4

PostPosted: Sun May 28, 2017 12:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
willyw
Owner


Joined: 15 Jan 2009
Posts: 925

PostPosted: Sun May 28, 2017 1:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
alphax
Voice


Joined: 27 May 2017
Posts: 4

PostPosted: Sun May 28, 2017 1:54 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
willyw
Owner


Joined: 15 Jan 2009
Posts: 925

PostPosted: Sun May 28, 2017 2:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
alphax
Voice


Joined: 27 May 2017
Posts: 4

PostPosted: Sun May 28, 2017 3:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
willyw
Owner


Joined: 15 Jan 2009
Posts: 925

PostPosted: Sun May 28, 2017 3:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
caesar
Ass Kicker


Joined: 14 Oct 2001
Posts: 3403
Location: Area 51

PostPosted: Mon May 29, 2017 2:07 am    Post subject: Reply with quote

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.
_________________
You may say anything about me, but don't misspell my name.


Last edited by caesar on Mon May 29, 2017 11:46 am; edited 1 time in total
Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 204

PostPosted: Mon May 29, 2017 10:39 am    Post subject: Reply with quote

the : namepsace eval welcome {


should probably be :

namespace eval welcome {
Back to top
View user's profile Send private message
caesar
Ass Kicker


Joined: 14 Oct 2001
Posts: 3403
Location: Area 51

PostPosted: Mon May 29, 2017 11:45 am    Post subject: Reply with quote

Heh. Lil typo. Thanks simo. Razz
_________________
You may say anything about me, but don't misspell my name.
Back to top
View user's profile Send private message
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