Scarpet additions

Adds some miscellaneous new functions like http requests to the scarpet language

Редакция NLZONE · 2 мин чтения · 1 просмотр
Scarpet additions
Скачать Scarpet additions1.19 – 26.3 · с официальной страницы: modrinth.com
Перейти к загрузке

Что это

Adds some miscellaneous new functions like http requests to the scarpet language

  • Тип: мод
  • Загрузчик: fabric
  • Версии Minecraft: 1.19 – 26.3
  • Скачиваний на Modrinth: 5 041

Подробно

A Carpet mod extension for some additional scarpet functions

Converts a color from one model to another.

color -> List: Depending on specified model

model -> String: Input color model, can be RGB, RGBA or HSB

RGB: List of a red, green and blue value RGBA: List of a red, green, blue and alpha value HSB: List of a hue, saturation and brightnes value

output -> String: Output color model, can be RGB, RGBA, HEX or NUM

RGB: List of a red, green and blue value RGBA: List of a red, green, blue and alpha value HEX: String of hex characters (without leading '#') Can be used for format() NUM: Number representing the color as 4 bytes: 0xRRGGBBAA. Can be used for 'color' parameter in drawshape()

convertcolor([255,128,0],'rgb','hex'); -> 'FF8000'

convertcolor([255,128,0],'rgb','num'); -> 0xff7f00ff

convertcolor([0,255,255],'hsb','hex'); -> 'FF0000'

convertcolor([120,255,255],'hsb','hex'); -> '00FF00'

py ontick() -> ( if((ticktime() % 2) == 0, headerHue = ticktime()%360; headerGlossIndex = (floor(ticktime()/3)%40)-10; header = []; title = 'MinecraftServer'; for(range(length(title)), if(abs(-headerGlossIndex) [strings]): The received response headers uri (String): The originally requested URI

Note that the response body is not parsed as json or html escaped. Use the escapehtml and unescapehtml functions, as well as the scarpet-builtins encodejson and decodejson.

response = httprequest({ 'uri'->'https://opentdb.com/api.php?amount=1' });

if(response:'statuscode' != 200, print('Request failed: ' + response:'statuscode'); , body = decodejson(response:'body'); print('\n\nBody: ' + body);

questiondata = body:'results':0; question = unescapehtml(questiondata:'question'); answer = unescapehtml(questiondata:'correctanswer');

print('\n\n\n' + question + '\n' + answer); );

Returns the escaped html string (e.g. " -> ")

Returns the unescaped html string (e.g. " -> ")

Sets header and footer in tab menu of all players, or changes it for one player if player? is given.

Sets the message of the day of the server.

Как установить

Скачайте файл на официальной странице ниже и положите его в папку mods (для модов) или plugins (для плагинов) вашего сервера или клиента. Для модов нужен совместимый загрузчик. Версия должна совпадать с версией Minecraft.

Текст подготовлен автоматически из описания на Modrinth и ждёт проверки редакцией.

Редакция NLZONE

Пишем о серверах, модах и играх, в которые играем сами. Нашли ошибку — напишите нам, исправим.

Комментарии 0

Комментарии к этому материалу отключены.

Читайте также