Skocz do zawartości
  • 0

Fajerwerki


xXx_Xpedii_xXx
 Udostępnij

Pytanie

19 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
3 minuty temu, xXx_Xpedii_xXx napisał:

Skrypt Ktory Losowo Od Danej Kratki Spawnuje Losowe Fajerwerki co 1 sekunde

cos w tym stylu

every 1 second:
    puść 1 fajerwerke od tej kratki <> do tej <>

:D 

Przyjmuję to jako zlecenie, a więc proszę, oto skrypt.

W przedostatniej linijce ustawiasz (minimalny koordynat X, maksymalny X, minimalny Z, maksymalny Z, nazwę świata).

function getRandomLoc(xmin: integer=-1000, xmax: integer=1000, zmin: integer=-1000, zmax: integer=1000, world: text="world") :: location:
	while {_return} is not set:
		set {_x} to random integer between {_xmin} and {_xmax}
		set {_z} to random integer between {_zmin} and {_zmax}
		set {_loc} to highest block at location at {_x}, 0, {_z} in world ({_world} parsed as world)
		if block at {_loc} != lava or water:
			add 1 to y-loc of {_loc}
			if (block at {_loc}) and (block above block at {_loc}) != lava:
				set {_return} to {_loc}
	return {_return}

every 1 second:
	set {_allColours::*} to red, dark red, yellow, orange, aqua, light aqua and lime
	loop 3 times:
		add (random element out of {_allColours::*}) to {_colours::*} 
	set {_loc} to getRandomLoc(-1000, 1000, -1000, 1000, "nazwa_twojego_swiata")
	launch firework large ball coloured {_colours::*} at {_loc} with duration (random integer between 1 and 3)

 

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
1 minutę temu, Kormic napisał:

Przyjmuję to jako zlecenie, a więc proszę, oto skrypt.

W przedostatniej linijce ustawiasz (minimalny koordynat X, maksymalny X, minimalny Z, maksymalny Z, nazwę świata).

function getRandomLoc(xmin: integer=-1000, xmax: integer=1000, zmin: integer=-1000, zmax: integer=1000, world: text="world") :: location:
	while {_return} is not set:
		set {_x} to random integer between {_xmin} and {_xmax}
		set {_z} to random integer between {_zmin} and {_zmax}
		set {_loc} to highest block at location at {_x}, 0, {_z} in world ({_world} parsed as world)
		if block at {_loc} != lava or water:
			add 1 to y-loc of {_loc}
			if (block at {_loc}) and (block above block at {_loc}) != lava:
				set {_return} to {_loc}
	return {_return}

every 1 second:
	set {_allColours::*} to red, dark red, yellow, orange, aqua, light aqua and lime
	loop 3 times:
		add (random element out of {_allColours::*}) to {_colours::*} 
	set {_loc} to getRandomLoc(-1000, 1000, -1000, 1000, "nazwa_twojego_swiata")
	launch firework large ball coloured {_colours::*} at {_loc} with duration (random integer between 1 and 3)

 

dzieki <3 

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
10 minut temu, Kormic napisał:

Przyjmuję to jako zlecenie, a więc proszę, oto skrypt.

W przedostatniej linijce ustawiasz (minimalny koordynat X, maksymalny X, minimalny Z, maksymalny Z, nazwę świata).

function getRandomLoc(xmin: integer=-1000, xmax: integer=1000, zmin: integer=-1000, zmax: integer=1000, world: text="world") :: location:
	while {_return} is not set:
		set {_x} to random integer between {_xmin} and {_xmax}
		set {_z} to random integer between {_zmin} and {_zmax}
		set {_loc} to highest block at location at {_x}, 0, {_z} in world ({_world} parsed as world)
		if block at {_loc} != lava or water:
			add 1 to y-loc of {_loc}
			if (block at {_loc}) and (block above block at {_loc}) != lava:
				set {_return} to {_loc}
	return {_return}

every 1 second:
	set {_allColours::*} to red, dark red, yellow, orange, aqua, light aqua and lime
	loop 3 times:
		add (random element out of {_allColours::*}) to {_colours::*} 
	set {_loc} to getRandomLoc(-1000, 1000, -1000, 1000, "nazwa_twojego_swiata")
	launch firework large ball coloured {_colours::*} at {_loc} with duration (random integer between 1 and 3)

 

