Skip to content

Commit

Permalink
DP | One Tick Test
Browse files Browse the repository at this point in the history
  • Loading branch information
Nik0-0 committed Feb 27, 2024
1 parent 9777f6b commit 6e08a87
Show file tree
Hide file tree
Showing 18 changed files with 10 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
scoreboard players set ticks nn_spawn 20
$tp @e[tag=$(bot_name)_z] @e[tag=$(map),limit=1,sort=random]
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
execute store result score spawn nn_spawn run random value 1..60
function nnb_spawnsystem:call_bots {"sel_map":"nn_mall"}
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
execute store result score spawn nn_spawn run random value 1..60
function nnb_spawnsystem:call_bots {"sel_map":"nn_hauntedmansion"}
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
execute store result score spawn nn_spawn run random value 1..60
function nnb_spawnsystem:call_bots {"sel_map":"nn_habitablezone"}
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
execute store result score spawn nn_spawn run random value 1..60
function nnb_spawnsystem:call_bots {"sel_map":"nn_doomspire"}
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
execute store result score spawn nn_spawn run random value 1..60
function nnb_spawnsystem:call_bots {"sel_map":"nn_crossroads_c"}
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
execute store result score spawn nn_spawn run random value 1..60
function nnb_spawnsystem:call_bots {"sel_map":"nn_topmodernhouse"}
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
execute store result score spawn nn_spawn run random value 1..60
function nnb_spawnsystem:call_bots {"sel_map":"nn_poolrooms"}
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
execute store result score spawn nn_spawn run random value 1..60
function nnb_spawnsystem:call_bots {"sel_map":"nn_port"}
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
execute store result score spawn nn_spawn run random value 1..60
function nnb_spawnsystem:call_bots {"sel_map":"nn_camberturn"}
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
execute store result score spawn nn_spawn run random value 1..60
function nnb_spawnsystem:call_bots {"sel_map":"nn_crossroads"}
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
execute store result score spawn nn_spawn run random value 1..60
function nnb_spawnsystem:call_bots {"sel_map":"nn_russia"}
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
execute store result score spawn nn_spawn run random value 1..60
function nnb_spawnsystem:call_bots {"sel_map":"nn_trainstation"}
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
execute store result score spawn nn_spawn run random value 1..60
function nnb_spawnsystem:call_bots {"sel_map":"nn_fungle"}
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
execute store result score spawn nn_spawn run random value 1..60
function nnb_spawnsystem:call_bots {"sel_map":"nn_hotel"}
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
execute store result storage nnb_spawnsystem:__storage__ switch_key int 1 run scoreboard players get map nn_map
function nnb_spawnsystem:__private__/switch_case/0/select with storage nnb_spawnsystem:__storage__
function nnb_spawnsystem:__private__/switch_case/0/select with storage nnb_spawnsystem:__storage__
schedule function nnb_spawnsystem:map_detect 1t
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
scoreboard players set ticks nn_spawn 20
scoreboard players remove ticks nn_spawn 1
$say $(bot_name) $(id) $(map)
$execute unless entity @e[tag=$(bot_name)] run scoreboard players set spawn nn_nextbot_spawn $(id)
$tp @e[tag=$(bot_name)_z] @e[tag=$(map),limit=1,sort=random]
execute if score ticks nn_spawn <= 0 nn_lobby run function nnb_spawnsystem:map_detect
execute if score ticks nn_spawn <= 0 nn_lobby run function nnb_spawnsystem:__private__/if_else/2
22 changes: 4 additions & 18 deletions nnb_spawnsystem/main.jmc
Original file line number Diff line number Diff line change
Expand Up @@ -64,50 +64,37 @@ if (nn_lobby:phase = 5) {
function map_detect() {
switch(nn_map:map) {
case 1:
execute store result score spawn nn_spawn run random value 1..60;
call_bots(sel_map="nn_mall");
case 2:
execute store result score spawn nn_spawn run random value 1..60;
call_bots(sel_map="nn_poolrooms");
case 3:
execute store result score spawn nn_spawn run random value 1..60;
call_bots(sel_map="nn_port");
case 4:
execute store result score spawn nn_spawn run random value 1..60;
call_bots(sel_map="nn_camberturn");
case 5:
execute store result score spawn nn_spawn run random value 1..60;
call_bots(sel_map="nn_crossroads");
case 6:
execute store result score spawn nn_spawn run random value 1..60;
call_bots(sel_map="nn_russia");
case 7:
execute store result score spawn nn_spawn run random value 1..60;
call_bots(sel_map="nn_trainstation");
case 8:
execute store result score spawn nn_spawn run random value 1..60;
call_bots(sel_map="nn_fungle");
case 9:
execute store result score spawn nn_spawn run random value 1..60;
call_bots(sel_map="nn_hotel");
case 10:
execute store result score spawn nn_spawn run random value 1..60;
call_bots(sel_map="nn_hauntedmansion");
case 11:
execute store result score spawn nn_spawn run random value 1..60;
call_bots(sel_map="nn_habitablezone");
case 12:
execute store result score spawn nn_spawn run random value 1..60;
call_bots(sel_map="nn_doomspire");
case 13:
execute store result score spawn nn_spawn run random value 1..60;
call_bots(sel_map="nn_crossroads_c");
case 14:
execute store result score spawn nn_spawn run random value 1..60;
call_bots(sel_map="nn_topmodernhouse");
// default:
// say "Unable to find anything";
}
schedule function map_detect() 1t;
}


Expand Down Expand Up @@ -174,14 +161,13 @@ function call_bots() {

// Universal spawn bot stuff
function setup_bots() {
scoreboard players set ticks nn_spawn 20;

scoreboard players remove ticks nn_spawn 1;
$say "$(bot_name) $(id) $(map)";
$execute unless entity @e[tag=$(bot_name)] run scoreboard players set spawn nn_nextbot_spawn $(id);
$tp @e[tag=$(bot_name)_z] @e[tag=$(map),limit=1,sort=random];

if (nn_spawn:ticks <= nn_lobby:0) {
map_detect();
scoreboard players set ticks nn_spawn 20;
$tp @e[tag=$(bot_name)_z] @e[tag=$(map),limit=1,sort=random];
}
}

Expand Down

0 comments on commit 6e08a87

Please sign in to comment.