RiftWorks
Найти
Персональное меню
Вы не представились системе
user-interface-preferences
Персональные инструменты
Обсуждение
Вклад
Создать учётную запись
Войти
Параметры
notifications
Редактирование:
NTSL Scripts
(раздел)
associated-pages
Статья
Обсуждение
Просмотры
Читать
Править
Править код
История
Внимание:
Вы не вошли в систему. Ваш IP-адрес будет общедоступен, если вы запишете какие-либо изменения. Если вы
войдёте
или
создадите учётную запись
, её имя будет использоваться вместо IP-адреса, наряду с другими преимуществами.
Анти-спам проверка.
Не
заполняйте это!
===English To Mid-evil Translator=== // English To Mid-evil Translator Script - By Hellafed This script initializes a list of words by using the mem() function as a hash table. By doing this it has to initialize first, if you are running this script and then add words later, you must clear the memory of the server first so it initializes again and learns the new words. After initialization, this transmission and the rest all skip to splitting the transmission's contents and check each word against the memory, using the word as a key. Because of not needing to loop through the list of words, this is a fast process. If it finds a valid word to replace, it will replace the word with the value that the key led to. Finally, after it is finished it will convert the vector into a string again and then replace the contents of the transmission with the final message. (Credit to Giacom for providing the code i used to create this) <pre>// English To Mid-evil Translator Script - By Hellafed // Helper Functions def implode($vector, $adder) { $returnString = ""; $index = 1; while($index <= length($vector)) { $at = at($vector, $index); $toAdd = $adder; if($index == 1) { $toAdd = ""; } $returnString = $returnString + $toAdd + $at; $index += 1; } return $returnString; } def Initialize() { // Our words! Format: real word / mid evil word $words = vector("gun", "cannon", "my", "my own", "security", "town watch", "are", "art", "yeah", "aye", "captain", "King", "hos", "Town Watch Commander", "ce", "Head Builder", "dead", "gone to Sovngarde", "rd", "Lead Scientist", "assistant", "peasant", "Borg", "dwarven automaton", "Borgs", "dwarven automatons", "cyborg", "dwarven automaton", "cyborgs", "dwarven automatons", "fucker", "milk drinker", "syndicate", "dragons", "brig", "dungeon", "yours", "thine", "you", "thou", "do", "dost", "has", "hath", "nothing", "naught", "thanks", "Grammarcy", "hop", "Inn Manager", "ai", "King's Servant", "money", "gold coins", "friend", "brother", "station", "town", "shuttle", "Wagon", "engine", "waterwheel", "space", "unknown"); //broadcast("Starting Initialization..."); $index = 1; while($index <= length($words)) { $key = at($words, $index); $key = lower($key); $value = at($words, $index+1); mem($key, $value); $index += 2; } //broadcast("Initialization Complete!"); } // Script Begin if(mem("initialized") != 1) { Initialize(); mem("initialized", 1); } $newContent = explode($content, " "); $index = 1; while($index <= length($newContent)) { $entry = at($newContent, $index); $value = mem(lower($entry)); if($value) { at($newContent, $index, $value); } $index += 1; } $content = implode($newContent, " "); // Script End</pre>
Описание изменений:
Обратите внимание, что все изменения в RiftWorks рассматриваются как выпущенные на условиях лицензии Creative Commons Attribution-NonCommercial-ShareAlike (см.
RiftWorks:Авторские права
). Если вы не хотите, чтобы ваши тексты свободно распространялись и редактировались любым желающим, не помещайте их сюда.
Вы также подтверждаете, что являетесь автором вносимых дополнений или скопировали их из источника в общественном достоянии или под совместимой лицензией.
Не размещайте без разрешения материалы, защищённые авторским правом!
Отменить
Справка по редактированию
(в новом окне)