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 for script

Help for those learning Tcl or writing their own scripts.
Post Reply
a
alisetan
Voice
Posts: 36
Joined: Sun May 21, 2006 3:05 pm

help for script

Post by alisetan »

Code: Select all

# Public command trigger
set tr "!"
set cc "!"

# Channels you _dont_ want the bot to reply to public triggers on (seperate with spaces):
set nopub "#q3f"

bind pub -|- ${tr}dj dj
bind pub -|- ${tr}request req

proc dj {nick host hand chan arg} {
 	global url pathqstat cc nopub dj
        if ($nick == $dj) { set $dj None }
	if {[lsearch -exact $nopub [string tolower $chan]] >= 0} {return 0}
	if {$arg == ""} {
	putserv "notice $nick :Usage: ${cc}dj <Exact Nickname>"
return 0
}
set dj "$arg"
putserv "NOTICE $chan :DJ set to $dj"
}
proc req {nick host hand chan arg} {
	global url pathqstat cc nopub dj
        if ($dj == None) 
        putserv "NOTICE $nick $nick No DJ Online!"
	if {[lsearch -exact $nopub [string tolower $chan]] >= 0} {return 0}
	if {$arg == ""} {
	putserv "notice $nick :Usage: ${cc}request <^BExact Songname^B>"
return 0
}
set songname "$arg"
putserv "PRIVMSG $dj :$nick requested $songname" from [ $nick ] [  chan ] 
putserv "NOTICE $nick :You have request $songname. Please do not re-request this."
}
what error for this.. blurr.. anyone can help
User avatar
krimson
Halfop
Posts: 86
Joined: Wed Apr 19, 2006 8:12 am

Post by krimson »

please post your code between

Code: Select all

 if you wish to get any help here

if you'd also post what error you recieve it would be much easier to debug
a
alisetan
Voice
Posts: 36
Joined: Sun May 21, 2006 3:05 pm

Re: help for script

Post by alisetan »

alisetan wrote:# Public command trigger
set tr "!"
set cc "!"

# Channels you _dont_ want the bot to reply to public triggers on (seperate with spaces):
set nopub "#q3f"

bind pub -|- ${tr}dj dj
bind pub -|- ${tr}request req

proc dj {nick host hand chan arg} {
global url pathqstat cc nopub dj
if ($nick == $dj) { set $dj None }
if {[lsearch -exact $nopub [string tolower $chan]] >= 0} {return 0}
if {$arg == ""} {
putserv "notice $nick :Usage: ${cc}dj <Exact Nickname>"
return 0
}
set dj "$arg"
putserv "NOTICE $chan :DJ set to $dj"
}
proc req {nick host hand chan arg} {
global url pathqstat cc nopub dj
if ($dj == None)
putserv "NOTICE $nick $nick No DJ Online!"
if {[lsearch -exact $nopub [string tolower $chan]] >= 0} {return 0}
if {$arg == ""} {
putserv "notice $nick :Usage: ${cc}request <^BExact Songname^B>"
return 0
}
set songname "$arg"
putserv "PRIVMSG $dj :$nick requested $songname" from [ $nick ] [ chan ]
putserv "NOTICE $nick :You have request $songname. Please do not re-request this."
}


what error for this.. blurr.. anyone can help

when i type !dj nick

[19:52] Tcl error [dj]: can't read "dj": no such variable <-- this thing happen.. what i want to do is.. when tyep !dj nick it set the dj nick.. when type !dj none.. if somebody type !request the bot notice putserv "NOTICE $nick $nick No DJ Online!" if the dj available.. the request is on
User avatar
krimson
Halfop
Posts: 86
Joined: Wed Apr 19, 2006 8:12 am

Post by krimson »

put this at the top of your script:

Code: Select all

set dj "<dj's nick>"
and replace <dj's nick> with your dj's nick
a
alisetan
Voice
Posts: 36
Joined: Sun May 21, 2006 3:05 pm

Post by alisetan »

krimson wrote:put this at the top of your script:

Code: Select all

set dj "<dj's nick>"
and replace <dj's nick> with your dj's nick
it is manual.. or auto adding nick dj??
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

alisetan wrote:
krimson wrote:put this at the top of your script:

Code: Select all

set dj "<dj's nick>"
and replace <dj's nick> with your dj's nick
it is manual.. or auto adding nick dj??
That snippet is "manual".
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
a
alisetan
Voice
Posts: 36
Joined: Sun May 21, 2006 3:05 pm

Post by alisetan »

krimson wrote:put this at the top of your script:

Code: Select all

set dj "<dj's nick>"
and replace <dj's nick> with your dj's nick

how in this thing i want if !dj none... the bot will notice no dj available

proc req {nick host hand chan arg} {
global url pathqstat cc nopub dj
if {[lsearch -exact $nopub [string tolower $chan]] >= 0} {return 0}
if {$arg == ""} {
putserv "notice $nick :Usage: ${cc}request <^BExact Songname^B>"
return 0
}
Post Reply