View previous topic :: View next topic |
Author |
Message |
stevegarbz Op
Joined: 04 Dec 2004 Posts: 104
|
Posted: Sun Oct 09, 2005 4:29 pm Post subject: Help making this script relay |
|
|
I currently have this script:
Code: | 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. |
|
Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Sun Oct 09, 2005 4:52 pm Post subject: |
|
|
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: | 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: | putquick "NOTICE $nick :[subst $msgline]"
to
putquick "PRIVMSG $chan :[subst $msgline]"
|
Enjoy!!! _________________ r0t3n @ #r0t3n @ Quakenet |
|
Back to top |
|
 |
stevegarbz Op
Joined: 04 Dec 2004 Posts: 104
|
Posted: Mon Oct 10, 2005 6:42 pm Post subject: |
|
|
Thanks for the effort but
[15:43] Tcl error [join_onjoin]: can't read "relaychan": no such variable |
|
Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Oct 11, 2005 3:44 am Post subject: |
|
|
Change
Code: | global onjoin_msg onjoin_chans botnick |
to
Code: | global onjoin_msg onjoin_chans botnick relaychan |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
Back to top |
|
 |
|