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.
Old posts that have not been replied to for several years.
b
boemer
Post
by boemer » Sat Feb 15, 2003 10:43 pm
How can i make that my fun works on different channels?
now my fun works on every channel my bot joins, how can i make my fun work on the channels i tell him to?
stdragon
Owner
Posts: 959 Joined: Sun Sep 23, 2001 8:00 pm
Contact:
Post
by stdragon » Sun Feb 16, 2003 2:21 am
You could do it with a channel flag (see setudef) and then testing that flag in each proc, OR you could make a list of active channels and check to see if the channel the bind is executing for is in that list.
b
boemer
Post
by boemer » Sun Feb 16, 2003 10:15 am
do you have an example or an help, i preffer dutch.
GodOfSuicide
Master
Posts: 463 Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria
Post
by GodOfSuicide » Sun Feb 16, 2003 10:55 am
How to create a chanflag :
How to do something for all chans with +flagname :
Code: Select all
foreach chan [channels] {
if {[lsearch -exact [channel info $chan] +<flagname>] != -1} {
.......
(do this for all channels with +<flagname>
.......
}
}
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Sun Feb 16, 2003 11:37 am
And what do you sugest for a integer (int)?
Once the game is over, the king and the pawn go back in the same box.
b
boemer
Post
by boemer » Sun Feb 16, 2003 12:28 pm
so it becomes somethin like this:
Code: Select all
bind pub - !3kisses pub_!3kisses
proc pub_!3kusjes {nick uhost hand chan arg} {
foreach chan [channels] {
if {[lsearch -exact [channel info $chan] +<flagname>] != -1} {
set who [lindex $arg 0]
if {$who == ""} {
notice $nick "Use: !3kisses <nick>"
return 0
}
putchan "$chan" "$nick gives $arg 3 sweet kisses, ooh isn't that sweet !"
return 0
}
}
}
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Sun Feb 16, 2003 1:37 pm
No, just like this:
Code: Select all
bind pub - !3kisses pub_!3kisses
proc pub_!3kusjes {nick uhost hand chan arg} {
if {[lsearch -exact [channel info $chan] -flagname] != -1} { return }
set who [lindex $arg 0]
if {$who == ""} {
notice $nick "Use: !3kisses <nick>"
return }
putchan "$chan" "$nick gives $arg 3 sweet kisses, ooh isn't that sweet!"
return }
Once the game is over, the king and the pawn go back in the same box.
b
boemer
Post
by boemer » Sun Feb 16, 2003 1:55 pm
dan i always get:
Error trying to set +fun for #bots-zone, invalid mode.
and in the beginning of my fun is putted:
setudef flag fun
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Sun Feb 16, 2003 4:37 pm
Then you have made an error somewhere. Have you loaded the file with the 'setudef flag fun'?
Once the game is over, the king and the pawn go back in the same box.
b
boemer
Post
by boemer » Sun Feb 16, 2003 6:20 pm
this is how my tcl looks like
Code: Select all
setudef flag fun
bind pub - !3kisses pub_!3kisses
proc pub_!3kusjes {nick uhost hand chan arg} {
if {[lsearch -exact [channel info $chan] -flagname] != -1} { return }
set who [lindex $arg 0]
if {$who == ""} {
notice $nick "Use: !3kisses <nick>"
return }
putchan "$chan" "$nick gives $arg 3 sweet kisses, ooh isn't that sweet!"
return }
what is wrong?
lots of greets boemer
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Mon Feb 17, 2003 2:28 am
Replace
Code: Select all
if {[lsearch -exact [channel info $chan] -flagname] != -1} { return }
with
Code: Select all
if {[lsearch -exact [channel info $chan] -fun] != -1} { return }
Also, the correct usage to change the flag for a channel is: '.chanset #channel +fun'. Probably you have typed it wrong or something..
Once the game is over, the king and the pawn go back in the same box.
b
boemer
Post
by boemer » Mon Feb 17, 2003 7:02 pm
WOEHOEEEEEEE it works, thx guys.
Made a stupid mistake,
btw sorry for my poor english but i'm working on it in school
thanks to everyone