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.

Show in Channels i want?

Old posts that have not been replied to for several years.
Locked
F
FiskerEnDK
Voice
Posts: 17
Joined: Thu Jan 16, 2003 7:18 am

Show in Channels i want?

Post by FiskerEnDK »

i have this script:

# Settings
set channels "#channel1 #channel2"
set trigger(char) "!"

# Binding
bind pub - [string trim $trigger(char)]info pub:info

# Proc
global channels
proc pub:info {nick uhost hand chan text} {
putserv "NOTICE $nick :Information about blabla"
}

its working very fine.. thats ok.. nothere there
but i cant get it to only show on the channels i've write for set channels

why??
F
FiskerEnDK
Voice
Posts: 17
Joined: Thu Jan 16, 2003 7:18 am

Post by FiskerEnDK »

if i add the bot to a new Channel the funktion is still working...
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Because Tcl isn't as inteligent as that.

Apart from setting a variable, for the channel you want it to work in, you have to check if the channel a script is used, is one of those channels.

A variable is jjust a place you can store things in, like results, data, and other bits.

However, just because you put channel names in a variable, it doesn't mean it knows what you want doing with them.
F
FiskerEnDK
Voice
Posts: 17
Joined: Thu Jan 16, 2003 7:18 am

Post by FiskerEnDK »

Ok there fore it dosent work a [censored] using these set channel like almost every TCL scritper use... ?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

I fail to understand anything said in the previous post.

The only word that made sence was the blanked out swear word.
F
FiskerEnDK
Voice
Posts: 17
Joined: Thu Jan 16, 2003 7:18 am

Post by FiskerEnDK »

Nearly Every TCL script have
set chan "#lamer" or somethin like that..

but why is it writed of not useable??
And if i have 2 channels that gonna have 2 deferent Scripts i cant to that then?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Yes, this is true.

Most scripts do have some form of

Code: Select all

set chann "#lamer"
So it only works in that channel.

However, if you look inside the Script more, you will see that there is more to it, than just the "set" command.
F
FiskerEnDK
Voice
Posts: 17
Joined: Thu Jan 16, 2003 7:18 am

Post by FiskerEnDK »

Ok can u then please tell me how to do that with my script?
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Code: Select all

set channels [list #channel1 #channel2]
set trigger(char) "!" 

# Binding 
bind pub - [string trim $trigger(char)]info pub:info 

# Proc 
proc pub:info {nick uhost hand chan text} { 
global channels
if {[lsearch $channels $chan] != -1} {
  putserv "NOTICE $nick :Information about blabla" 
}
} 
now pleeez try to at least make an effort to understand this.. this is a very smple code and it's not hard to understand at all...
also if you don't even understand the set/global command you should really check out some tutorials... suninet is a good place to start
Elen sila lúmenn' omentielvo
Locked