From 597f6a56cafd60d14e941795134d62008082d6b4 Mon Sep 17 00:00:00 2001 From: Luis Fontes Date: Thu, 8 Oct 2020 18:37:21 +0100 Subject: [PATCH] created lorem impsum script --- Scripts/LoremIpsum.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Scripts/LoremIpsum.js diff --git a/Scripts/LoremIpsum.js b/Scripts/LoremIpsum.js new file mode 100644 index 00000000..485ca33c --- /dev/null +++ b/Scripts/LoremIpsum.js @@ -0,0 +1,26 @@ +/** + { + "api":1, + "name":"Lorem Ipsum", + "description":"Generates Lorem Ipsum like text", + "author":"luisfontes19", + "icon":"type", + "tags":"generate,lorem,ipsum,text", + "bias": -0.1 + } +**/ + + +function main(state) { + const words = ["ad", "adipisicing", "aliqua", "aliquip", "amet", "anim", "aute", "cillum", "commodo", "consectetur", "consequat", "culpa", "cupidatat", "deserunt", "do", "dolor", "dolore", "duis", "ea", "eiusmod", "elit", "enim", "esse", "est", "et", "eu", "ex", "excepteur", "exercitation", "fugiat", "id", "in", "incididunt", "ipsum", "irure", "labore", "laboris", "laborum", "Lorem", "magna", "minim", "mollit", "nisi", "non", "nostrud", "nulla", "occaecat", "officia", "pariatur", "proident", "qui", "quis", "reprehenderit", "sint", "sit", "sunt", "tempor", "ullamco", "ut", "velit", "veniam", "voluptate"]; + let sentence = ""; + + for (let i = 0; i < 100; i++) { + const pos = Math.floor(Math.random() * (words.length - 1)); + sentence += words[pos] + " "; + } + + sentence = sentence.charAt(0).toUpperCase() + sentence.slice(1).trim() + "."; + + state.text = sentence; +} \ No newline at end of file