Made the afterlogin message about spots left either single or plural based on the tourcount and discovered something I did incorrectly and fixed it. I've started working my way into the 2 players facing each other being removed bugs. I've fixed the brackets around both players bug.
Well tiers with spaces couldn't be done when coyotte implemented it into the beta scripts if that's what you're referring to.
It's the same names as what you see in the tiers menu basically. Since it retrieves the list of tiers.
Just noticed a problem, if people with wrong case win / lose (like Conan changed name to CONAN) it doesn't register.
I've made it so the commands aren't automatically converted into lower case. They will keep their original case and only have lower case applied to them when they are checked. Commands with arguments now have a format of: /[command]-[commandargument[1]]-...[commandargument[n]]. Basically it splits by "-" so that the commandargument[0] contains nothing. So for a 64 man Challenge Cup tournament, you now type: /tour-challenge cup-64 I've also changed the sign-up display, disqualify display and endtour display to include the names of the people who used /tour, /dq and /endtour respectively. For the name in a different case, I haven't done that yet. I think the way it has to be done is to add for loops for all those places where the winner/loser is checked - so that each element(string) gets converted to lower case. Which is pretty annoying. I wish there was an easier way. xd
just create your own indexOf function. By the way I don't know if it's still there, but you use a lot if (x.indexOf(abc) in x). Just use if (x.indexOf(abc) != -1). That's weird otherwise.
It should be possible to change the amount of players before a tour has started to cope with the amount of joins. And maybe it also prevents some special moderators from being at loggerheads and aborting their tours each other.
Could you also make it so the finals enforces disallow spects off? And once you've fixed the case sensitivity problem, i'll work to change the current implementation with yours.
Update: *Went through and changed the indenting to tab key spaces. *Replaced tourcount with a function. *Fixed the 2 player facing each other being removed bugs. *Added tourwinners array *Got rid of tourbattles variable. *Added players through to the next round/players out of the tournament when using /viewround. *Numbered the Matches *Fixed case bug *removed bugs list
I was given Mods in this one server who is using your script and when trying to disqualify a person with a hyphen in front of his name you get this message. I don't know if it is the combination of the two hyphens or what, but thought I should bring this to your attention.
Just to let you know, this tournament script will gradually become a general server script to keep up with demand.
I think you should make 2 scripts if you want to do that, a lot of people will still want to use the tournament one.
Your script is glitchy... Spoiler (22:23:00) ~~Server~~: A Tournament has been started by [Mys] Fang [MPT]! (22:23:00) ~~Server~~: PLAYERS: 10 (22:23:00) ~~Server~~: TYPE: Single Elimination (22:23:00) ~~Server~~: TIER : OverUsed (22:23:00) ~~Server~~: Type /join or !join to enter the tournament! (22:23:00) Gold won against Pride. (22:23:03) -Guile: see? (22:23:04) Luiz.BwSHINY logged in. (22:23:04) ~~Server~~: AsianNight joined the tournament! 9 more spots left! (22:23:06) Luiz.BwSHINY logged out. (22:23:06) ~~Server~~: Inferno joined the tournament! 8 more spots left! (22:23:06) -Guile: works (22:23:06) ~~Server~~: Alice joined the tournament! 7 more spots left! (22:23:09) -AsianNight: Haha (22:23:09) eminem logged in. (22:23:10) ~~Server~~: JarockB joined the tournament! 6 more spots left! (22:23:10) ~~Server~~: Guile joined the tournament! 5 more spots left! (22:23:16) Battle between Gold and Pride started. (22:23:17) Jey fresh logged out. (22:23:18) Luiz.BwSHINY logged in. (22:23:19) [ELITE]Ryan logged in. (22:23:19) Gold forfeited against Pride. (22:23:20) -Mashew18: no no no (22:23:22) ~~Server~~: Gold joined the tournament! 4 more spots left! (22:23:25) ~~Server~~: Pride joined the tournament! 3 more spots left! (22:23:26) Jey fresh logged in. (22:23:27) -[ELITE]Ryan: Hello (22:23:31) Mashew18 changed teams. (22:23:31) Battle between Luiz.BwSHINY and Pride started. (22:23:35) -AsianNight: yo (22:23:37) -Mashew18: hi (22:23:37) ~~Server~~: [ELITE]Ryan joined the tournament! 2 more spots left! (22:23:39) -AsianNight: 3 spots left in tourney (22:23:42) -AsianNight: make that 2 (22:23:42) Battle between Jey fresh and eminem started. (22:23:48) -Alice: goe goee (22:24:00) -[ELITE]Ryan: What's Up (22:24:02) -AsianNight: how can a tourney hav 10 spots.... (22:24:02) Jey fresh forfeited against eminem. (22:24:03) nesan logged in. (22:24:05) -AsianNight: shuld be 8 (22:24:07) ~~Server~~: Mashew18 joined the tournament! 1 more spot left! (22:24:11) Jey fresh logged out. (22:24:12) Anonji forfeited against Batl Skard. (22:24:12) -Mashew18: lol (22:24:14) ~~Server~~: Anonji joined the tournament! 0 more spots left! (22:24:14) ~~Server~~: Round 1 of OverUsed Tournament! (22:24:14) 1. Anonji VS Gold (22:24:14) 2. AsianNight VS Pride (22:24:14) 3. Inferno VS JarockB (22:24:14) 4. Mashew18 VS Guile (22:24:14) 5. Alice VS [ELITE]Ryan (22:24:17) +Anonymous: there's going to be 2 byes (22:24:18) +Anonymous: =/ (22:24:21) +Anonymous: Hey nesan (22:24:24) CJR won against R@zze. (22:24:25) Battle between Alice and [ELITE]Ryan started. (22:24:28) -nesan: Hey (22:24:28) -AsianNight: yea (22:24:31) Anonji changed teams. (22:24:31) -AsianNight: i guess (22:24:33) ~~Server~~: Mashew18 has left the tournament! (22:24:33) ~~Server~~: Guile advances to the next round: (22:24:33) ~~Server~~: Mashew18 is out of the tournament. (22:24:33) ~~Server~~: 4 more matches to be completed in this round! (22:24:33) Mashew18 logged out. (22:24:38) Battle between Anonji and Gold started. (22:24:40) Hersan won against battousai. (22:24:45) -Guile: yay (22:24:51) Battle between JarockB and Inferno started. (22:24:51) -AsianNight: dude my opponent is busy (22:24:52) +Anonymous: lol (22:24:52) -Batl Skard: rofl (22:24:53) josue logged in. (22:24:54) Luiz.BwSHINY forfeited against Pride. (22:24:54) Luiz.BwSHINY logged out. (22:25:01) -Guile: i win (22:25:01) Battle between AsianNight and Pride started. (22:25:05) -Guile: :o (22:25:07) [DL]5P33D5 logged in. (22:25:12) josue logged out. (22:25:13) chris forfeited against pt. (22:25:18) -chris: sorry (22:25:19) [DL]5P33D5 logged out. (22:25:19) Hersan logged out. (22:25:20) +Anonymous: It would be cool if there could be a rond robin (22:25:27) Jey fresh logged in. (22:25:37) Renan MR logged in. (22:25:39) Battle between Jey fresh and eminem started. (22:25:58) Pachy won against Silence. (22:25:58) +Astruvis: akusu was actually scripting that (22:26:03) +Astruvis: but knowing him (22:26:08) +Astruvis: itll be really crappy (22:26:11) +Astruvis: or wont work (22:26:16) +Astruvis: or he will never finnish it (22:26:17) chris changed teams. (22:26:19) pt logged out. (22:26:31) +Astruvis: and he will make it so complicated no one will know how to fix it (22:26:37) +Astruvis: xP (22:26:47) ~~Server~~: Round 1 of OverUsed Tournament! (22:26:47) 1. Anonji VS Gold (22:26:47) 2. AsianNight VS Pride (22:26:47) 3. Inferno VS JarockB (22:26:47) 4. Mashew18 VS (Guile) (22:26:47) 5. Alice VS [ELITE]Ryan (22:26:47) ~~Server~~: Players through to the Next Round (22:26:47) Guile (22:26:47) ~~Server~~: Players out of the Tournament (22:26:47) Mashew18 (22:26:50) ~~Server~~: Completed Matches: (22:26:50) 4. Mashew18 VS (Guile) (22:26:50) ~~Server~~: Ongoing Matches: (22:26:50) 1. Anonji VS Gold (22:26:50) 2. AsianNight VS Pride (22:26:50) 3. Inferno VS JarockB (22:26:50) 5. Alice VS [ELITE]Ryan (22:26:52) Tomateo changed teams. (22:27:06) Lucas Diogo logged in. (22:27:10) King Fetus logged in. (22:27:11) Battle between Lucas Diogo and Renan MR started. (22:27:15) Paul Leykamp logged in. (22:27:24) Gold won against Anonji. (22:27:24) ~~Server~~: A tournament match has been completed! (22:27:24) ~~Server~~: Gold advances to the next round: (22:27:24) ~~Server~~: Anonji is out of the tournament. (22:27:24) ~~Server~~: 3 more matches to be completed in this round! (22:27:28) Battle between R@zze and CJR started. (22:27:30) -battousai: double battles (22:27:34) Batl Skard is idling. (22:27:46) +Anonymous: lol (22:27:54) Alice forfeited against [ELITE]Ryan. (22:27:54) ~~Server~~: A tournament match has been completed! (22:27:54) ~~Server~~: [ELITE]Ryan advances to the next round: (22:27:54) ~~Server~~: Alice is out of the tournament. (22:27:54) ~~Server~~: 2 more matches to be completed in this round! (22:27:56) -Anonji: how do you start a server on this (22:27:56) eminem won against Jey fresh. (22:27:59) -[ELITE]Ryan: xd (22:28:02) ILoveBritt logged in. (22:28:06) Battle between Pachy and Paul Leykamp started. (22:28:13) -Alice: totally failed (22:28:13) Anonji changed teams. (22:28:16) VampOPS logged in. (22:28:17) -[ELITE]Ryan: xd (22:28:21) pt logged in. (22:28:22) Battle between Anonji and Gold started. (22:28:43) ILoveBritt logged out. (22:28:47) Kurai won against ZOMGITSOVER9000. (22:28:57) Battle between Jey fresh and eminem started. (22:29:06) Inferno won against JarockB. (22:29:06) ~~Server~~: A tournament match has been completed! (22:29:06) ~~Server~~: Inferno advances to the next round: (22:29:06) ~~Server~~: JarockB is out of the tournament. (22:29:06) ~~Server~~: 1 more match to be completed in this round! (22:29:09) Alice logged out. (22:29:14) Kurai logged out. (22:29:15) VampOPS logged out. (22:29:19) Kurai logged in. (22:29:25) Battle between Kurai and ZOMGITSOVER9000 started. (22:29:30) -Inferno: inferno advances :) (22:29:36) -[ELITE]Ryan: xd (22:29:49) -[ELITE]Ryan: What hapen with the caps? (22:29:53) Anonji won against Gold. (22:29:56) -[ELITE]Ryan: xd (22:29:56) -[ELITE]Ryan: ? (22:29:59) PokemonKing4Life logged in. (22:30:00) +[Mys] Fang [MPT]: O.o (22:30:02) -Tomateo: uber battle anyone? :) (22:30:04) CJR won against R@zze. (22:30:07) +[Mys] Fang [MPT]: What caps? (22:30:08) +[Mys] Fang [MPT]: Lol (22:30:08) -PokemonKing4Life: beta is down again? (22:30:10) +[Mys] Fang [MPT]: I can use caps fine (22:30:15) -[ELITE]Ryan: xd? (22:30:16) JarockB changed teams. (22:30:17) -[ELITE]Ryan: see (22:30:19) Gold changed teams. (22:30:25) Battle between pt and Tomateo started. (22:30:30) Battle between Gold and Anonji started. (22:30:36) Renan MR won against Lucas Diogo. (22:30:40) Battle between R@zze and chris started. (22:30:45) chris forfeited against R@zze. (22:30:51) Atoli logged in. (22:30:52) PokemonKing4Life changed teams. (22:31:01) +Anonymous: Astruvis added capsmute to the scripts (22:31:07) -nesan: xD (22:31:07) Lucas Diogo logged out. (22:31:11) -[ELITE]Ryan: Oh (22:31:13) AsianNight won against Pride. (22:31:13) ~~Server~~: A tournament match has been completed! (22:31:13) ~~Server~~: AsianNight advances to the next round: (22:31:13) ~~Server~~: Pride is out of the tournament. (22:31:13) ~~Server~~: Round 2 of OverUsed Tournament! (22:31:13) 1. AsianNight VS Gold (22:31:13) 2. Guile VS Inferno (22:31:13) ~~Server~~: [ELITE]Ryan is randomly selected to go through to the next round! (22:31:21) -[ELITE]Ryan: Yay (22:31:22) eminem won against Jey fresh. (22:31:31) Gold forfeited against Anonji. (22:31:31) ~~Server~~: A tournament match has been completed! (22:31:31) ~~Server~~: Anonji advances to the next round: (22:31:31) ~~Server~~: Gold is out of the tournament. (22:31:32) Battle between Guile and Inferno started. (22:31:37) Pachy won against Paul Leykamp. (22:31:43) -Anonji: whoa whoa awesome (22:31:46) Gold logged out. (22:31:49) Jey fresh logged out. (22:31:50) Psi-Psi logged in. (22:31:58) -Anonji: i guess i took gold's spot (22:31:59) -[ELITE]Ryan: :p (22:32:03) chris logged out. (22:32:04) Alyrax logged in. (22:32:19) -AsianNight: wait i dont get it (22:32:21) -AsianNight: who do i vs.? (22:32:24) -Anonji: i dunno (22:32:28) -Anonji: try fighting me or something (22:32:33) -AsianNight: do i just get a free pass to the next round like u? (22:32:35) MetaKirby logged in. (22:32:44) -Anonji: weird (22:32:45) -AsianNight: what the (22:32:48) -AsianNight: just said u're not in the tourney (22:32:51) -AsianNight: O_o (22:32:53) -Anonji: dude, that's weird (22:32:55) Battle between R@zze and Atoli started. (22:32:55) Battle between MetaKirby and eminem started. (22:32:57) -AsianNight: ya (22:33:02) -Anonji: uhhhh (22:33:04) -Anonji: what happens lol (22:33:06) -AsianNight: well then (22:33:06) DRACOFLARE logged in. (22:33:10) -AsianNight: free pass celebration? (22:33:12) -AsianNight: haha (22:33:14) -Anonji: i guess lol (22:33:27) DRACOFLARE logged out. (22:33:29) Paul Leykamp changed teams. (22:33:30) -Anonji: we'll see what happens when guile and inferno finish theirs (22:33:33) Paul Leykamp logged out. (22:33:42) Paul Leykamp logged in. (22:33:43) MetaKirby forfeited against eminem. (22:33:45) ~~Server~~: Round 2 of OverUsed Tournament! (22:33:45) 1. AsianNight VS Gold (22:33:45) 2. Guile VS Inferno (22:33:45) 3. [ELITE]Ryan VS *bye (22:33:45) ~~Server~~: Players through to the Next Round (22:33:45) Anonji (22:33:45) ~~Server~~: Players out of the Tournament (22:33:45) Gold (22:33:58) MetaKirby logged out. (22:34:02) -Anonji: whos organizing the tourney (22:34:04) -Alyrax: Hello? (22:34:06) Alyrax logged out. (22:34:08) ~~Server~~: Completed Matches: (22:34:08) 1. AsianNight VS Gold (22:34:08) ~~Server~~: Ongoing Matches: (22:34:08) 2. Guile VS Inferno (22:34:08) ~~Server~~: Matches Not Started! (22:34:09) Gold logged in. (22:34:10) Kurai won against ZOMGITSOVER9000. (22:34:15) Gold logged out. (22:34:16) +Astruvis: (22:34:08) ~~Server~~: Completed Matches: (22:34:16) +Astruvis: (22:34:08) 1. AsianNight VS Gold (22:34:16) +Astruvis: (22:34:08) ~~Server~~: Ongoing Matches: (22:34:16) +Astruvis: (22:34:08) 2. Guile VS Inferno (22:34:21) Gold logged in. (22:34:23) Tomateo won against pt. (22:34:25) Battle between Kurai and ZOMGITSOVER9000 started. (22:34:28) Gold logged out. (22:34:31) -Anonji: but i took gold's spot (22:34:33) Gold logged in. (22:34:36) -Anonji: because i beat hi (22:34:36) pt logged out. (22:34:37) -Anonji: m (22:34:41) Gold logged out. (22:34:41) kagenaito logged in. (22:34:43) +[Mys] Fang [MPT]: Wtf?Rain can be up for over 10 turns? (22:34:45) -Anonji: so somehow, the thing gave me his spot? (22:34:49) -Anonji: yea fang, damp rock (22:34:51) -[ELITE]Ryan: o_o (22:34:52) kagenaito logged out. (22:34:53) PokemonKing4Life changed teams. (22:34:57) trevor logged in. (22:34:59) -Tomateo: no it was kyogre's (22:35:00) Lucas Diogo logged in. (22:35:03) +[Mys] Fang [MPT]: Oh lol (22:35:04) -Anonji: ohhh. (22:35:04) -trevor: im back guys (22:35:08) -AsianNight: wb (22:35:11) -trevor: thanks (22:35:14) -AsianNight: =) (22:35:16) +[Mys] Fang [MPT]: Damp Rock only gives 8 turns I think (22:35:18) Psi-Psi changed teams. (22:35:19) -Tomateo: damp rock is 8 turns xD (22:35:25) -AsianNight: if it's an ability, it stays until its changed (22:35:28) Atoli won against R@zze. (22:35:30) +[Mys] Fang [MPT]: I know... (22:35:31) -AsianNight: by another ability or a move (22:35:31) Battle between PokemonKing4Life and Psi-Psi started. (22:35:35) -AsianNight: im teling Tomateo (22:35:38) -AsianNight: xd (22:35:41) +[Mys] Fang [MPT]: Lolz he knows too (22:35:43) Battle between R@zze and eminem started. (22:35:46) -Tomateo: yeah i do O_O (22:35:48) +[Mys] Fang [MPT]: xd (22:35:49) Battle between trevor and nesan started. (22:35:49) -AsianNight: o (22:35:51) +[Mys] Fang [MPT]: O.o (22:35:53) -AsianNight: hmmm, i read the conversation wrong (22:35:53) +[Mys] Fang [MPT]: xd* (22:35:54) -Tomateo: =d (22:35:54) -AsianNight: lol fail (22:35:58) Battle between Lucas Diogo and Renan MR started. (22:35:58) +[Mys] Fang [MPT]: Wtf?Caps? (22:36:02) -AsianNight: idk (22:36:03) -AsianNight: sux rite? (22:36:04) Guile won against Inferno. (22:36:04) ~~Server~~: A tournament match has been completed! (22:36:04) ~~Server~~: Guile advances to the next round: (22:36:04) ~~Server~~: Inferno is out of the tournament. (22:36:04) ~~Server~~: Round 3 of OverUsed Tournament! (22:36:04) 1. [ELITE]Ryan VS AsianNight (22:36:04) ~~Server~~: Guile is randomly selected to go through to the next round! (22:36:05) +[Mys] Fang [MPT]: Can't use caps on xd? (22:36:17) -Guile: woot (22:36:20) Battle between AsianNight and [ELITE]Ryan started. (22:36:23) -Anonji: uhhh, it kicked me out? (22:36:24) -Anonji: wtf (22:36:26) -Guile: byes are great (22:36:38) -Tomateo: =D looks dumb without caps haha (22:36:39) -Inferno: :/ (22:36:43) -Tomateo: oh its fine now (22:36:51) +[Mys] Fang [MPT]: It's not even the face without caps =/ (22:36:51) King Fetus changed teams. (22:36:56) King Fetus changed teams. (22:37:11) +[Mys] Fang [MPT]: It looks like he's trying to lick himself (22:37:14) justinm logged in. (22:37:16) +[Mys] Fang [MPT]: wthout caps (22:37:18) +[Mys] Fang [MPT]: without* (22:37:22) -Tomateo: nasty >_> (22:37:26) +Anonymous: lol (22:37:26) +[Mys] Fang [MPT]: It's true... (22:37:36) +Anonymous: Atruvis said he was going to fix that (22:37:37) -Batl Skard: p: (22:37:41) +[Mys] Fang [MPT]: Lol (22:37:46) +[Mys] Fang [MPT]: xd (22:38:03) -Batl Skard: :d You should be able to see what was wrong, it keep the opponent listing from an old round or something.
Hey Lutra. I just wanted to suggest that you code a tournament voting system to help cut down on the spam. Just set it for a minute or two and let people vote, then report the result to the person that started the poll. They could use that to decide, and it would hide the spam that people make and justify less bitching.
so doesn't bitching about the bitching of others, especially when on a diffrent topic than the linked one, just create more spam and bitching????
How does showing your modified script help? If you modified it, it's your script. Unless you have evidence that it happens in my script, it's not my concern. I feel uncomfortable about a tournament voting system - it seems a bit perverse. How would a tournament administrator start the vote? Would they have to set conditions such as number of players or would the voter have to do all of that? Also, if you did a simple vote each time, it's going to work out like a first past the post system. Doing some algorithm for a cumulative voting system just strengthens the waywardness of it. And if Tournament Administrators ignore the vote and do something else, they are going to be subject to criticism.
I copied all the code from yours, but ill do a test with it right now if you want xP Edit: Test complete, happens on yours also using your script without any edits: (00:01:27) +Astruvis: (23:57:15) »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»: (00:01:27) +Astruvis: (23:57:15) *** Round 1 of 4)SubMeta Tournament *** (00:01:27) +Astruvis: (23:57:15) »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»: (00:01:27) +Astruvis: (23:57:15) 1. Astruvis VS Astruvis4 (00:01:27) +Astruvis: (23:57:15) 2. Astruvis3 VS Astruvisx (00:01:27) +Astruvis: (23:57:15) »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»: (00:01:40) +Astruvis: (23:57:39) Astruvisx forfeited against Astruvis3. (00:01:40) +Astruvis: (23:57:39) »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»: (00:01:40) +Astruvis: (23:57:39) *** A tournament match has been completed! (00:01:40) +Astruvis: (23:57:39) Astruvis3 advances to the next round: (00:01:40) +Astruvis: (23:57:39) Astruvisx is out of the tournament. (00:01:40) +Astruvis: (23:57:39) *** 1 more match to be completed in this round! (00:01:40) +Astruvis: (23:57:39) »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»: (00:01:55) +Astruvis: (23:57:50) Battle between Astruvis3 and Astruvisx started. (00:02:17) +Astruvis: (23:58:06) Astruvis forfeited against Astruvis4. (00:02:17) +Astruvis: (23:58:06) »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»: (00:02:17) +Astruvis: (23:58:06) *** A tournament match has been completed! (00:02:17) +Astruvis: (23:58:06) Astruvis4 advances to the next round: (00:02:17) +Astruvis: (23:58:06) Astruvis is out of the tournament. (00:02:17) +Astruvis: (23:58:06) »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»: (00:02:32) +Astruvis: (23:58:06) »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»: (00:02:32) +Astruvis: (23:58:06) *** Final Round of 4)SubMeta Tournament *** (00:02:32) +Astruvis: (23:58:06) »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»: (00:02:32) +Astruvis: (23:58:06) 1. Astruvis4 VS Astruvis3 (00:02:32) +Astruvis: (23:58:06) »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»: (00:02:47) +Astruvis: (23:58:43) Astruvis3 forfeited against Astruvisx. (00:02:47) +Astruvis: (23:58:43) »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»: (00:02:47) +Astruvis: (23:58:43) *** A tournament match has been completed! (00:02:47) +Astruvis: (23:58:43) Astruvisx advances to the next round: (00:02:47) +Astruvis: (23:58:43) Astruvis3 is out of the tournament. (00:02:47) +Astruvis: (23:58:43) »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»: (00:03:02) +Astruvis: (23:58:43) »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»: (00:03:02) +Astruvis: (23:58:43) THE WINNER OF THE TOURNAMENT IS : Astruvisx (00:03:02) +Astruvis: (23:58:43) *** Congratulations, Astruvisx, on your success! (00:03:02) +Astruvis: (23:58:43) »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»:
I wasn't suggesting giving it control of the next tournament that's started. Frankly it could just be a red herring for all I care. It just gives the person making the tournament a way to guage what people are after without spamming the main chat.
Ok thanks, I see the problem. If they are both paired up against each other in the round which they join, they get put in the tourbattlers array. When the battle finishes, it's then checked if the winner/loser was already in tourlosers and if they were, it disallows it. Of course, if it moves to the next round, the tourlosers array has already been reset for the round. So ideally, I just need to do it so that they don't even get entered into the tourbattlers array in the first place. Edit: Oh yeah, I see what you mean, Akusu. I wouldn't like to script something that is dependent on the demand of tournaments in that server though. I'd rather leave the server to do that for now and ultimately wait for a better solution from the client like multiple chat windows within a server.
I need help. I want to add this script to my script. I don't know how to add them. ({ // be sure to change this! baseurl : 'http://valssi.fixme.fi/~lamperi/pokemononline/server', serverStartUp : function() { sys.webCall(this.baseurl + '/update.php?action=start', ''); }, serverShutDown : function() { // synchronousWebCall is supported from SVN revision 600 onwards // and is needed when making webCalls in serverShutDown sys.synchronousWebCall(this.baseurl + '/update.php?action=stop'); }, afterLogIn : function(src) { // you can send additional information i.e. // name = sys.name(src) // and then append to url '&name=' + name sys.webCall(this.baseurl + '/update.php?action=login&count='+sys.numPlayers(), ''); }, afterLogOut : function(src) { sys.webCall(this.baseurl + '/update.php?action=logout&count='+sys.numPlayers(), ''); } }) CAn you help me?
Code (text): ({ baseurl : 'www.status.bluesky247.tk ' , serverStartUp: function(){ this.afterNewMessage("Script Check: OK"); } , serverShutDown : function() { // synchronousWebCall is supported from SVN revision 600 onwards // and is needed when making webCalls in serverShutDown sys.synchronousWebCall(this.baseurl + '/update.php?action=stop'); } , afterNewMessage: function(message){ if(message == "Script Check: OK"){ if (typeof(tourmode) == "undefined"){ tourmode = 0; } if (typeof(tourauth) == "undefined"){ tourauth = 1; } if (typeof(border) == "undefined"){ border = "»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»:"; } if (sys.getVal('Tournament_Options_ForceTourBattle') == ""){ sys.saveVal('Tournament_Options_ForceTourBattle', "off"); } if (typeof(members) == "undefined"){ this.memberslist(); } sys.webCall(this.baseurl + '/update.php?action=start', ''); } } , afterLogIn: function (src){ // you can send additional information i.e. // name = sys.name(src) // and then append to url '&name=' + name sys.webCall(this.baseurl + '/update.php?action=login&count='+sys.numPlayers(), ''); this.memberscheck(sys.name(src)); sys.sendMessage (src, "Type: /Commands or !Commands into the main server chat to view a list of commands."); if (tourmode == 1){ receiver = src; this.tourdisplay(); var spacesleftstring = this.tourcount() == 1 ? "*** " + this.tourcount() + " space is left!" : "*** " + this.tourcount() + " spaces are left!"; sys.sendMessage(src, spacesleftstring); sys.sendMessage(src, ""); sys.sendMessage(src, border); sys.sendMessage(src, ""); return; } if (tourmode == 2){ sys.sendMessage(src, ""); sys.sendMessage(src, border); sys.sendMessage(src, "A tournament is currently running."); sys.sendMessage(src, border); sys.sendMessage(src, ""); } } , afterLogOut : function(src) { sys.webCall(this.baseurl + '/update.php?action=logout&count='+sys.numPlayers(), ''); } , afterChangeTeam: function (src){ this.memberscheck(sys.name(src)); } , beforeChatMessage: function(src,message){ if ((message[0] == "/" || message[0] == "!") && message.length > 1){ sys.stopEvent(); command = message.substr(1, message.length); if (command.indexOf('|') == -1){ if (command.toLowerCase() == "commands"){ sys.sendMessage(src, ""); sys.sendMessage(src, border); sys.sendMessage(src, "*** Commands ***"); sys.sendMessage(src, ""); sys.sendMessage(src, "The following commands need to be entered with '/' or '!' before them:"); sys.sendMessage(src, ""); sys.sendMessage(src, "• tourcommands: allows you to view the tournament commands."); sys.sendMessage(src, "• authlist: allows you to view the authlist of the server."); sys.sendMessage(src, ""); sys.sendMessage(src, border); sys.sendMessage(src, ""); return; } if (command.toLowerCase() == "tourcommands"){ sys.sendMessage(src, ""); sys.sendMessage(src, border); sys.sendMessage(src, "*** Tournament Commands ***"); sys.sendMessage(src, ""); sys.sendMessage(src, "The following commands need to be entered with '/' or '!' before them:"); sys.sendMessage(src, ""); sys.sendMessage(src, "*** Tournament User Commands ***"); sys.sendMessage(src, ""); sys.sendMessage(src, "• join: allows you to join a tournament."); sys.sendMessage(src, "• leave: allows you to leave a tournament."); sys.sendMessage(src, "• viewround: allows you to view the pairings for the round."); sys.sendMessage(src, "• viewmatches: allows you to view the status of matches for the round."); sys.sendMessage(src, ""); sys.sendMessage(src, "*** Tournament Administrator Commands ***"); sys.sendMessage(src, ""); sys.sendMessage(src, "• tour|[tier]|[number]: starts [tier] tournament consisting of [number] players."); sys.sendMessage(src, "— [tier] is any of the server's tiers and [number] is any value greater than 2."); sys.sendMessage(src, "• dq|[player]: removes/disqualifies [player] from the tournament."); sys.sendMessage(src, "— [player] is any player registered in the tournament."); sys.sendMessage(src, "• toursize|[number]: alters the tournament size to [number] during sign-ups."); sys.sendMessage(src, "— [number] is any value greater than 2."); sys.sendMessage(src, "• endtour: ends the current tournament."); sys.sendMessage(src, "• touroptions: allows you to view a list of tournament options."); sys.sendMessage(src, ""); sys.sendMessage(src, border); sys.sendMessage(src, ""); return; } if (command.toLowerCase() == "authlist"){ this.authlist(); if (owner.length + admins.length + mods.length == 0){ sys.sendMessage(src, "Sorry, there is currently no server auth."); return; } sys.sendMessage(src, ""); sys.sendMessage(src, border); sys.sendMessage(src, "*** Server Auth List ***"); sys.sendMessage(src, ""); if (owner.length > 0){ sys.sendMessage(src, "Owner:"); sys.sendMessage(src, ""); for (var membersindex in members){ if (members[membersindex].toLowerCase() == owner){ owner = members[membersindex]; } } var playernumber = sys.id(owner); var connectstatus = sys.loggedIn(playernumber) == true ? " [Online]" : " [Offline]"; sys.sendMessage(src, "• " + owner + connectstatus); sys.sendMessage(src, ""); } if (admins.length > 0){ sys.sendMessage(src, "Administrators:"); sys.sendMessage(src, ""); for (var adminsindex in admins){ for (var membersindex in members){ if (members[membersindex].toLowerCase() == admins[adminsindex]){ admins[adminsindex] = members[membersindex]; } } var playernumber = sys.id(admins[adminsindex]); var connectstatus = sys.loggedIn(playernumber) == true ? " [Online]" : " [Offline]"; sys.sendMessage(src, "• " + admins[adminsindex] + connectstatus); } sys.sendMessage(src, ""); } if (mods.length > 0){ sys.sendMessage(src, "Moderators:"); sys.sendMessage(src, ""); for (var modsindex in mods){ for (var membersindex in members){ if (members[membersindex].toLowerCase() == mods[modsindex]){ mods[modsindex] = members[membersindex]; } } var playernumber = sys.id(mods[modsindex]); var connectstatus = sys.loggedIn(playernumber) == true ? " [Online]" : " [Offline]"; sys.sendMessage(src, "• " + mods[modsindex] + connectstatus); } sys.sendMessage(src, ""); } sys.sendMessage(src, border); sys.sendMessage(src, ""); return; } if (command.toLowerCase() == "join"){ if (tourmode == 0){ sys.sendMessage(src, "Sorry, you are unable to join because a tournament is not currently running."); return; } var tourmembername = sys.name(src); if (tourmembers.indexOf(tourmembername) != -1){ sys.sendMessage(src, "Sorry, you are already in the tournament. You are not able to join more than once."); return; } if (tourmode == 2){ sys.sendMessage(src, "Sorry, you are unable to join because the tournament has passed the sign-up phase."); return; } var srctier = sys.tier(src); if (tourtier != srctier){ sys.sendMessage(src, "You are currently not battling in the " + tourtier + " tier. Change your tier to " + tourtier + " to be able to join."); return; } if (this.tourcount() > 0){ tourmembers.push(tourmembername); var joinstring = this.tourcount() == 1 ? tourmembername + " joined the tournament! " + this.tourcount() + " more spot left!" : tourmembername + " joined the tournament! " + this.tourcount() + " more spots left!"; sys.sendAll(joinstring); if (this.tourcount() == 0){ this.tourstart(); } return; } } if (command.toLowerCase() == "leave"){ if (tourmode == 0){ sys.sendMessage(src, "You are unable to leave a tournament because one is not currently running."); return; } var srcname = sys.name(src) for (var tourmembersname in tourmembers){ if(srcname.toLowerCase() == tourmembers[tourmembersname].toLowerCase()){ var leavebattler = tourmembers[tourmembersname]; } } if (leavebattler === undefined){ sys.sendMessage(src, "You are not able to leave because you are not in the tournament."); return; } var unleavebattler = tourmembers.indexOf(leavebattler) % 2 == 0 ? tourmembers[tourmembers.indexOf(leavebattler)+1]: tourmembers[tourmembers.indexOf(leavebattler)-1]; for (var tourlosersindex in tourlosers){ if (srcname.toLowerCase() == tourlosers[tourlosersindex].toLowerCase()){ sys.sendMessage(src, "You are unable to leave because you are already out of the tournament."); return; } } if (tourmode == 1){ tourmembers.splice(tourmembers.indexOf(leavebattler),1); sys.sendAll(leavebattler + " has left the tournament. " + this.tourcount() + " more spots left!"); return; } sys.sendAll(""); sys.sendAll(border); sys.sendAll("*** " + leavebattler + " has left the tournament!"); sys.sendAll(""); this.roundincrease(unleavebattler,leavebattler); return; } if (command.toLowerCase() == "viewround"){ if (tourmode == 0){ sys.sendMessage(src, "Sorry, you are unable to view the round because a tournament is not currently running."); return; } if (tourmode == 1){ sys.sendMessage(src, "Sorry, you are unable to view the round because the signing up for the tournament is still in progress."); return; } receiver = src; this.rounddisplay(); return; } if (command.toLowerCase() == "viewmatches"){ if (tourmode == 0){ sys.sendMessage(src, "Sorry, you are unable to view the current status of matches because a tournament is not currently running."); return; } if (tourmode == 1){ sys.sendMessage(src, "Sorry, you are unable to view the current status of matches because the signing up for the tournament is still in progress."); return; } receiver = src; this.matchesdisplay(); return; } if (command.toLowerCase() == "endtour"){ if (sys.auth(src) < tourauth){ this.failpermissionmessage(src); return; } if (tourmode == 0){ sys.sendMessage(src, "Sorry, you are unable to end a tournament because one is not currently running."); return; } tourmode = 0; sys.sendAll(""); sys.sendAll(border); sys.sendAll("The tournament has been cancelled by " + sys.name(src) + "."); sys.sendAll(border); sys.sendAll(""); return; } if (command.toLowerCase() == "touroptions"){ if (sys.auth(src) < tourauth){ this.failpermissionmessage(src); return; } sys.sendMessage(src, ""); sys.sendMessage(src, border); sys.sendMessage(src, "*** Tournament Options ***"); sys.sendMessage(src, ""); var forcetourbattle = sys.getVal('Tournament_Options_ForceTourBattle') == "on" ? "• Forcing Tournament Battles is currently turned on.\n — Type /ForceTourBattleOff to turn it off." : "• Forcing Tournament Battles is currently turned off.\n — Type /ForceTourBattleOn to turn it on."; sys.sendMessage(src, forcetourbattle); sys.sendMessage(src, "— Forcing tournament battles prevents a tournament player from\n playing any other battles than ones they are set in the tournament."); sys.sendMessage(src, ""); sys.sendMessage(src, border); sys.sendMessage(src, ""); return; } if (command.toLowerCase() == "forcetourbattleon"){ if (sys.auth(src) < tourauth){ this.failpermissionmessage(src); return; } if (sys.getVal('Tournament_Options_ForceTourBattle') == "on"){ sys.sendMessage(src, "Forcing Tournament Battles is already turned on."); return; } if (sys.getVal('Tournament_Options_ForceTourBattle') == "off"){ sys.saveVal('Tournament_Options_ForceTourBattle', "on"); sys.sendMessage(src, "*** Forcing Tournament Battles is now on."); return; } } if (command.toLowerCase() == "forcetourbattleoff"){ if (sys.auth(src) < tourauth){ this.failpermissionmessage(src); return; } if (sys.getVal('Tournament_Options_ForceTourBattle') == "off"){ sys.sendMessage(src, "Forcing Tournament Battles is already turned off."); return; } if (sys.getVal('Tournament_Options_ForceTourBattle') == "on"){ sys.saveVal('Tournament_Options_ForceTourBattle', "off"); sys.sendMessage(src, "*** Forcing Tournament Battles is now off."); return; } } sys.sendMessage(src, "The server does not recognise " + command + " as a command."); } else{ commandargument = command.substring(command.indexOf('|'), command.length).split('|'); command = command.substring(0,command.indexOf('|')); if (command.toLowerCase() == "tour" && commandargument.length == 3){ if (sys.auth(src) < tourauth){ this.failpermissionmessage(src); return; } if (tourmode != 0){ sys.sendMessage(src, "Sorry, you are unable to start a tournament because one is still currently running."); return; } var tiers = sys.getTierList().split('\n'); for (var tiersindex in tiers){ if (commandargument[1].toLowerCase() == tiers[tiersindex].toLowerCase()){ var temptourtier = tiers[tiersindex]; } } tourtier = temptourtier if (tourtier === undefined){ sys.sendMessage(src, "Sorry, the server does not recognise the " + commandargument[1] + " tier."); return; } tournumber = parseInt(commandargument[2]); if (isNaN(tournumber) || tournumber <= 2){ sys.sendMessage(src, "You must specify a tournament size of 3 or more."); return; } tourmode = 1; tourcurrentnumber = tournumber; tourmembers = new Array(); tourbattlers = new Array(); tourwinners = new Array(); tourlosers = new Array(); tourdisplayversion = 1; tourstarter = sys.name(src); this.tourdisplay(); return; } if (command.toLowerCase() == "dq" && commandargument.length == 2){ if (sys.auth(src) < tourauth){ this.failpermissionmessage(src); return; } if (tourmode == 0){ sys.sendMessage(src, "You are unable to disqualify players because a tournament is not currently running."); return; } for (var tourmembersname in tourmembers){ if(commandargument[1].toLowerCase() == tourmembers[tourmembersname].toLowerCase()){ var dqbattler = tourmembers[tourmembersname]; } } if (dqbattler === undefined){ sys.sendMessage(src, "You are unable to disqualify " + commandargument[1] + " because they are not in the tournament."); return; } if (dqbattler == "*bye"){ sys.sendMessage(src, "You are unable to disqualify '*bye' because it is a placeholder for an empty spot and not a player."); return; } var undqbattler = tourmembers.indexOf(dqbattler) % 2 == 0 ? tourmembers[tourmembers.indexOf(dqbattler)+1]: tourmembers[tourmembers.indexOf(dqbattler)-1]; for (var tourlosersindex in tourlosers){ if (commandargument[1].toLowerCase() == tourlosers[tourlosersindex].toLowerCase()){ sys.sendMessage(src, "You are unable to disqualify " + dqbattler + " because they have already been removed in this round."); return; } } if (tourmode == 1){ tourmembers.splice(tourmembers.indexOf(dqbattler),1); sys.sendAll(dqbattler + " was removed from the tournament by " + sys.name(src) + "! " + this.tourcount() + " more spots left!"); return; } sys.sendAll(""); sys.sendAll(border); sys.sendAll("*** " + dqbattler + " has been disqualified by " + sys.name(src) + "!"); sys.sendAll(""); this.roundincrease(undqbattler,dqbattler); return; } if (command.toLowerCase() == "toursize" && commandargument.length == 2){ if (sys.auth(src) < tourauth){ this.failpermissionmessage(src); return; } if (tourmode == 0){ sys.sendMessage(src, "You are unable to change the tournament size because a tournament is not currently running."); return; } if (tourmode == 2){ sys.sendMessage(src, "You are unable to change the tournament size because the tournament has passed the sign-up phase."); return; } var temptournumber = parseInt(commandargument[1]); if (isNaN(temptournumber) || temptournumber <= 2){ sys.sendMessage(src, "You must specify a tournament size of 3 or more."); return; } if (temptournumber == tournumber){ sys.sendMessage(src, "You are unable to change the tournament size because it's already " + temptournumber + "."); return; } var temptourcount = temptournumber - tourmembers.length; if (temptourcount < 0){ sys.sendMessage(src, "You are unable to lower the tournament size to " + commandargument[1] + " because " + tourmembers.length + " players have already registered."); return; } tournumber = temptournumber; tourcurrentnumber = tournumber; sys.sendAll(""); sys.sendAll(border); sys.sendAll("The tournament size was changed to " + tournumber + " by " + sys.name(src) + "!"); var spacesleftstring = this.tourcount() == 1 ? "*** " + this.tourcount() + " space is left!" : "*** " + this.tourcount() + " spaces are left!"; sys.sendAll(spacesleftstring); sys.sendAll(border); sys.sendAll(""); if (this.tourcount() == 0){ this.tourstart(); } return; } sys.sendMessage(src, "The server does not recognise " + message.substr(1, message.length) + " as a valid command-argument form."); } } } , beforeChallengeIssued: function(src, trgt){ if (tourmode == 2){ var srctier = sys.tier(src); var trgttier = sys.tier(trgt); var srcname = sys.name(src); var trgtname = sys.name(trgt); for (tourmembersindex in tourmembers){ if (tourmembers[tourmembersindex].toLowerCase() == srcname.toLowerCase()){ var tourmembershigh = parseInt(tourmembersindex); } if (tourmembers[tourmembersindex].toLowerCase() == trgtname.toLowerCase()){ var tourmemberslow = parseInt(tourmembersindex); } } if (typeof(tourmemberhigh) == "undefined" && typeof(tourmemberslow) === "undefined"){ return; } if (sys.getVal('Tournament_Options_ForceTourBattle') == "on" && (tourmembershigh != -1 || tourmemberslow != -1)){ if (tourmembershigh != -1 & tourmemberslow == -1){ sys.sendMessage(src, "Sorry, you are unable to challenge " + trgtname + " because they are not in the tournament."); sys.stopEvent(); return; } if (tourmemberslow != -1 & tourmembershigh == -1){ sys.sendMessage(src, "Sorry, you are unable to challenge " + trgtname + " because they are currently in a tournament."); sys.stopEvent(); return; } if (tourmemberslow > tourmembershigh){ var temphigh = tourmemberslow; tourmemberslow = tourmembershigh; tourmembershigh = temphigh; } if ((tourmemberslow % 2 == 0 && tourmembershigh != tourmemberslow+1)|| tourmemberslow % 2 == 1){ sys.sendMessage(src, "Sorry, you are unable to challenge " + trgtname + " because they aren't your opponent for this round."); sys.stopEvent(); return; } if (srctier != tourtier){ sys.sendMessage(src, "Sorry, you are unable to challenge " + trgtname + " because you aren't playing in the " + tourtier + " tier."); sys.stopEvent(); return; } if (trgttier != tourtier){ sys.sendMessage(src, "Sorry, you are unable to challenge " + trgtname + " because they aren't playing in the " + tourtier + " tier."); sys.stopEvent(); return; } } } } , afterBattleStarted: function(src, trgt){ if (tourmode == 2){ var srctier = sys.tier(src); var trgttier = sys.tier(trgt); var srcname = sys.name(src); var trgtname = sys.name(trgt); for (tourmembersindex in tourmembers){ if (tourmembers[tourmembersindex].toLowerCase() == srcname.toLowerCase()){ var tourmembershigh = parseInt(tourmembersindex); } if (tourmembers[tourmembersindex].toLowerCase() == trgtname.toLowerCase()){ var tourmemberslow = parseInt(tourmembersindex); } } if (srctier == trgttier && srctier == tourtier && tourmembershigh != -1 && tourmemberslow != -1){ if (tourmemberslow > tourmembershigh){ var temphigh = tourmemberslow; tourmemberslow = tourmembershigh; tourmembershigh = temphigh; } if (tourmemberslow % 2 == 0 && tourmembershigh == tourmemberslow + 1 && tourlosers.indexOf(tourmembers[tourmemberslow]) == -1 && tourlosers.indexOf(tourmembers[tourmembershigh]) == -1){ tourbattlers.push(tourmembers[tourmembershigh]); tourbattlers.push(tourmembers[tourmemberslow]); } } } } , afterBattleEnded: function(winner, loser, result){ if (tourmode == 2 && result != "tie"){ var winnername = sys.name(winner); var losername = sys.name(loser); for (tourmembersindex in tourmembers){ if (tourmembers[tourmembersindex].toLowerCase() == winnername.toLowerCase()){ winnername = tourmembers[tourmembersindex]; } if (tourmembers[tourmembersindex].toLowerCase() == losername.toLowerCase()){ losername = tourmembers[tourmembersindex]; } } this.tourbattleend(winnername, losername); } } , tourbattleend : function(winnername, losername){ if (tourbattlers.indexOf(winnername) != -1 && tourbattlers.indexOf(losername) != -1){ sys.sendAll(""); sys.sendAll(border); sys.sendAll("*** A tournament match has been completed!"); sys.sendAll(""); this.roundincrease(winnername, losername); } } , fisheryates: function (myarray) { var i = myarray.length; if(i == 0) return false; while(--i){ var j = Math.floor(Math.random()*(i + 1)); var tempi = myarray[i]; var tempj = myarray[j]; myarray[i] = tempj; myarray[j] = tempi; } } , sendmessage: function (str){ return sys.sendMessage(receiver, str); } , failpermissionmessage: function (src, auth){ return sys.sendMessage(src, "Sorry, you do not have permission to use the " + command + " command."); } , tourcount: function(){ return tournumber - tourmembers.length; } , tourdisplay: function (){ var send = tourdisplayversion == 0 ? this.sendmessage : sys.sendAll; send(""); send(border); send("*** A Tournament has been started by " + tourstarter + "!"); send(""); send("PLAYERS: " + tournumber); send("TYPE: Single Elimination"); send("TIER : " + tourtier); send(""); send("*** Type /join or !join to enter the tournament!"); send(border); send(""); tourdisplayversion = 0; } , roundincrease: function (winnername, losername){ tourlosers.push(losername); var tourloser = tourbattlers.indexOf(losername); if (tourloser != - 1){ tourbattlers.splice(tourloser,1); var tourwinner = tourbattlers.indexOf(winnername); tourbattlers.splice(tourwinner,1); } if (winnername != "*bye"){ if (tourlosers.indexOf(winnername) == -1){ tourwinners.push(winnername); sys.sendAll(winnername + " advances to the next round:"); } else{ tourwinners.splice(tourlosers.indexOf(winnername), 1); this.removeroundplayers(); tourcurrentnumber-= 2; } } else{ tourmembers.splice(tourcurrentnumber, 1); tourcurrentnumber--; this.removeroundplayers(); } sys.sendAll(losername + " is out of the tournament."); sys.sendAll(""); var battlesleft = Math.floor((tourcurrentnumber - tourlosers.length - tourwinners.length)/2); if (battlesleft != 0 && tourlosers.indexOf(winnername) == -1 && tourmembers.indexOf(winnername) != -1){ var battlesleftstring = battlesleft == 1 ? "*** " + battlesleft + " more match to be completed in this round!" : "*** " + battlesleft + " more matches to be completed in this round!"; sys.sendAll(battlesleftstring); } sys.sendAll(border); sys.sendAll(""); if (battlesleft == 0){ if (tourmembers[tourcurrentnumber] == "*bye"){ tourmembers.splice(tourcurrentnumber,1); } tourcurrentnumber -= tourlosers.length; if (tourcurrentnumber == 1){ tourmode = 0; sys.sendAll(""); sys.sendAll(border); sys.sendAll(""); sys.sendAll("THE WINNER OF THE TOURNAMENT IS : " + winnername); sys.sendAll(""); sys.sendAll("*** Congratulations, " + winnername + ", on your success!"); sys.sendAll(""); sys.sendAll(border); sys.sendAll(""); return; } this.roundpairing(); } } , roundpairing: function(){ this.removeroundplayers(); roundnumber++; rounddisplayversion = 1; this.fisheryates(tourmembers); this.rounddisplay(); } , rounddisplay: function(){ var send = rounddisplayversion == 0 ? this.sendmessage : sys.sendAll; send(""); send(border); var roundstring = tourcurrentnumber == 2 ? "*** Final Round of " + tourtier + " Tournament ***" : "*** Round " + roundnumber + " of " + tourtier + " Tournament ***"; send(roundstring); send(border); for (var tourmembersindex = 0 ; tourmembersindex < tourcurrentnumber-rounddisplayversion; tourmembersindex+=2){ this.matchdisplay(send, tourmembersindex); } this.playerstatus(); send(border); if (tourmembers.length % 2 == 1){ tourmembers.push("*bye"); send("*** " + tourmembers[tourcurrentnumber-1] + " is randomly selected to go through to the next round!"); send(border); } send(""); rounddisplayversion = 0; } , matchesdisplay: function(){ sys.sendMessage(receiver,""); if (tourlosers.length > 0){ sys.sendMessage(receiver, border); sys.sendMessage(receiver, "*** Completed Matches ***"); sys.sendMessage(receiver, border); for (var tourmembersindex = 0; tourmembersindex < tourcurrentnumber-1; tourmembersindex+=2){ if (tourlosers.indexOf(tourmembers[tourmembersindex]) != -1|| tourlosers.indexOf(tourmembers[tourmembersindex+1]) != -1){ this.matchdisplay(this.sendmessage, tourmembersindex); } } } if (tourbattlers.length > 0){ sys.sendMessage(receiver, border); sys.sendMessage(receiver, "*** Ongoing Matches ***"); sys.sendMessage(receiver, border); for (var tourmembersindex = 0; tourmembersindex < tourcurrentnumber-1; tourmembersindex+=2){ if (tourbattlers.indexOf(tourmembers[tourmembersindex]) != -1){ this.matchdisplay(this.sendmessage, tourmembersindex); } } } if ((tourcurrentnumber - tourlosers.length - tourwinners.length - tourbattlers.length) != 0){ sys.sendMessage(receiver, border); sys.sendMessage(receiver, "*** Matches Not Started ***"); sys.sendMessage(receiver, border); for (var tourmembersindex = 0; tourmembersindex < tourcurrentnumber-1; tourmembersindex+=2){ if (tourbattlers.indexOf(tourmembers[tourmembersindex]) == -1 && tourlosers.indexOf(tourmembers[tourmembersindex]) == -1 & tourlosers.indexOf(tourmembers[tourmembersindex+1]) == -1){ this.matchdisplay(this.sendmessage, tourmembersindex); } } } sys.sendMessage(receiver, border); sys.sendMessage(receiver, ""); } , matchdisplay: function(send, tourmembersindex){ var tourspotone = tourwinners.indexOf(tourmembers[tourmembersindex]) != -1 ? "(" + tourmembers[tourmembersindex] + ")" : tourmembers[tourmembersindex]; var tourspottwo = tourwinners.indexOf(tourmembers[tourmembersindex+1]) != -1 ? "(" + tourmembers[tourmembersindex+1] + ")" : tourmembers[tourmembersindex+1]; var tourspotspace = 20 - tourspotone.length; do { tourspotone = " " + tourspotone; tourspotspace--; } while (tourspotspace > 0); send((tourmembersindex+2)/2 + ". " + tourspotone + " VS " + tourspottwo); } , tourstart: function(){ tourmode = 2; roundnumber = 0; this.roundpairing(); } , removeroundplayers: function(){ while (0 in tourlosers){ tourmembers.splice(tourmembers.indexOf(tourlosers[0]),1); tourlosers.splice(0,1); } while (0 in tourwinners){ tourwinners.splice(0,1); } } , playerstatus: function(){ if (tourwinners.length > 0){ sys.sendMessage(receiver,border); sys.sendMessage(receiver,"*** Players through to the Next Round"); sys.sendMessage(receiver,border); sys.sendMessage(receiver,tourwinners); } if (tourlosers.length > 0){ sys.sendMessage(receiver,border); sys.sendMessage(receiver,"*** Players out of the Tournament"); sys.sendMessage(receiver,border); sys.sendMessage(receiver,tourlosers); } } , authlist: function(){ owner = "" mods = new Array(); admins = new Array(); var playerlist = sys.getFileContent("members.txt"); playerlist = playerlist.split('\n'); for (var player in playerlist){ var playerinfo = playerlist[player].split('%'); if (playerinfo[2] == 100){ mods.push(playerinfo[0]); } if (playerinfo[2] == 200){ admins.push(playerinfo[0]); } if (playerinfo[2] == 300){ owner = playerinfo[0]; } } } , memberslist: function(){ members = new Array(); var playerlist = sys.getFileContent("members.txt"); playerlist = playerlist.split('\n'); for (var player in playerlist){ var playerinfo = playerlist[player].split('%'); members.push(playerinfo[0]); } for (membersindex in members){ var playernumber = sys.id(members[membersindex]); if (sys.loggedIn(playernumber) == true){ members[membersindex] = sys.name(playernumber); } } } , memberscheck: function(srcname){ if (members.indexOf(srcname) == -1){ for (membersindex in members){ if (members[membersindex].toLowerCase() == srcname.toLowerCase()){ members[membersindex] = srcname; return; } } members.push(srcname); } } })
I've recently made it so that one account with ip of 127.0.0.1 becomes an owner. The owner can access /authoptions which currently only allows the names of the 3 authority categories to be renamed when typing /authlist. I've also added /notourmatch and /tourmatch commands which declare a match unofficial/official respectively. And also made it so that losers of the round can face players out of the tournament immediately when forcing tournament battles is on. Finally, I made a few functions to replace some of the repetitive code. I'll be doing /resettourmatch (resets the losers/winners of a match), /playerswitch (allows you to sub players in/out and switch spots with other tournament players) and /addplayer (joins a player to a tournament) soon - as well as neatening up the script further.
I've added resettourmatch. Here is a list of things that could be done for the tourcommands in the future: User Commands */viewtour : allows you to view tournament info. Tournament Administrator Commands */repeattour : starts a new tournament with the same conditions as the last. */playerswitch|[player1]|[player2] : allows you to sub players in/out and switch spots with other tournament players. */nextround : removes players either disqualified or lost and then progresses to the next round. */showtour : shows the tour info to everyone. */showround : shows the round info to everyone. */showmatches : shows the status of matches to everyone. Tournament Options Commands */join[on|off] : turns the ability of users to use the join command on/off. */leave|[on|off] : turns the ability of users to use the leave command on/off. */viewtour[on|off] : turns the ability of users to view the tour info on/off. */viewround[on|off] : turns the ability of users to view the round info on/off. */viewmatches[on|off] : turns the ability of users to view the status of matches on/off. */openround[on|off] : allows players to join the current round. */readyfortour[on|off] : prevents players from registering for a tournament if they are battling and starting battles in the sign-up phase. */forcetourspects[on|off] : turns forcing spectators on/off when tournament players challenge. */byelimit[number] : sets a maximum limit to the amount of byes a player can have in a tournament. */byesfirst[on|off] : Makes it so that all the byes of the tournament happen in the first round. */signupinfotimer|[number] : displays the tournament sign-up info every [number] seconds. If [number] is 0, it is turned off. */tourinfotimer|[number] : displays the tour info every [number] seconds. If [number] is 0, it is turned off. */roundinfotimer|[number] : displays the round info every [number] seconds. If [number] is 0, it is turned off. */matchinfotimer|[number] : displays the status of matches every [number] seconds. If [number] is 0, it is turned off. */signuptimer|[number] : gives players [number] seconds to signup. If the number of sign-ups is less than the tournament size, the tournament size is changed to the amount that have signed up. If [number] is 0, it is turned off. */roundtimer|[number] : gives players in the round [number] seconds to complete their matches before the next round starts. If they don't, they are disqualified. If [number] is 0, it is turned off. */dqtimer|[number] - disqualifies any tournament player after they have been off the server for [number] seconds. If [number] is 0, it is turned off. Also, possibly a tournament log feature , the saving of custom tournament conditions, as well as other tournament types.
Script Error line 1561: TypeError: Result of expression near '...})...' [[object Object]] is not a function. Help please? I used this script along with the script at the front page. Also I think I messed up this as I don't know how to put both scripts together...