uh wlaczylem to i wywalilo mi serwer :/

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
4 minuty temu, xXx_Xpedii_xXx napisał:

uh wlaczylem to i wywalilo mi serwer :/

Hmm... podejrzewam, że coś może być zepsute w efekcie puszczania fajerwerek.

Spróbujemy inaczej, mianowicie zparse'ujemy tekst na 'firework effect'.

function getRandomLoc(xmin: integer=-1000, xmax: integer=1000, zmin: integer=-1000, zmax: integer=1000, world: text="world") :: location:
	while {_return} is not set:
		set {_x} to random integer between {_xmin} and {_xmax}
		set {_z} to random integer between {_zmin} and {_zmax}
		set {_loc} to highest block at location at {_x}, 0, {_z} in world ({_world} parsed as world)
		if block at {_loc} != lava or water:
			add 1 to y-loc of {_loc}
			if (block at {_loc}) and (block above block at {_loc}) != lava:
				set {_return} to {_loc}
	return {_return}

every 1 second:
	set {_allColours::*} to red, dark red, yellow, orange, aqua, light aqua and lime
	loop 3 times:
		add (random element out of {_allColours::*}) to {_colours::*} 
	set {_loc} to getRandomLoc(-1000, 1000, -1000, 1000, "nazwa_twojego_swiata")
	launch firework ("large ball coloured %{_colours::*}%" parsed as firework effect) at {_loc} with duration (random integer between 1 and 3)

Jeżeli to nie zadziała, trzeba będzie po kolei wypisywać różne kombinacje kolorów.

Przy okazji podaj:

  • wersję serwera
  • silnik serwera
  • wersję Skripta
  • listę dodatków do Skripta wraz z wersjami
  • błędy przy przeładowaniu
  • błędy w konsoli
Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
4 minuty temu, Kormic napisał:

Hmm... podejrzewam, że coś może być zepsute w efekcie puszczania fajerwerek.

Spróbujemy inaczej, mianowicie zparse'ujemy tekst na 'firework effect'.

function getRandomLoc(xmin: integer=-1000, xmax: integer=1000, zmin: integer=-1000, zmax: integer=1000, world: text="world") :: location:
	while {_return} is not set:
		set {_x} to random integer between {_xmin} and {_xmax}
		set {_z} to random integer between {_zmin} and {_zmax}
		set {_loc} to highest block at location at {_x}, 0, {_z} in world ({_world} parsed as world)
		if block at {_loc} != lava or water:
			add 1 to y-loc of {_loc}
			if (block at {_loc}) and (block above block at {_loc}) != lava:
				set {_return} to {_loc}
	return {_return}

every 1 second:
	set {_allColours::*} to red, dark red, yellow, orange, aqua, light aqua and lime
	loop 3 times:
		add (random element out of {_allColours::*}) to {_colours::*} 
	set {_loc} to getRandomLoc(-1000, 1000, -1000, 1000, "nazwa_twojego_swiata")
	launch firework ("large ball coloured %{_colours::*}%" parsed as firework effect) at {_loc} with duration (random integer between 1 and 3)

Jeżeli to nie zadziała, trzeba będzie po kolei wypisywać różne kombinacje kolorów.

Przy okazji podaj:

  • wersję serwera
  • silnik serwera
  • wersję Skripta
  • listę dodatków do Skripta wraz z wersjami
  • błędy przy przeładowaniu
  • błędy w konsoli

