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.

need a little help with a script plz

Old posts that have not been replied to for several years.
Locked
S
SnOoPDoGg187

Post by SnOoPDoGg187 »

bind pub $trigbind $trigger1 text-1
proc text-1 {n u h c a} {
global channelone channeltwo channelthree channelfour channelfive text2
if {$c == $channelone || $c == $channeltwo || $c == $channelthree || $c == $channelfour || $c == $channelfive} {
puthelp "PRIVMSG $c :$text1"
}
return 0
}

this is to display the rules of the room and this msgs the channel what ever is in $text1 but what i need it to do is do a notice to the nick with whatever is in $text1

$trigbind is the flags the person has to have to use it.. and $trigger1 is the
trigger that activates it..

thanks
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

PRIVMSG is the IRC command to send a message to a channel or a nickname.

The NOTICE command the one you want.
S
SnOoPDoGg187

Post by SnOoPDoGg187 »

i've tried putserv "NOTICE $nick :$text1" and also puthelp "NOTICE $nick :$text1" and it gives me this error on both of them..

Tcl error [text-2]: can't read "nick": no such variable

thanks

i'm new to tcl scripting if ya can't tell lol
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Note your use of $nick

in the line
proc test-1 {n h u c a} {
you have specified (rather the scripts designer) that n is the nickname (ead tcl-commands.doc for this information)

So in your script, you should use $n instead of $nick. Hence, the error "nick does not exist."
User avatar
slennox
Owner
Posts: 593
Joined: Sat Sep 22, 2001 8:00 pm
Contact:

Post by slennox »

proc text-1 {n u h c a} {

It looks like you want $n rather than $nick
Locked