-
Compteur de contenus
90 -
Inscription
-
Dernière visite
-
Jours gagnés
8
Type de contenu
Profils
Forums
Téléchargements
Tout ce qui a été posté par McLincoln2
-
options: gui name: <MM>/<YY> <M> function G(MM:number,DD:number,YY:number) :: number: if {_MM} >= 3: set {_z} to {_YY} else if {_MM} is 1 or 2: set {_z} to {_YY}-1 set {_A} to floor(23*{_MM}/9) set {_B::*} to floor({_z}/4), floor({_z}/100) and floor({_z}/400) if {_MM} is 1 or 2: set {_D} to {_A}+{_DD}+4+{_YY}+{_B::1}-{_B::2}+{_B::3} else: set {_D} to {_A}+{_DD}+4+{_YY}+{_B::1}-{_B::2}+{_B::3}-2 return mod({_D},7) function JDay(JJ:number) :: string: set {_d::*} to "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi" and "Dimanche" if {_JJ} is 0: set {_JJ} to 7 return {_d::%{_JJ}%} function MMonth(MM:number) :: string: set {_m::*} to "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre" and "Décembre" return {_m::%{_MM}%} function isB(YY:number) :: boolean: if mod({_YY},4) != 0: return false else if mod({_YY},100) != 0: return true else if mod({_YY},400) != 0: return false else: return true function nbMY(MM:number,YY:number) :: number: set {_n::*} to 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30 and 31 if isB({_YY}) is true: set {_n::2} to {_n::2}+1 return {_n::%{_MM}%} on command: if command is "jour": cancel event set {_a::*} to arguments split by " " if {_a::1} is set: if {_a::2} parsed as number is set: if {_a::3} parsed as number is set: # /MM /DD /YY if {_a::1} parsed as number is smaller or equal to 12: send "%JDay(G({_a::1} parsed as number,{_a::2} parsed as number,{_a::3} parsed as number))% %{_a::2}% %MMonth({_a::1} parsed as number)% %{_a::3}%" to player else: set {_n} to "%now%" set {_t::*} to first element of {_n} split by " " split by "/" set {_t::1} to {_t::1} parsed as number set {_t::2} to {_t::2} parsed as number set {_t::3} to {_t::3} parsed as number+2000 execute player command "/jour %{_t::2}% %{_t::1}% %{_t::3}%" else if command is "calendrier": cancel event set {_a::*} to arguments split by " " if {_a::1} is set: if {_a::2} parsed as number is set: # /MM /YY set {_MM} to {_a::1} parsed as number set {_YY} to {_a::2} parsed as number set {_i::*} to "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi" and "Dimanche" loop all numbers between 1 and nbMY({_MM},{_YY}): set {_N} to loop-number loop {_i::*}: if loop-value-2 is JDay(G({_MM},{_N},{_YY})): add {_N} to {_i::%loop-index%::*} set {_NAME} to "{@gui name}" replace all "<M>" with "%MMonth({_MM})%" in {_NAME} if {_MM} is smaller than 10: replace all "<MM>" with "0%{_MM}%" in {_NAME} else: replace all "<MM>" with "%{_MM}%" in {_NAME} replace all "<YY>" with "%{_YY}%" in {_NAME} open virtual chest inventory with size 6 named "%{_NAME}%" to player loop 7 times: loop {_i::%loop-value%::*}: if loop-value-2 is 1: set {_S} to loop-value-1 loop {_i::%loop-value%::*}: if loop-value-2 parsed as number - {_S} < 0: format gui slot loop-value-1 + (loop-index parsed as number-1) * 9 of player with loop-value-2 of glass pane named "%{_i::%loop-value-1%}% %loop-value-2%" else: format gui slot loop-value-1 + loop-index parsed as number * 9 of player with loop-value-2 of glass pane named "%{_i::%loop-value-1%}% %loop-value-2%" if {_MM} is not 1: format gui slot 45 of player with paper named "§fMois précédent" to run player command "/%command% %{_MM}-1% %{_YY}%" if {_MM} is not 12: format gui slot 53 of player with paper named "§fMois suivant" to run player command "/%command% %{_MM}+1% %{_YY}%" else: format gui slot 53 of player with paper named "§fMois suivant" to run player command "/%command% 1 %{_YY}+1%" stop format gui slot 45 of player with paper named "§fMois précédent" to run player command "/%command% 12 %{_YY}-1%" format gui slot 53 of player with paper named "§fMois suivant" to run player command "/%command% %{_MM}+1% %{_YY}%" else: execute player command "/calendrier" else: set {_n} to "%now%" set {_t::*} to first element of {_n} split by " " split by "/" set {_t::2} to {_t::2} parsed as number set {_t::3} to {_t::3} parsed as number+2000 execute player command "/calendrier %{_t::2}% %{_t::3}%" Plus besoin de faire (J+1).
-
Cela marche et je vais te le prouver:
-
C'est déjà le cas, limite changer le message et puis c'est tout. send "Il est %JJour(Julien({_a::1} parsed as number,{_a::2} parsed as number,{_a::3} parsed as number))%"
-
Très bonne question, c'est le jour julien dans le calendrier grégorien. J'ai changé et j'ai mis "G" comme "Grégorien" et "JJour" c'est comme "Jour Julien". Ici.
-
Je vais te le faire, sans aucune API hihi:p:p Testé, aucun add-on nécessaire: function G(MM:number,DD:number,YY:number) :: number: if {_MM} > 2: set {_y} to {_YY} set {_m} to {_MM} if {_MM} is 1 or 2: set {_y} to {_YY}-1 set {_m} to {_MM}+12 set {_B} to 0 if {_YY} > 1582: if {_MM} > 10: if {_DD} > 15: set {_A} to floor({_y}/100) set {_B} to 2-{_A}+floor({_A}/4) return floor(365.25*{_y})+floor(30.6001*({_m}+1))+{_DD}+1720994.5+{_B} function JJour(JJ:number) :: string: set {_a} to {_JJ}+1.5 set {_r} to {_a}-7 while {_r} > 7: remove 7 from {_r} set {_d::*} to "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi" and "Dimanche" return {_d::%{_r}%} on command: if command is "jour": cancel event set {_a::*} to arguments split by " " if {_a::1} is set: if {_a::2} parsed as number is set: if {_a::3} parsed as number is set: # /MM /DD /YY if {_a::1} parsed as number is smaller or equal to 12: send "%JJour(G({_a::1} parsed as number,{_a::2} parsed as number,{_a::3} parsed as number))%" else: set {_n} to "%now%" set {_t::*} to first element of {_n} split by " " split by "/" loop {_t::*}: set {_t::%loop-index%} to loop-value parsed as number if loop-index parsed as number is 1: set {_t::%loop-index%} to {_t::%loop-index%}+1 if loop-index parsed as number is 3: set {_t::%loop-index%} to {_t::%loop-index%}+2000 execute player command "/jour %{_t::2}% %{_t::1}% %{_t::3}%" Je demande pas souvent des "likes" mais ca fait plaisir quand on se casse la tête pendant plusieurs minutes. ;) [Fusion de deux messages]
-
command /chatest [<text="chat.txt">]: trigger: loop (line count of file "%arg%") times: wait a second set {_line} to line loop-value in file "%arg%" broadcast "%{_line}%" SkUtilities.
-
on command: if "%command%" is "%{chest}%": cancel event # code
-
function index(x:text="") :: objects: loop {claims::*}: loop {claims::%loop-value%::*}: add loop-value-2 to {_result::*} return {_result::*} function randomIndex(s:number) :: string: set {_char} to "abcdefghijklmnopqrstuvwxzABCDEFGHIJKLMNOPQRSTUVWXZ0123456789" loop {_s} times: add a random element of {_char} split by "" to {_result::*} return join {_result::*} function claimsof(uuid:string) :: objects: return {claims::%{_uuid}%::*} function claimat(location:location,world:world) :: object: loop {claims::*}: loop {claims::%loop-value%::*}: set {_c} to {claims::%loop-value-1%::%loop-value-2%::1} set {_c2} to {claims::%loop-value-1%::%loop-value-2%::2} if {claims::%loop-value-1%::%loop-value-2%::world} is {_world}: if {_location} is within {_c} to {_c2}: return loop-value-2 return false function claimof(location:location,world:world) :: object: set {_i} to claimat({_location},{_world}) loop {claims::*}: if {claims::%loop-value-1%::%{_i}%} is set: return loop-value-1 return false function accessat(location:location,world:world) :: objects: loop {claims::*}: loop {claims::%loop-value%::*}: set {_c} to {claims::%loop-value-1%::%loop-value-2%::1} set {_c2} to {claims::%loop-value-1%::%loop-value-2%::2} if {claims::%loop-value-1%::%loop-value-2%::world} is {_world}: if {_location} is within {_c} to {_c2}: add loop-value-1 to {_result::*} add {claims::%loop-value-1%::%loop-value-2%::players::*} to {_result::*} return {_result::*} return false function canEdit(uuid:string,location:location,world:world) :: boolean: if claimat({_location},{_world}) is not false: loop accessat({_location},{_world}): if loop-value is {_uuid}: return true if offline player from {_uuid} has permission "edit.another": return true return false return true command /claim <integer> <integer>: trigger: set {_corner} to location x-location of block at player-(int-arg-1), 256, z-location of block at player-(int-arg-2) of world of player set {_corner2} to location x-location of block at player+(int-arg-1), 0, z-location of block at player+(int-arg-2) of world of player loop {claims::*}: loop {claims::%loop-value%::*}: set {_world} to {claims::%loop-value-1%::%loop-value-2%::world} set {_c} to {claims::%loop-value-1%::%loop-value-2%::1} set {_c2} to {claims::%loop-value-1%::%loop-value-2%::2} set {_c3} to location x-location of {_c}, 256, z-location of {_c2} of {_world} set {_c4} to location x-location of {_c2}, 0, z-location of {_c} of {_world} if {_world} is world of player: if {_c} is within {_corner} to {_corner2}: send "§cLa région appartient au joueur:§7 %offline player from loop-value-1%§c." to player stop if {_c2} is within {_corner} to {_corner2}: send "§cLa région appartient au joueur:§7 %offline player from loop-value-1%§c." to player stop if {_c3} is within {_corner} to {_corner2}: send "§cLa région appartient au joueur:§7 %offline player from loop-value-1%§c." to player stop if {_c4} is within {_corner} to {_corner2}: send "§cLa région appartient au joueur:§7 %offline player from loop-value-1%§c." to player stop set {_r} to randomIndex(10) while "%index()%" contains "%{_r}%": set {_r} to randomIndex(10) send "§aLa région est protégée et enregistrée dans vos régions en tant que:§f %{_r}%§a." to player set {claims::%uuid of player%::%{_r}%} to {_r} set {claims::%uuid of player%::%{_r}%::1} to {_corner} set {claims::%uuid of player%::%{_r}%::2} to {_corner2} set {claims::%uuid of player%::%{_r}%::world} to world of player command /unclaim: trigger: if claimat(location of player,world) is not false: set {_claim} to claimat(location of player,world) set {_owner} to claimof(location of player,world) set {_c} to {claims::%{_owner}%::%{_claim}%::1} set {_c2} to {claims::%{_owner}%::%{_claim}%::2} if {claims::%{_owner}%::%{_claim}%::world} is world of player: if block at player is within {_c} to {_c2}: if {_owner} is uuid of player: set {_o} to true else if player has permission "unclaim.another": set {_o} to true if {_o} is true: send "§aLa région qui était enregistrée en tant que:§f %{_claim}%§a, a été supprimée." to player delete {claims::%{_owner}%::%{_claim}%::players::*} delete {claims::%{_owner}%::%{_claim}%::1} delete {claims::%{_owner}%::%{_claim}%::2} delete {claims::%{_owner}%::%{_claim}%::world} delete {claims::%{_owner}%::%{_claim}%} stop send "§cVous ne possédez pas les droits pour supprimer la région:§7 %{_claim}%§c, appartenant au joueur:§7 %offline player from {_owner}%§c." to player stop send "§cVous n'êtes pas dans une région." to player command /claimadd <player>: trigger: if claimat(location of player,world) is not false: set {_claim} to claimat(location of player,world) set {_owner} to claimof(location of player,world) set {_c} to {claims::%{_owner}%::%{_claim}%::1} set {_c2} to {claims::%{_owner}%::%{_claim}%::2} if {claims::%{_owner}%::%{_claim}%::world} is world of player: if block at player is within {_c} to {_c2}: if {_owner} is uuid of player: set {_o} to true else if player has permission "invite.another": set {_o} to true if {_o} is true: if {claims::%{_owner}%::%{_claim}%::players::%uuid of arg%} is not set: if arg is not player: set {claims::%{_owner}%::%{_claim}%::players::%uuid of arg%} to uuid of arg send "§aLe joueur:§f %arg%§a, a été ajouté dans la région:§f %{_claim}%§a." to player else: send "§cVous ne pouvez pas vous inviter vous-même." to player stop send "§cLe joueur:§7 %arg%§c, est dans cette région." to player stop send "§cVous ne possédez pas les droits pour ajouter des joueurs dans la région:§7 %{_claim}%§c, appartenant au joueur:§7 %offline player from {_owner}%§c." to player stop send "§cVous n'êtes pas dans une région." to player command /claimremove <offline player>: trigger: if claimat(location of player,world) is not false: set {_claim} to claimat(location of player,world) set {_owner} to claimof(location of player,world) set {_c} to {claims::%{_owner}%::%{_claim}%::1} set {_c2} to {claims::%{_owner}%::%{_claim}%::2} if {claims::%{_owner}%::%{_claim}%::world} is world of player: if block at player is within {_c} to {_c2}: if {_owner} is uuid of player: set {_o} to true else if player has permission "kick.another": set {_o} to true if {_o} is true: if {claims::%{_owner}%::%{_claim}%::players::%uuid of arg%} is set: if arg is not player: delete {claims::%{_owner}%::%{_claim}%::players::%uuid of arg%} send "§aLe joueur:§f %arg%§a, a été retiré de la région:§f %{_claim}%§a." to player else: send "§cVous ne pouvez pas vous exclure vous-même." to player stop send "§cLe joueur:§7 %arg%§c, n'est pas dans cette région." to player stop send "§cVous ne possédez pas les droits pour exclure des joueurs de la région:§7 %{_claim}%§c, appartenant au joueur:§7 %offline player from {_owner}%§c." to player stop send "§cVous n'êtes pas dans une région." to player break: cancel event if canEdit(uuid of player,event-location,world) is true: uncancel event place: cancel event if canEdit(uuid of player,event-location,world) is true: uncancel event rightclick on door item or chest or trapped chest or furnace or ender chest or note block or dispenser or dropper or anvil or enchantment table or hopper or crafting table or bed: cancel event if canEdit(uuid of player,event-location,world) is true: uncancel event on join: while player is online: set {_claim} to claimat(location of block at player,world) while claimat(location of block at player,world) is {_claim}: wait 3 ticks if claimat(location of block at player,world) is not false: show an action bar from string "§fEntering:§a %claimat(location of block at player,world)%" to player else: show an action bar from string "§fLeaving:§a %{_claim}%" to player Skelett,SkQuery. J'ai testé.
-
death: attacker is a player victim is a player set death message to "" loop all players: execute console command "/tellraw %loop-player% ["""",{""text"":""%victim% à été tuer par %attacker% avec ""},{""text"":""%name of tool of attacker%"",""hoverEvent"":{""action"":""show_text"",""value"":""%tool of attacker%""}}]"
-
Ended. function bigger(numbers:numbers) :: number: loop {_numbers::*}: if {_max} is not set: set {_max} to loop-value else if loop-value is bigger or equal to {_max}: set {_max} to loop-value return {_max} function smaller(numbers:numbers) :: number: loop {_numbers::*}: if {_min} is not set: set {_min} to loop-value else if loop-value is smaller or equal to {_min}: set {_min} to loop-value return {_min} function index(x:text="") :: objects: loop {claims::*}: loop {claims::%loop-value%::*}: add loop-value-2 to {_result::*} return {_result::*} function randomIndex(s:number) :: string: set {_char} to "abcdefghijklmnopqrstuvwxzABCDEFGHIJKLMNOPQRSTUVWXZ0123456789" loop {_s} times: add a random element of {_char} split by "" to {_result::*} return join {_result::*} function canEdit(p:player,uuid:string,loc:location) :: boolean: loop {claims::*}: loop {claims::%loop-value%::*}: set {_c} to {claims::%loop-value-1%::%loop-value-2%::1} set {_c2} to {claims::%loop-value-1%::%loop-value-2%::2} if {claims::%loop-value-1%::%loop-value-2%::world} is world of {_p}: if {_loc} is within {_c} to {_c2}: if loop-value-1 is {_uuid}: set {_o} to true else if {_p} has permission "unclaim.another": set {_o} to true else if {claims::%loop-value-1%::%loop-value-2%::players::%{_uuid}%} is set: set {_o} to true if {_o} is true: return true stop return false stop return true command /claim <integer> <integer>: trigger: if {claims::%uuid of player%} is not set: set {claims::%uuid of player%} to uuid of player set {_corner} to location x-location of block at player-(int-arg-1), 256, z-location of block at player-(int-arg-2) of world of player set {_corner2} to location x-location of block at player+(int-arg-1), 0, z-location of block at player+(int-arg-2) of world of player set {_x::*} to x-location of block at player-(int-arg-1) and x-location of block at player+(int-arg-1) set {_z::*} to z-location of block at player-(int-arg-2) and z-location of block at player-(int-arg-2) loop {claims::*}: loop {claims::%loop-value%::*}: set {_world} to {claims::%loop-value-1%::%loop-value-2%::world} set {_c} to {claims::%loop-value-1%::%loop-value-2%::1} set {_c2} to {claims::%loop-value-1%::%loop-value-2%::2} set {_c3} to location x-location of {_c}, 256, z-location of {_c2} of {_world} set {_c4} to location x-location of {_c2}, 0, z-location of {_c} of {_world} if {_world} is world of player: if {_c} is within {_corner} to {_corner2}: send "§cLa région appartient au joueur:§7 %offline player from loop-value-1%§c." to player stop if {_c2} is within {_corner} to {_corner2}: send "§cLa région appartient au joueur:§7 %offline player from loop-value-1%§c." to player stop if {_c3} is within {_corner} to {_corner2}: send "§cLa région appartient au joueur:§7 %offline player from loop-value-1%§c." to player stop if {_c4} is within {_corner} to {_corner2}: send "§cLa région appartient au joueur:§7 %offline player from loop-value-1%§c." to player stop set {_r} to randomIndex(10) while "%index()%" contains "%{_r}%": set {_r} to randomIndex(10) send "§aLa région est protégée et enregistrée dans vos régions en tant que:§f %{_r}%§a." to player set {claims::%uuid of player%::%{_r}%} to {_r} set {claims::%uuid of player%::%{_r}%::1} to {_corner} set {claims::%uuid of player%::%{_r}%::2} to {_corner2} set {claims::%uuid of player%::%{_r}%::world} to world of player command /unclaim: trigger: loop {claims::*}: loop {claims::%loop-value%::*}: set {_c} to {claims::%loop-value-1%::%loop-value-2%::1} set {_c2} to {claims::%loop-value-1%::%loop-value-2%::2} if {claims::%loop-value-1%::%loop-value-2%::world} is world of player: if block at player is within {_c} to {_c2}: if loop-value-1 is uuid of player: set {_o} to true else if player has permission "unclaim.another": set {_o} to true if {_o} is true: send "§aLa région qui était enregistrée en tant que:§f %loop-value-2%§a, a été supprimée." to player delete {claims::%loop-value-1%::%loop-value-2%::players::*} delete {claims::%loop-value-1%::%loop-value-2%::1} delete {claims::%loop-value-1%::%loop-value-2%::2} delete {claims::%loop-value-1%::%loop-value-2%::world} delete {claims::%loop-value-1%::%loop-value-2%} stop send "§cVous ne possédez pas les droits pour supprimer la région:§7 %loop-value-2%§c, appartenant au joueur:§7 %offline player from loop-value-1%§c." to player stop send "§cVous n'êtes pas dans une région." to player command /claimadd <player>: trigger: loop {claims::*}: loop {claims::%loop-value%::*}: set {_c} to {claims::%loop-value-1%::%loop-value-2%::1} set {_c2} to {claims::%loop-value-1%::%loop-value-2%::2} if {claims::%loop-value-1%::%loop-value-2%::world} is world of player: if block at player is within {_c} to {_c2}: if loop-value-1 is uuid of player: set {_o} to true else if player has permission "invite.another": set {_o} to true if {_o} is true: if {claims::%loop-value-1%::%loop-value-2%::players::%uuid of arg%} is not set: if arg is not player: set {claims::%loop-value-1%::%loop-value-2%::players::%uuid of arg%} to uuid of arg send "§aLe joueur:§f %arg%§a, a été ajouté dans la région:§f %loop-value-2%§a." to player else: send "§cVous ne pouvez pas vous inviter vous-même." to player send "§cLe joueur:§7 %arg%§c, est dans cette région." to player stop send "§cVous ne possédez pas les droits pour ajouter des joueurs dans la région:§7 %loop-value-2%§c, appartenant au joueur:§7 %offline player from loop-value-1%§c." to player stop send "§cVous n'êtes pas dans une région." to player command /claimremove <offline player>: trigger: loop {claims::*}: loop {claims::%loop-value%::*}: set {_c} to {claims::%loop-value-1%::%loop-value-2%::1} set {_c2} to {claims::%loop-value-1%::%loop-value-2%::2} if {claims::%loop-value-1%::%loop-value-2%::world} is world of player: if block at player is within {_c} to {_c2}: if loop-value-1 is uuid of player: set {_o} to true else if player has permission "kick.another": set {_o} to true if {_o} is true: if {claims::%loop-value-1%::%loop-value-2%::players::%uuid of arg%} is set: if arg is not player: delete {claims::%loop-value-1%::%loop-value-2%::players::%uuid of arg%} send "§aLe joueur:§f %arg%§a, a été retiré de la région:§f %loop-value-2%§a." to player else: send "§cVous ne pouvez pas vous exclure vous-même." to player send "§cLe joueur:§7 %arg%§c, n'est pas dans cette région." to player stop send "§cVous ne possédez pas les droits pour exclure des joueurs de la région:§7 %loop-value-2%§c, appartenant au joueur:§7 %offline player from loop-value-1%§c." to player stop send "§cVous n'êtes pas dans une région." to player break: cancel event if canEdit(player,uuid of player,event-location) is true: uncancel event place: cancel event if canEdit(player,uuid of player,event-location) is true: uncancel event rightclick on door item or chest or trapped chest or furnace or ender chest or note block or dispenser or dropper or anvil or enchantment table or hopper or crafting table or bed: cancel event if canEdit(player,uuid of player,event-location) is true: uncancel event 0 lag, taille infinie. # EDIT
-
Les coordonnées de deux coins opposés, le principe d'un cuboid.
-
Faisable sans aucun lag avec n'importe quelle taille, je vais te le faire.
-
SkRayFall.
-
Ca te dirait pas de faire un seul exercice plus long et plus dur que tous les exercices réunis ici ?
-
Tu as HolographicsDisplay ?
-
Voici un algorithme pour créer une sphère dans minecraft: Premièrement, voici une sphère: [ATTACH=full]8086[/ATTACH] Rien de plus classique, mais une forme complexe n'est-ce pas ? Après quelques recherches, il est facilement possible de récupérer un algorithme qui permet de créer des disques ou des cercles: Algorithmes de Bresenham et Andres. Dans mes algorithmes qui sont des fonctions je vais simplement récupérer les locations dans une liste: Pour les intéressés, j'ai refait Bresenham et Andres sous forme de fonction return. [spoiler=Bresenham, Andres][spoiler=Cercle Bresenham] function bresenham(radius:number,location:location,world:world) :: locations: set {_x} to 0 set {_z} to {_radius} set {_m} to 5-4*{_radius} while {_x} <= {_z}: add location {_x}+x-location of {_location}, y-location of {_location}-1, {_z}+z-location of {_location} of {_world} to {_locations::*} add location {_z}+x-location of {_location}, y-location of {_location}-1, {_x}+z-location of {_location} of {_world} to {_locations::*} add location -1*{_x}+x-location of {_location}, y-location of {_location}-1, {_z}+z-location of {_location} of {_world} to {_locations::*} add location -1*{_z}+x-location of {_location}, y-location of {_location}-1, {_x}+z-location of {_location} of {_world} to {_locations::*} add location {_x}+x-location of {_location}, y-location of {_location}-1, -1*{_z}+z-location of {_location} of {_world} to {_locations::*} add location {_z}+x-location of {_location}, y-location of {_location}-1, -1*{_x}+z-location of {_location} of {_world} to {_locations::*} add location -1*{_x}+x-location of {_location}, y-location of {_location}-1, -1*{_z}+z-location of {_location} of {_world} to {_locations::*} add location -1*{_z}+x-location of {_location}, y-location of {_location}-1, -1*{_x}+z-location of {_location} of {_world} to {_locations::*} if {_m} > 0: remove 1 from {_z} set {_m} to {_m}-8*{_z} add 1 to {_x} set {_m} to {_m}+8*{_x}+4 return {_locations::*} [spoiler= Cercle Andres] function andres(radius:number,location:location,world:world) :: locations: set {_x} to 0 set {_z} to {_radius} set {_d} to {_radius}-1 while {_z} >= {_x}: add location x-location of {_location}+{_x}, y-location of {_location}-1, z-location of {_location}+{_z} of {_world} to {_locations::*} add location x-location of {_location}+{_z}, y-location of {_location}-1, z-location of {_location}+{_x} of {_world} to {_locations::*} add location x-location of {_location}-{_x}, y-location of {_location}-1, z-location of {_location}+{_z} of {_world} to {_locations::*} add location x-location of {_location}-{_z}, y-location of {_location}-1, z-location of {_location}+{_x} of {_world} to {_locations::*} add location x-location of {_location}+{_x}, y-location of {_location}-1, z-location of {_location}-{_z} of {_world} to {_locations::*} add location x-location of {_location}+{_z}, y-location of {_location}-1, z-location of {_location}-{_x} of {_world} to {_locations::*} add location x-location of {_location}-{_x}, y-location of {_location}-1, z-location of {_location}-{_z} of {_world} to {_locations::*} add location x-location of {_location}-{_z}, y-location of {_location}-1, z-location of {_location}-{_x} of {_world} to {_locations::*} if {_d} >= 2*{_x}: set {_d} to {_d}-2*{_x}-1 add 1 to {_x} else if {_d} < 2*({_radius}-{_z}): set {_d} to {_d}+2*{_z}-1 remove 1 from {_z} else: set {_d} to {_d}+2*({_z}-{_x}-1) remove 1 from {_z} add 1 to {_x} return {_locations::*} [spoiler=Disque Andres] function disk(radius:number,location:location,world:world) :: locations: set {_x} to x-location of {_location}+{_radius} set {_y} to rounded down z-location of {_location}+{_radius} set {_d} to {_radius}-1 set {_a} to {_radius}-1 set {_b} to 0 while {_a} >= {_b}: loop all integers between {_y}-{_a} and {_y}+{_a}: add location {_x}+{_b}-{_radius}, y-location of {_location}-1, loop-integer+0.5-{_radius} of {_world} to {_locations::*} loop all integers between {_y}-{_b} and {_y}+{_b}: add location {_x}+{_a}-{_radius}, y-location of {_location}-1, loop-integer+0.5-{_radius} of {_world} to {_locations::*} loop all integers between {_y}-{_a} and {_y}+{_a}: add location -1*{_radius}+{_x}-{_b}, y-location of {_location}-1, loop-integer+0.5-{_radius} of {_world} to {_locations::*} loop all integers between {_y}-{_b} and {_y}+{_b}: add location -1*{_radius}+{_x}-{_a}, y-location of {_location}-1, loop-integer+0.5-{_radius} of {_world} to {_locations::*} if {_d} >= 2*{_b}: set {_d} to {_d}-2*{_b}-1 add 1 to {_b} else if {_d} < 2*({_radius}-{_a}): set {_d} to {_d}+2*{_a}-1 remove 1 from {_a} else: set {_d} to {_d}+2*({_a}-{_b}-1) remove 1 from {_a} add 1 to {_b} return {_locations::*} Passons à notre sphère: Première chose à "savoir", une sphère de rayon r, est contenu dans un cube de côté 2r. Le centre O, est aussi le centre de notre cube. En géométrie cartésienne, une sphère de centre (x0,y0,z0) et de rayon r est l'ensemble des points (x,y,z) tel que: L'algorithme: r = rayon x0 = position x du centre y0 = position y du centre z0 = position z du centre on se place dans deux coins opposés du cuboid de côté 2r de centre (x0,y0,z0) créer une liste de position contenant les blocs de notre cuboid saisir cette liste: x = position x du bloc y = position y du bloc z = position z du bloc si la difference entre (x-x0)²+(y-y0)²+(z-z0)² et r² < r: ajouter les positions de ce bloc à notre liste finale renvoyer la liste finale En skript: Plusieurs étapes nécessaires: Récupérer un cuboid en format texte Récupérer les locations d'un cuboid [spoiler=Cuboid sous format texte] function bigger(numbers:numbers) :: number: loop {_numbers::*}: if {_max} is not set: set {_max} to loop-value else if loop-value is bigger or equal to {_max}: set {_max} to loop-value return {_max} function smaller(numbers:numbers) :: number: loop {_numbers::*}: if {_min} is not set: set {_min} to loop-value else if loop-value is smaller or equal to {_min}: set {_min} to loop-value return {_min} function cuboid(corner:location,corner2:location,world:world) :: text: set {_x::*} to rounded down x-location of {_corner} and rounded down x-location of {_corner2} set {_y::*} to rounded down y-location of {_corner} and rounded down y-location of {_corner2} set {_z::*} to rounded down z-location of {_corner} and rounded down z-location of {_corner2} add bigger({_x::*}) to {_c::*} add bigger({_y::*}) to {_c::*} add bigger({_z::*}) to {_c::*} add smaller({_x::*}) to {_c::*} add smaller({_y::*}) to {_c::*} add smaller({_z::*}) to {_c::*} return "%{_c::1}%,%{_c::4}%,%{_c::2}%,%{_c::5}%,%{_c::3}%,%{_c::6}%,%{_world}%" [spoiler=Locations du cuboid] function cuboids(cuboid:text) :: locations: loop {_cuboid} split by ",": if loop-value parsed as number is set: add loop-value parsed as number to {_c::*} else: set {_world} to loop-value parsed as world loop all numbers between {_c::2} and {_c::1}: loop all numbers between {_c::4} and {_c::3}: loop all numbers between {_c::6} and {_c::5}: add location loop-number-1, loop-number-2, loop-number-3 of {_world} to {_locations::*} return {_locations::*} [spoiler=Fonction finale] function sphere(radius:number,center:location,world:world) :: locations: set {_corner} to location x-location of {_center}+{_radius}, y-location of {_center}+{_radius}, z-location of {_center}+{_radius} of {_world} set {_corner2} to location x-location of {_center}-{_radius}, y-location of {_center}-{_radius}, z-location of {_center}-{_radius} of {_world} set {_x0} to x-location of {_center} set {_y0} to y-location of {_center} set {_z0} to z-location of {_center} loop cuboids(cuboid({_corner},{_corner2},{_world})): set {_x} to x-location of loop-value+0.5 set {_y} to y-location of loop-value+0.5 set {_z} to z-location of loop-value+0.5 if difference between ({_x}-{_x0})^2+({_y}-{_y0})^2+({_z}-{_z0})^2 and {_radius}^2 is smaller than {_radius}: add loop-value to {_locations::*} return {_locations::*} Bonne utilisation.
-
[SkDragon] Comment faire un cercle instantané ?
McLincoln2 a répondu à un(e) question de __MonsterKid__ dans Inactifs
Essaie ca: loop andres(1,location of block at player,world): drawLine particle flame, center loop-value, id "1", solid true, density 20, length 1, zigZag count 0, height 1, visibleRange 32, displacementXYZ 0, 0.1, 0, pulseDelay 0 Ou: loop bresenham(1,location of block at player,world): drawLine particle flame, center loop-value, id "1", solid true, density 20, length 1, zigZag count 0, height 1, visibleRange 32, displacementXYZ 0, 0.1, 0, pulseDelay 0 -
[SkDragon] Comment faire un cercle instantané ?
McLincoln2 a répondu à un(e) question de __MonsterKid__ dans Inactifs
Voici les deux algorithmes si tu les veux ils ne demandent aucun add-ons, on travaille uniquement avec les coordonnées X,Y et Z du centre et le rayon R. function bresenham(radius:number,location:location,world:world) :: locations: set {_x} to 0 set {_z} to {_radius} set {_m} to 5-4*{_radius} while {_x} <= {_z}: add location {_x}+x-location of {_location}, y-location of {_location}-1, {_z}+z-location of {_location} of {_world} to {_locations::*} add location {_z}+x-location of {_location}, y-location of {_location}-1, {_x}+z-location of {_location} of {_world} to {_locations::*} add location -1*{_x}+x-location of {_location}, y-location of {_location}-1, {_z}+z-location of {_location} of {_world} to {_locations::*} add location -1*{_z}+x-location of {_location}, y-location of {_location}-1, {_x}+z-location of {_location} of {_world} to {_locations::*} add location {_x}+x-location of {_location}, y-location of {_location}-1, -1*{_z}+z-location of {_location} of {_world} to {_locations::*} add location {_z}+x-location of {_location}, y-location of {_location}-1, -1*{_x}+z-location of {_location} of {_world} to {_locations::*} add location -1*{_x}+x-location of {_location}, y-location of {_location}-1, -1*{_z}+z-location of {_location} of {_world} to {_locations::*} add location -1*{_z}+x-location of {_location}, y-location of {_location}-1, -1*{_x}+z-location of {_location} of {_world} to {_locations::*} if {_m} > 0: remove 1 from {_z} set {_m} to {_m}-8*{_z} add 1 to {_x} set {_m} to {_m}+8*{_x}+4 return {_locations::*} function andres(radius:number,location:location,world:world) :: locations: set {_x} to 0 set {_z} to {_radius} set {_d} to {_radius}-1 while {_z} >= {_x}: add location x-location of {_location}+{_x}, y-location of {_location}-1, z-location of {_location}+{_z} of {_world} to {_locations::*} add location x-location of {_location}+{_z}, y-location of {_location}-1, z-location of {_location}+{_x} of {_world} to {_locations::*} add location x-location of {_location}-{_x}, y-location of {_location}-1, z-location of {_location}+{_z} of {_world} to {_locations::*} add location x-location of {_location}-{_z}, y-location of {_location}-1, z-location of {_location}+{_x} of {_world} to {_locations::*} add location x-location of {_location}+{_x}, y-location of {_location}-1, z-location of {_location}-{_z} of {_world} to {_locations::*} add location x-location of {_location}+{_z}, y-location of {_location}-1, z-location of {_location}-{_x} of {_world} to {_locations::*} add location x-location of {_location}-{_x}, y-location of {_location}-1, z-location of {_location}-{_z} of {_world} to {_locations::*} add location x-location of {_location}-{_z}, y-location of {_location}-1, z-location of {_location}-{_x} of {_world} to {_locations::*} if {_d} >= 2*{_x}: set {_d} to {_d}-2*{_x}-1 add 1 to {_x} else if {_d} < 2*({_radius}-{_z}): set {_d} to {_d}+2*{_z}-1 remove 1 from {_z} else: set {_d} to {_d}+2*({_z}-{_x}-1) remove 1 from {_z} add 1 to {_x} return {_locations::*} -
[SkDragon] Comment faire un cercle instantané ?
McLincoln2 a répondu à un(e) question de __MonsterKid__ dans Inactifs
Tu peux utiliser l'algorithme de bresenham ou celui de andres. J'essaie de te faire ça en rentrant. -
[SkDragon] Comment faire un cercle instantané ?
McLincoln2 a répondu à un(e) question de __MonsterKid__ dans Inactifs
J'ai trouvé peut-être des syntaxes: draw[simple]Halo particle %string%[[, material] %-itemstack%][, speed %-number%][, ([offset]XYZ|RGB) %-number%, %-number%, %-number%], center %object%, id %string%[, isSingle %-boolean%, %-player%][, r[ainbow]M[ode] %-boolean%][, solid %-boolean%][, density %-number%], visibleRange %number%[, tps %-number%, second %-number%] drawHalo particle "redstone", RGB 0, 0, 0, center player, id "%player%", rainbowMode true, solid true, visibleRange 32 drawRings particle %string%[, material %-itemstack%][, speed %-number%][, ([offset]XYZ|RGB) %-number%, %-number%, %-number%], center %entity/location%, id %string%[, isSingle %-boolean%, %-player%][, r[ainbow]M[ode] %-boolean%], randomRotation %boolean%, animated %boolean%, radius %number%, ringCount %number%, ringDensity %number%, visibleRange %number%[, rot[ation]XYZ %-number%, %-number%, %-number%][, dis[placement]XYZ %-number%, %-number%, %-number%][, pulseDelay %-number%] command /rings [<boolean>] [<boolean>]: trigger: drawRings particle "redstone", RGB 80, 255, 255, center player, id "%player%", rainbowMode true, randomRotation arg-1, animated arg-2, radius 1, ringCount 4, ringDensity 10, visibleRange 32, pulseDelay 2 SKDRAGON 1.0 EFFECTS drawLine particle %particlename%[, material %itemstack%][, speed %number%][, ([offset]XYZ|RGB) %number%, %number%, %number%], center %entity/location%[, target %entity/location%], id %string%[, onlyFor %players%][, r[ainbow]M[ode] %boolean%][, solid %boolean%][, density %number%][, length %-number%][, zigZag count %number%, height %number%], visibleRange %number%[, dis[placement]XYZ %number%, %number%, %number%][, pulseDelay %number%] drawLine particle redstone, center player, target location of target block, id "%player%", rainbowMode true, solid true, density 5, length 6, zigZag count 0, height 0, visibleRange 32, displacementXYZ 0, 1, 0, pulseDelay 1 drawLine particle redstone, center player, id "%player%", rainbowMode true, solid true, density 5, length 6, zigZag count 0, height 0, visibleRange 32, displacementXYZ 0, 1, 0, pulseDelay 1 drawLine particle redstone, center player, target location of target block, id "%player%", rainbowMode true, solid true, density 10, length 0, zigZag count 1, height 0, visibleRange 32, displacementXYZ 0, 1, 0, pulseDelay 1 -
Il y a un problème encore, si tu as plus de 54 joueurs que se passe-t-il ?
-
[SkDragon] Comment faire un cercle instantané ?
McLincoln2 a répondu à un(e) question de __MonsterKid__ dans Inactifs
Je sais pas si ça va t'aider, mais ici il dessine des lignes de longueur X autour du joueur, essaie peut être de faire pareil avec une longueur de 1. -
McLincoln2 updated Scoreboards with a new update entry: Correction Read the rest of this update entry...
-
McLincoln2 updated Scoreboards with a new update entry: Vos propres variables Read the rest of this update entry...