Skocz do zawartości
  • 0

Automatyczna wielka litera i kropka


Pytanie

Cześć, mam pytanie, czy da się zrobić tak, aby wszystkie wiadomości, które wysyłają gracze, zaczynały się od wielkiej litery, a kończyły kropką. Chciałem zrobić to sam, jednak nie wiem nawet jak rozpocząć. Jest ktoś, kto wie jak coś takiego zrobić?

Odnośnik do komentarza
https://skript.pl/temat/48335-automatyczna-wielka-litera-i-kropka/
Udostępnij na innych stronach

7 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0

w evencie chatu ustaw wiadomość na wiadmość z kropką

a wielka litera to https://www.spigotmc.org/threads/capitalize-certain-letters-in-a-message.307078/#post-2914872

Odnośnik do komentarza
https://skript.pl/temat/48335-automatyczna-wielka-litera-i-kropka/#findComment-301832
Udostępnij na innych stronach

  • 0
19 godzin temu, CoFFeIN04 napisał:

w evencie chatu ustaw wiadomość na wiadmość z kropką

a wielka litera to https://www.spigotmc.org/threads/capitalize-certain-letters-in-a-message.307078/#post-2914872

Ok, kropkę udało mi się łatwo ustawić, ale żaden ze skryptów ani pluginów z tej stronki na wielką literę nie działały... pokazuje mi się taki błąd:

Spoiler

Beztytulu.png

 

Odnośnik do komentarza
https://skript.pl/temat/48335-automatyczna-wielka-litera-i-kropka/#findComment-301950
Udostępnij na innych stronach

  • 0
6 godzin temu, CoFFeIN04 napisał:

ustaw sobie najpierw wiadomość do zmiennej tymczasowej

Nie do końca rozumiem tego, na forum jestem nowym, a nie znalazłem nic o "zmiennych tymczasowych"... Wiem, że zawracam głowę, ale po prostu nie wiem co to jest.

 

Dobra można zamknąć, udało się

on chat:
	if message starts with "a":
		replace first "a" with "A" in message
	if message starts with "b":
		replace first "b" with "B" in message
	if message starts with "c":
		replace first "c" with "C" in message
	if message starts with "d":
		replace first "d" with "D" in message
	if message starts with "e":
		replace first "e" with "E" in message
	if message starts with "f":
		replace first "f" with "F" in message
	if message starts with "g":
		replace first "g" with "G" in message
	if message starts with "h":
		replace first "h" with "H" in message
	if message starts with "i":
		replace first "i" with "I" in message
	if message starts with "j":
		replace first "j" with "J" in message
	if message starts with "k":
		replace first "k" with "K" in message
	if message starts with "l":
		replace first "l" with "l" in message
	if message starts with "m":
		replace first "m" with "M" in message
	if message starts with "n":
		replace first "n" with "N" in message
	if message starts with "o":
		replace first "o" with "O" in message
	if message starts with "p":
		replace first "p" with "P" in message
	if message starts with "r":
		replace first "r" with "R" in message
	if message starts with "s":
		replace first "s" with "S" in message
	if message starts with "t":
		replace first "t" with "T" in message
	if message starts with "u":
		replace first "u" with "U" in message
	if message starts with "w":
		replace first "w" with "W" in message
	if message starts with "v":
		replace first "v" with "V" in message
	if message starts with "y":
		replace first "y" with "Y" in message
	if message starts with "z":
		replace first "z" with "Z" in message

 

CountingDogs

Łączę posty.

Notatka dodana przez CountingDogs

Odnośnik do komentarza
https://skript.pl/temat/48335-automatyczna-wielka-litera-i-kropka/#findComment-301992
Udostępnij na innych stronach

  • 0
4 godziny temu, pruslay napisał:

zmiennych tymczasowych

to takie co się usuwają pod koniec eventu, np.

set {_mgs} to message

 

on chat:
	set message to capitalizeFirst(message) # this is my message. -> This is my message.

taki kod nie działa? dziwne

spróbuj

on chat:
	set {_mgs} to capitalizeFirst(message) 
	# this is my message. -> This is my message.
	set message to {_mgs}
Edytowane przez CoFFeIN04
Odnośnik do komentarza
https://skript.pl/temat/48335-automatyczna-wielka-litera-i-kropka/#findComment-302015
Udostępnij na innych stronach

  • 0
11 minut temu, CoFFeIN04 napisał:

 

spróbuj


on chat:
	set {_mgs} to capitalizeFirst(message) 
	# this is my message. -> This is my message.
	set message to {_mgs}

O ten kod rzeczywiście działa!!! Wielkie dzięki!!!!

Odnośnik do komentarza
https://skript.pl/temat/48335-automatyczna-wielka-litera-i-kropka/#findComment-302016
Udostępnij na innych stronach

Nieaktywny
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • Ostatnio przeglądający   0 użytkowników

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