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.

binding a join

Old posts that have not been replied to for several years.
Locked
J
Jens2410

binding a join

Post by Jens2410 »

hi,

I am trying tomake a script, which invites everyone who joins a channel, into a certain other channel.
Here is the script that that unforunately doesen't work:

bind join - "#skylords-intern *" metainvite

proc metainvite {nick host hand chan} {
if ($chan == "#skylords-intern"){
puthelp "PRIVMSG $chan : /invite $nick #colossus"
return 0
}
return 0

Could you please help me?

Thank You :wink:
d
dollar
Op
Posts: 178
Joined: Tue Oct 28, 2003 3:47 pm
Location: Netherlands

Post by dollar »

Wait a sec, take a look at you're script, you're sending a PRIVATE MSG to a channel, which contains the text "/invite blah". Try 'putserv "INVITE $nick #colossus"' instead...
dollar (or something similar) at:
#eggdrop / #tcl - undernet
#egghelp / #tcl / #eggtcl - efnet
#eggdrop.support / #tcl - quakenet
#eggdrop - ircnet
J
Jens2410

Post by Jens2410 »

Hmmm....
I have changed that in my script.
But the Eggdrop still displays the following Error-Message:

Tcl error [metainvite]: wrong # args: extra words after "else" clause in "if" command

The script now looks like this:

bind join - "#skylords-intern *" metainvite

proc metainvite {nick host hand chan} {
if ($chan == "#skylords-intern" ) {
putserv "INVITE $nick #colossus"
return 0
}
else {return 0}
}

Thanks for your help in advance!
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

Code: Select all

if {condition} {
    do_sth
} else {
    do_sth
}
note the {} at the condition and that the "else" has to be in the same line as the closing } of the "if"
aVote page back online!
Check out the most popular voting script for eggdrop bots.

Join the metal tavern!
J
Jens2410

Post by Jens2410 »

the script now looks like this, but there is no change in the error Message
:(

bind join - " #skylords-intern * " metainvite

proc metainvite {nick host hand chan args} {
if ($chan == "#skylords-intern" ) {
putserv "INVITE $nick #colossus"
return 0
} else {
return 0 }
}
Last edited by Jens2410 on Wed Feb 11, 2004 1:21 pm, edited 1 time in total.
User avatar
TALES
Halfop
Posts: 59
Joined: Sun Nov 09, 2003 8:45 am
Location: Netherlands
Contact:

Post by TALES »

Just like the man saids:

Code: Select all

proc metainvite {nick host hand chan} { 
 if ($chan == "#skylords-intern") { 
 putserv "INVITE $nick #colossus" 
 return 0 
 } else {
   return 0
  } 
}
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

instead of:

Code: Select all

if ($chan == "#skylords-intern") 
better use:

Code: Select all

if {[string equal -nocase $chan "#skylords-intern"]} {
Once the game is over, the king and the pawn go back in the same box.
J
Jens2410

Post by Jens2410 »

Thank You verry much! It now works! :D
Locked