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.

partyline script

Old posts that have not been replied to for several years.
Locked
b
bobjuh
Master
Posts: 268
Joined: Wed Oct 03, 2001 8:00 pm
Location: Netherlands
Contact:

partyline script

Post by bobjuh »

I have This tcl script but here is a problem.

when there are Let's say 2 users in the bot 1 user a with global owner flags and the second user, user b with global master flags.
When a user joins the partyline you get

"1 owners, 2 masters, 2 ops and 0 bots [ 2 users ]"

I want it to say that there's 1 owner and 1 master.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Make it check all the flags in descending order for each user only once...

Code: Select all

foreach user [userlist] {
  if {[matchattr $user n]} {
    incr n
  } elseif {[matchattr $user m]} {

  } etc...
}
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

user wrote:Make it check all the flags in descending order for each user only once...

Code: Select all

foreach user [userlist] {
  if {[matchattr $user n]} {
    incr n
  } elseif {[matchattr $user m]} {

  } etc...
}
And add "continue" statements, so that once a match is found the iteration jumps to the next user.
b
bobjuh
Master
Posts: 268
Joined: Wed Oct 03, 2001 8:00 pm
Location: Netherlands
Contact:

Post by bobjuh »

Tnx it worked :)
Last edited by bobjuh on Tue Jul 01, 2003 11:06 am, edited 2 times in total.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

egghead wrote:And add "continue" statements, so that once a match is found the iteration jumps to the next user.
No need for that...tcl will do no more work in the if structure after one statement is true.
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

user wrote:
egghead wrote:And add "continue" statements, so that once a match is found the iteration jumps to the next user.
No need for that...tcl will do no more work in the if structure after one statement is true.
You are right! A mistake I made before on this forum. Prolly because of my dislikes of "elseif" structures :)
b
bobjuh
Master
Posts: 268
Joined: Wed Oct 03, 2001 8:00 pm
Location: Netherlands
Contact:

Post by bobjuh »

Oke got that working now and also other part of the script.
Now the next thing.

I scripted that when a perm owner joins it will broadcast
*** (Chef, Botmaintainer) BoBjUh is online
(with normal owner it will only say Botmaintainer)

Bot is there now any way th get rid of the message
*** BoBjUh joined the party line.
Locked