Skocz do zawartości
  • 0

Sprawdzanie długości argumentu


theneuetimes
 Udostępnij

Pytanie

Siema

 

Czy jest w skripcie coś w stylu sprawdzania czy argument jest dłuższy niż x znaków? Coś w stylu:

if arg 1 is longer than 5 characters:

Przydałoby mi się, bo piszę skrypt na gildię i zamierzam zrobić tak żeby nie było za długich tagów gildii. :)

Odnośnik do komentarza
Udostępnij na innych stronach

10 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
set {_x.%player%} to "%message%"replace all "a" with "1" in {_x.%player%}replace all "b" with "1" in {_x.%player%}replace all "c" with "1" in {_x.%player%}replace all "d" with "1" in {_x.%player%}replace all "e" with "1" in {_x.%player%}replace all "f" with "1" in {_x.%player%}replace all "g" with "1" in {_x.%player%}replace all "h" with "1" in {_x.%player%}replace all "i" with "1" in {_x.%player%}replace all "j" with "1" in {_x.%player%}replace all "k" with "1" in {_x.%player%}replace all "l" with "1" in {_x.%player%}replace all "m" with "1" in {_x.%player%}replace all "n" with "1" in {_x.%player%}replace all "o" with "1" in {_x.%player%}replace all "p" with "1" in {_x.%player%}replace all "r" with "1" in {_x.%player%}replace all "s" with "1" in {_x.%player%}replace all "t" with "1" in {_x.%player%}replace all "u" with "1" in {_x.%player%}replace all "w" with "1" in {_x.%player%}replace all "y" with "1" in {_x.%player%}replace all "z" with "1" in {_x.%player%}	if {_x.%player%} is "1" or "11" or "111" or "1111":		send "Tekst musi skladac sie z minimalnie 5 liter."
Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

@Up

 

Niby działa ale ja chcę użyć tego w komendzie aby argument nie był za długi niż x znaków... Wyskakuję mi taki błąd:

the chat message can only be used in chat event

Linia 7, cały (znaczy ta część którą testuje :D) skrypt.

command /g [<text&gt]:	trigger:		arg 1 is "test":			set {_x.%player%} to "%message%"			replace all "a" with "1" in {_x.%player%}			replace all "b" with "1" in {_x.%player%}			replace all "c" with "1" in {_x.%player%}			replace all "d" with "1" in {_x.%player%}			replace all "e" with "1" in {_x.%player%}			replace all "f" with "1" in {_x.%player%}			replace all "g" with "1" in {_x.%player%}			replace all "h" with "1" in {_x.%player%}			replace all "i" with "1" in {_x.%player%}			replace all "j" with "1" in {_x.%player%}			replace all "k" with "1" in {_x.%player%}			replace all "l" with "1" in {_x.%player%}			replace all "m" with "1" in {_x.%player%}			replace all "n" with "1" in {_x.%player%}			replace all "o" with "1" in {_x.%player%}			replace all "p" with "1" in {_x.%player%}			replace all "r" with "1" in {_x.%player%}			replace all "s" with "1" in {_x.%player%}			replace all "t" with "1" in {_x.%player%}			replace all "u" with "1" in {_x.%player%}			replace all "w" with "1" in {_x.%player%}			replace all "y" with "1" in {_x.%player%}			replace all "z" with "1" in {_x.%player%}			if {_x.%player%} is "1" or "11" or "111" or "1111":				send "Tekst musi skladac sie z minimalnie 5 liter."
Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
command /g [<text&gt]:	trigger:		arg 1 is "test":			set {_x.%player%} to "%arg%"			replace all "a" with "1" in {_x.%player%}			replace all "b" with "1" in {_x.%player%}			replace all "c" with "1" in {_x.%player%}			replace all "d" with "1" in {_x.%player%}			replace all "e" with "1" in {_x.%player%}			replace all "f" with "1" in {_x.%player%}			replace all "g" with "1" in {_x.%player%}			replace all "h" with "1" in {_x.%player%}			replace all "i" with "1" in {_x.%player%}			replace all "j" with "1" in {_x.%player%}			replace all "k" with "1" in {_x.%player%}			replace all "l" with "1" in {_x.%player%}			replace all "m" with "1" in {_x.%player%}			replace all "n" with "1" in {_x.%player%}			replace all "o" with "1" in {_x.%player%}			replace all "p" with "1" in {_x.%player%}			replace all "r" with "1" in {_x.%player%}			replace all "s" with "1" in {_x.%player%}			replace all "t" with "1" in {_x.%player%}			replace all "u" with "1" in {_x.%player%}			replace all "w" with "1" in {_x.%player%}			replace all "y" with "1" in {_x.%player%}			replace all "z" with "1" in {_x.%player%}			if {_x.%player%} is "1" or "11" or "111" or "1111":				send "Tekst musi skladac sie z minimalnie 5 liter."			else:				send "test"

Nic się nie dzieje. :/ Co jest źle?

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

No cóż, nie wiem jak Ci jeszcze pomóc. U mnie wszystko prawidłowo działa, w moich skryptach stosowałem to niejeden raz.

Nie ma prawdopodobnie innego sposobu w 2.0.2 na wykrycie ilości znaków w argumencie tekstowym. Możesz także sam popróbować coś wykombinować. Kto upartemu zabroni? :)

 

W wersji 2.1 jest warunek, który to sprawdza.

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ę...