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.

Fun on seperated channels

Old posts that have not been replied to for several years.
Locked
b
boemer

Fun on seperated channels

Post by boemer »

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?
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

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 »

do you have an example or an help, i preffer dutch.
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

How to create a chanflag :

Code: Select all

setudef flag <flagname>
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>
.......
}
}
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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 »

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
  }
 }
}
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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 »

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
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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 »

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
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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 »

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
Locked