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 

Help making this script relay

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
stevegarbz
Op


Joined: 04 Dec 2004
Posts: 104

PostPosted: Sun Oct 09, 2005 4:29 pm    Post subject: Help making this script relay Reply with quote

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


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Sun Oct 09, 2005 4:52 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
stevegarbz
Op


Joined: 04 Dec 2004
Posts: 104

PostPosted: Mon Oct 10, 2005 6:42 pm    Post subject: Reply with quote

Thanks for the effort but

[15:43] Tcl error [join_onjoin]: can't read "relaychan": no such variable
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Oct 11, 2005 3:44 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive 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