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.

onjoin script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
C
Cr0ntab
Voice
Posts: 22
Joined: Fri Mar 26, 2010 11:31 am

onjoin script

Post by Cr0ntab »

hello i would like help with a rather easy(i think) tcl
i would like my eggdrop to send a notice on #channel2 if a user joins #channel1 and his nickname is NOT on a list that is in the tcl.
for example if this is the list in the tcl
{
nick1
nick2
nick3
}
and user nick4 joins #channel1 the bot will send a notice on #channel2
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Give this a try:

Code: Select all

set list_of_nicks [list \
  nick1 \
  nick2 \
  nick3 \
]

bind join - "#channel1 *" check_join
proc check_join {nickname host handle channel} {
  if {[lsearch -exact $::list_of_nicks $nickname] < 0} {
    puthelp "NOTICE #channel2 :$nickname joined #channel1"
  }
}
Edit:
Added missing ".
Last edited by nml375 on Mon Mar 29, 2010 1:45 pm, edited 1 time in total.
NML_375
C
Cr0ntab
Voice
Posts: 22
Joined: Fri Mar 26, 2010 11:31 am

modification.

Post by Cr0ntab »

well actually the bot crushed when i rehashed.i had to change [
nick1 \
nick2 \
]
with {
"nick1"
"nick2"
}
but it does not work.the notice is not beeing send to #channel2
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

It would seem you forgot/removed the list command?

Do you get any error messages on the partyline or in your logs? Also, please use the ".binds join" partyline command, and post the results here..
NML_375
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

hi,

what nml375 forgot to mention is that with the code he posted the nicks from the 'list_of_nicks' variable is case sensitive, meaning that Nick is not equal with nick, nIck, and so on.
Once the game is over, the king and the pawn go back in the same box.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Caesar,
case-sensitivity is correct, yet that would only cause notices to be sent when an otherwize identified nickname joined the channel. Currently reported problem is that no notice is sent at all.

Now that I look a little closer, there is one " misssing, updating the code in a sec or two..
NML_375
C
Cr0ntab
Voice
Posts: 22
Joined: Fri Mar 26, 2010 11:31 am

Post by Cr0ntab »

let me show u how i have made it nml375 and u can see why i dont get the notice:

Code: Select all

set list_of_nicks {
"Crontab"
"murder-"
"Diana"
} 

bind join - "#MIB *" check_join 
proc check_join {nickname host handle channel} { 
  if {[lsearch -exact $::list_of_nicks $nickname] < 0} { 
    puthelp "NOTICE #rfc1459 :$nickname has joined #MIB.Please Take A Look!
  } 
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

crontab,
The error is most likely the missing " that I mentioned in my previous post. To be more specific, it should be added to the end of the 'puthelp "NOTICE ...' line.
NML_375
Post Reply