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.

Help making this script relay

Old posts that have not been replied to for several years.
Locked
s
stevegarbz
Op
Posts: 104
Joined: Sat Dec 04, 2004 7:25 pm

Help making this script relay

Post by stevegarbz »

I currently have this script:

Code: Select all

set onjoin_msg {
 {
  "Hello $nick, welcome to $chan. This channel is owned by Precision Effect and has moved to #PE or www.PrecisionEffect.com - Please join there for sales/support."
 }
}
set onjoin_chans "#1.6 #6radio #advertize #adz #e-sports #esports #find #hix #radio #ringer #scrim #search #webhosting #webdesign"

bind join - * join_onjoin

putlog "Onjoin.tcl 0.1 by Banned loaded"

proc join_onjoin {nick uhost hand chan} {
 global onjoin_msg onjoin_chans botnick
 if {(([lsearch -exact [string tolower $onjoin_chans] [string tolower $chan]] != -1) || ($onjoin_chans == "*")) && (![matchattr $hand b]) && ($nick != $botnick)} {
  set onjoin_temp [lindex $onjoin_msg [rand [llength $onjoin_msg]]]
  foreach msgline $onjoin_temp {
   putquick "PRIVMSG $chan :[subst $msgline]"
  }
 }
}
Is there anyway that when it sends the message to the certain nick that joined, it can relay something like:

Say the bot was in #PE-Bot and I wanted it to say who it messaged:

On-join message sent to $nick in $chan


Example: The bot is in a channel #esports

Someone joins #esports
Bot messages #esports with the onjoin msg stated

Bot messages #PE-Bot
On-join message sent to $nick in $chan


-Thanks.
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

Why does it message the channel. I would think that notice is alot better, otherwise it will spam the channel with welcome messages. This is better

Code: Select all

set onjoin_msg { 
 { 
  "Hello $nick, welcome to $chan. This channel is owned by Precision Effect and has moved to #PE or www.PrecisionEffect.com - Please join there for sales/support." 
 } 
} 
set onjoin_chans "#1.6 #6radio #advertize #adz #e-sports #esports #find #hix #radio #ringer #scrim #search #webhosting #webdesign" 

set relaychan "#PE-Bot"

bind join - * join_onjoin 

putlog "Onjoin.tcl 0.1 by Banned loaded" 

proc join_onjoin {nick uhost hand chan} { 
 global onjoin_msg onjoin_chans botnick 
 if {(([lsearch -exact [string tolower $onjoin_chans] [string tolower $chan]] != -1) || ($onjoin_chans == "*")) && (![matchattr $hand b]) && ($nick != $botnick)} { 
  set onjoin_temp [lindex $onjoin_msg [rand [llength $onjoin_msg]]] 
  foreach msgline $onjoin_temp { 
   putquick "NOTICE $nick :[subst $msgline]"
   }
  putquick "PRIVMSG $relaychan :On-join message sent to $nick on $chan" 
 } 
} 
That will notice $nick with the welcome message, and message $relaychan with On-join message sent to $nick on $chan

If you dont want it to notice $nick with the welcome message, just change

Code: Select all

putquick "NOTICE $nick :[subst $msgline]" 
to
putquick "PRIVMSG $chan :[subst $msgline]"
Enjoy!!!
r0t3n @ #r0t3n @ Quakenet
s
stevegarbz
Op
Posts: 104
Joined: Sat Dec 04, 2004 7:25 pm

Post by stevegarbz »

Thanks for the effort but

[15:43] Tcl error [join_onjoin]: can't read "relaychan": no such variable
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Change

Code: Select all

global onjoin_msg onjoin_chans botnick
to

Code: Select all

global onjoin_msg onjoin_chans botnick relaychan
Locked