Arena Picker: Difference between revisions

From MBedwars
Jump to navigation Jump to search
No edit summary
No edit summary
 
(27 intermediate revisions by the same user not shown)
Line 1: Line 1:
There are several other ways to pick an arena instead with the arena name.<br />
There are several other ways to pick an arena instead with the arena name.<br />
You can use them where ever the arena instance is getting picked using the name.<br />
You can use them where ever the arena instance is getting picked using the name.<br />
They are currently '''NOT''' working for signs or hubvillager.
They are currently '''NOT''' working for signs or hubvillager + they won't work with every command completly fine.<br>
== %random% ==
Common commands such as /bw join are ok to use.<br>
Picks a random arena.<br />
<br>
== %random_lobby% ==
'''Important notice:'''<br>
Picks a random arena with a condition: The arenas state must be lobby.
Commands normally do '''NOT''' send a reason why the arena picker didn't work.<br>
== %random_lobby_joinable% ==
There are two ways to check what's wrong with the picker:
Picks a random arena with two conditions: The arenas state must be lobby and there must be space for the player to join.
# by looking into the console
== %random_ingame% ==
# by using the "/bw debug 2 <arena picker>" command. Example: "/bw arena debug 2 %random[ingame_players=0]%"
Picks a random arena with a condition: The arenas state must be ingame.
<br>
== %random_lobby_running% ==
<br>
Picks a random arena with a condition: The arenas state must be ingame or lobby.
=Types=
== %best_lobby% ==
=== %random% ===
Picks a random arena.
=== %best% ===
Picks a random with these conditions:<br />
Picks a random with these conditions:<br />
* The arenas state must be lobby
* It's the arena with the most players
* It's the arena with the most players
* -> If it's full then it's picking an arena with less players
* -> If it's full then it's picking an arena with less players
* If there are multiple arenas with the same amount player, then it'll pick a random one
* If there are multiple arenas with the same amount player, then it'll pick a random one
= Conditions =
= Conditions =
You may add to your Arena Picker.<br>
You may add conditions to your Arena Picker.<br>
<br>
<br>
'''An example:''' %best_lobby[players_per_team>=2,teams=4]%<br>
'''An example:''' %random[players_per_team>=2 & teams=4 & status=2]%<br>
By that only arenas with<br>
By that only arenas with<br>
- 2 or more players per team<br>
* 2 or more players per team<br>
- and 4 teams<br>
* and 4 teams<br>
* and "lobby" as their current state<br>
will be taken by the Arena Picker.<br>
<br>
'''An other example:''' %best[display_name="my arena name" & (teams=2 | teams=4)]%<br>
By that only arenas with<br>
* the display name '''my arena name'''
* and 2 or 4 teams
will be taken by the Arena Picker.<br>
will be taken by the Arena Picker.<br>
<br>
<br>
==Possible comparisons==
==Possible comparisons==
* =  : equal
*=  : equal
* != : not equal
*!= : not equal
* >  : greater than
*>  : greater than
* <  : less than
*<  : less than
* => : greater than or equal
*>= : greater than or equal
* <= : less than or equal
*<= : less than or equal
 
== Truth functions ==
They allow you to have multiple conditions in one string.<br>
You may use:<br>
*& : AND
*| : OR
<br>
'''Example:'''
ingame_players<=2 & status=2 | ingame_players >= 1 & status=3
In a human language this would mean, that only arenas
* with 2 or less ingame players
* and whose state is lobby
or arenas
* with 1 or more players
* and whose state is ingame
will be considered for the picker
 
==Variables==
==Variables==
* players_per_team [Number]
* teams [Number]
* max_players [Number]
* ingame_players [Number]
* status ''1=Stopped, 2=Lobby, 3=Running, 4=Reseting, 5=End lobby''  [Number]
* name [String]
* display_name [String]

Latest revision as of 03:08, 2 November 2019

There are several other ways to pick an arena instead with the arena name.
You can use them where ever the arena instance is getting picked using the name.
They are currently NOT working for signs or hubvillager + they won't work with every command completly fine.
Common commands such as /bw join are ok to use.

Important notice:
Commands normally do NOT send a reason why the arena picker didn't work.
There are two ways to check what's wrong with the picker:

  1. by looking into the console
  2. by using the "/bw debug 2 <arena picker>" command. Example: "/bw arena debug 2 %random[ingame_players=0]%"



Types

%random%

Picks a random arena.

%best%

Picks a random with these conditions:

  • It's the arena with the most players
  • -> If it's full then it's picking an arena with less players
  • If there are multiple arenas with the same amount player, then it'll pick a random one

Conditions

You may add conditions to your Arena Picker.

An example: %random[players_per_team>=2 & teams=4 & status=2]%
By that only arenas with

  • 2 or more players per team
  • and 4 teams
  • and "lobby" as their current state

will be taken by the Arena Picker.

An other example: %best[display_name="my arena name" & (teams=2 | teams=4)]%
By that only arenas with

  • the display name my arena name
  • and 2 or 4 teams

will be taken by the Arena Picker.

Possible comparisons

  • =  : equal
  • != : not equal
  • >  : greater than
  • <  : less than
  • >= : greater than or equal
  • <= : less than or equal

Truth functions

They allow you to have multiple conditions in one string.
You may use:

  • & : AND
  • | : OR


Example:

ingame_players<=2 & status=2 | ingame_players >= 1 & status=3

In a human language this would mean, that only arenas

  • with 2 or less ingame players
  • and whose state is lobby

or arenas

  • with 1 or more players
  • and whose state is ingame

will be considered for the picker

Variables

  • players_per_team [Number]
  • teams [Number]
  • max_players [Number]
  • ingame_players [Number]
  • status 1=Stopped, 2=Lobby, 3=Running, 4=Reseting, 5=End lobby [Number]
  • name [String]
  • display_name [String]