Teraz nie wywalilo ale wykrylo blad : text cannot be parsed as a firework effect {"large ball coloured %..."

Wersja : 1.13.2
Silnik PaperSpigot
Wersja Skripta : 25-beta1
lisra dodatkow : nic
Bledy przy przeladowaniu : podalem /\
Bledy w konsoli : teraz nic 

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
15 minut temu, xXx_Xpedii_xXx napisał:

Teraz nie wywalilo ale wykrylo blad : text cannot be parsed as a firework effect {"large ball coloured %..."

Wersja : 1.13.2
Silnik PaperSpigot
Wersja Skripta : 25-beta1
lisra dodatkow : nic
Bledy przy przeladowaniu : podalem /\
Bledy w konsoli : teraz nic 

W takim razie trzeba kolejno wypisać różne kolory fajerwerków...

function getRandomLoc(xmin: integer=-1000, xmax: integer=1000, zmin: integer=-1000, zmax: integer=1000, world: text="world") :: location:
	while {_return} is not set:
		set {_x} to random integer between {_xmin} and {_xmax}
		set {_z} to random integer between {_zmin} and {_zmax}
		set {_loc} to highest block at location at {_x}, 0, {_z} in world ({_world} parsed as world)
		if block at {_loc} != lava or water:
			add 1 to y-loc of {_loc}
			if (block at {_loc}) and (block above block at {_loc}) != lava:
				set {_return} to {_loc}
	return {_return}

every 1 second:
	set {_allColours::*} to red, dark red, yellow, orange, aqua, light aqua and lime
	set {_loc} to getRandomLoc(-1000, 1000, -1000, 1000, "nazwa_twojego_swiata")
	set {_n} to random integer between 1 and 3
	if {_n} is 1:
		launch firework large ball coloured red, dark red and yellow at {_loc} with duration (random integer between 1 and 3)
	else if {_n} is 2:
		launch firework large ball coloured yellow, orange and aqua at {_loc} with duration (random integer between 1 and 3)
	else if {_n} is 3:
		launch firework large ball coloured aqua, light aqua and lime at {_loc} with duration (random integer between 1 and 3)

 

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
7 minut temu, Kormic napisał:

W takim razie trzeba kolejno wypisać różne kolory fajerwerków...

function getRandomLoc(xmin: integer=-1000, xmax: integer=1000, zmin: integer=-1000, zmax: integer=1000, world: text="world") :: location:
	while {_return} is not set:
		set {_x} to random integer between {_xmin} and {_xmax}
		set {_z} to random integer between {_zmin} and {_zmax}
		set {_loc} to highest block at location at {_x}, 0, {_z} in world ({_world} parsed as world)
		if block at {_loc} != lava or water:
			add 1 to y-loc of {_loc}
			if (block at {_loc}) and (block above block at {_loc}) != lava:
				set {_return} to {_loc}
	return {_return}

every 1 second:
	set {_allColours::*} to red, dark red, yellow, orange, aqua, light aqua and lime
	set {_loc} to getRandomLoc(-1000, 1000, -1000, 1000, "nazwa_twojego_swiata")
	set {_n} to random integer between 1 and 3
	if {_n} is 1:
		launch firework large ball coloured red, dark red and yellow at {_loc} with duration (random integer between 1 and 3)
	else if {_n} is 2:
		launch firework large ball coloured yellow, orange and aqua at {_loc} with duration (random integer between 1 and 3)
	else if {_n} is 3:
		launch firework large ball coloured aqua, light aqua and lime at {_loc} with duration (random integer between 1 and 3)

 

znowu wywalilo serwer :/ 

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
1 minutę temu, Kormic napisał:

Spróbuj usunąć ostatnie 6 linijek i zobacz ponownie działanie skryptu. Może trzeba dodać 'fading to'?

function getRandomLoc(xmin: integer=-1000, xmax: integer=1000, zmin: integer=-1000, zmax: integer=1000, world: text="world") :: location:
    while {_return} is not set:
        set {_x} to random integer between {_xmin} and {_xmax}
        set {_z} to random integer between {_zmin} and {_zmax}
        set {_loc} to highest block at location at {_x}, 0, {_z} in world ({_world} parsed as world)
        if block at {_loc} != lava or water:
            add 1 to y-loc of {_loc}
            if (block at {_loc}) and (block above block at {_loc}) != lava:
                set {_return} to {_loc}
    return {_return}

every 1 second:
    set {_allColours::*} to red, dark red, yellow, orange, aqua, light aqua and lime
    set {_loc} to getRandomLoc(-1000, 1000, -1000, 1000, "nazwa_twojego_swiata")
    set {_n} to random integer between 1 and 3

Zostaje mi cos takiego. Ale z tego co widze nie bedzie muszczać żadnych fajerwerek :/ 

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
Teraz, xXx_Xpedii_xXx napisał:
function getRandomLoc(xmin: integer=-1000, xmax: integer=1000, zmin: integer=-1000, zmax: integer=1000, world: text="world") :: location:
    while {_return} is not set:
        set {_x} to random integer between {_xmin} and {_xmax}
        set {_z} to random integer between {_zmin} and {_zmax}
        set {_loc} to highest block at location at {_x}, 0, {_z} in world ({_world} parsed as world)
        if block at {_loc} != lava or water:
            add 1 to y-loc of {_loc}
            if (block at {_loc}) and (block above block at {_loc}) != lava:
                set {_return} to {_loc}
    return {_return}

every 1 second:
    set {_allColours::*} to red, dark red, yellow, orange, aqua, light aqua and lime
    set {_loc} to getRandomLoc(-1000, 1000, -1000, 1000, "nazwa_twojego_swiata")
    set {_n} to random integer between 1 and 3

Zostaje mi cos takiego. Ale z tego co widze nie bedzie muszczać żadnych fajerwerek :/ 

Właśnie o to chodzi. Chcę wiedzieć czy linijki z puszczaniem fajerwerek wywalają serwer.

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
function getRandomLoc(xmin: integer=-1000, xmax: integer=1000, zmin: integer=-1000, zmax: integer=1000, world: text="world") :: location:
    while {_return} is not set:
        set {_x} to random integer between {_xmin} and {_xmax}
        set {_z} to random integer between {_zmin} and {_zmax}
        set {_loc} to highest block at location at {_x}, 0, {_z} in world ({_world} parsed as world)
        if block at {_loc} != lava or water:
            add 1 to y-loc of {_loc}
            if (block at {_loc}) and (block above block at {_loc}) != lava:
                set {_return} to {_loc}
    return {_return}

every 1 second:
    set {_allColours::*} to red, dark red, yellow, orange, aqua, light aqua and lime

W taki sposob?
sorry ze czekasz ale zem wkleil w zlym temacie :'D 

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
5 minut temu, xXx_Xpedii_xXx napisał:
function getRandomLoc(xmin: integer=-1000, xmax: integer=1000, zmin: integer=-1000, zmax: integer=1000, world: text="world") :: location:
    while {_return} is not set:
        set {_x} to random integer between {_xmin} and {_xmax}
        set {_z} to random integer between {_zmin} and {_zmax}
        set {_loc} to highest block at location at {_x}, 0, {_z} in world ({_world} parsed as world)
        if block at {_loc} != lava or water:
            add 1 to y-loc of {_loc}
            if (block at {_loc}) and (block above block at {_loc}) != lava:
                set {_return} to {_loc}
    return {_return}

every 1 second:
    set {_allColours::*} to red, dark red, yellow, orange, aqua, light aqua and lime

W taki sposob?
sorry ze czekasz ale zem wkleil w zlym temacie :'D 

Teraz Nie Wywala 

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
57 minut temu, xXx_Xpedii_xXx napisał:
function getRandomLoc(xmin: integer=-1000, xmax: integer=1000, zmin: integer=-1000, zmax: integer=1000, world: text="world") :: location:
    while {_return} is not set:
        set {_x} to random integer between {_xmin} and {_xmax}
        set {_z} to random integer between {_zmin} and {_zmax}
        set {_loc} to highest block at location at {_x}, 0, {_z} in world ({_world} parsed as world)
        if block at {_loc} != lava or water:
            add 1 to y-loc of {_loc}
            if (block at {_loc}) and (block above block at {_loc}) != lava:
                set {_return} to {_loc}
    return {_return}

every 1 second:
    set {_allColours::*} to red, dark red, yellow, orange, aqua, light aqua and lime

W taki sposob?
sorry ze czekasz ale zem wkleil w zlym temacie :'D 

Miałeś usunąć trzecią linijkę od końca.

Odnośnik do komentarza
Udostępnij na innych stronach

Nieaktywny
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...