Advertisement
Oysi

Random sentence generator

Jun 26th, 2013
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.88 KB | None | 0 0
  1.  
  2. -- Script made by Oysi
  3.  
  4. -- Setup math.random
  5. math.randomseed(os.time())
  6. math.random()
  7. math.random()
  8. math.random()
  9.  
  10. -- Names
  11. local names = {
  12.     -- Scripters
  13.     "xLEGOx";
  14.     "DYSTD";
  15.     "Telamon";
  16.     "Scribbleno1";
  17.     "Mattchewy";
  18.     "Camoy";
  19.     "Telamon";
  20.     "Anaminus";
  21.     "John";
  22.     "Blocco";
  23.     "GoldenUrg";
  24.     "Oysi";
  25.     "Billiland";
  26.     "MrBlockson";
  27.     "Nazer1290";
  28.     "Megamatrixdude";
  29.     "MrNicNac";
  30.     "LPGhatguy";
  31.     "Dr01d3k4";
  32.     "Lieutenant54321";
  33.     "Cymru72";
  34.     "Miloguy";
  35.     "Sdfgw";
  36.     "Digpoe";
  37.     "Dekkonot";
  38.     "1waffle1";
  39.     "Apdapreturns";
  40.     "Toshir0z";
  41.     "Zars15";
  42.     "Pighead10";
  43.     "Jaccob";
  44.     "xSIXx";
  45.  
  46.     -- Random stuff
  47.     "cow";
  48.     "cat";
  49.     "dog";
  50.     "pineapple";
  51.     "frog";
  52.     "fence";
  53.     "huge thing";
  54.     "weird thing";
  55.     "long thing";
  56.     "orange";
  57.     "apple";
  58.     "lord";
  59.     "God";
  60. }
  61. local names2 = {
  62.     "himself";
  63.     "herself";
  64.     "itself";
  65. }
  66.  
  67. -- Articles
  68. local articles = {
  69.     "a";
  70.     "the";
  71. }
  72.  
  73. -- Adverbs
  74. local adverbs = {
  75.     "happily";
  76.     "quickly";
  77.     "slowly";
  78.     "happily";
  79.     "stupidly";
  80.     "disgustingly";
  81.     "beautifully";
  82.     "carefully";
  83.     "majestically";
  84.     "almost";
  85.     "nearly";
  86.     "arrogantly";
  87.     "awkwardly";
  88.     "blindly";
  89.     "barely";
  90.     "believably";
  91.     "boldly";
  92.     "brutally";
  93.     "blissfully";
  94.     "amazingly";
  95.     "angrily";
  96.     "actively";
  97.     "often";
  98.     "cleanly";
  99.     "casually";
  100.     "cruelly";
  101.     "cutely";
  102.     "daily";
  103.     "dangerously";
  104.     "delicately";
  105.     "defiantly";
  106.     "dramatically";
  107.     "eagerly";
  108.     "infinitely";
  109.     "informally";
  110.     "helpfully";
  111.     "kindly";
  112.     "madly";
  113.     "meaningfully";
  114.     "loudly";
  115.     "likely";
  116.     "magically";
  117.     "haxily";
  118.     "miserably";
  119.     "merely";
  120.     "methodically";
  121.     "mostly";
  122.     "mechanically";
  123.     "painfully";
  124.     "patiently";
  125.     "perfectly";
  126.     "periodically";
  127.     "perpetually";
  128.     "personally";
  129.     "politely";
  130.     "positively";
  131.     "potentially";
  132.     "sadly";
  133.     "skillfully";
  134.     "seriously";
  135.     "somewhat";
  136.     "stealthily";
  137.     "successfully";
  138.     "still";
  139.     "stressfully";
  140.     "scarily";
  141.     "spiritually";
  142.     "solely";
  143.     "sincerely";
  144.     "subsequently";
  145.     "swiftly";
  146.     "seldom";
  147.     "somewhere";
  148.     "temporarily";
  149.     "tenderly";
  150.     "thankfully";
  151.     "touchingly";
  152.     "victoriously";
  153.     "vacantly";
  154.     "violently";
  155.     "wrongly";
  156.     "warmly";
  157.     "unskillfully";
  158. }
  159.  
  160. -- Verbs present/past tense
  161. local verbs = {
  162.     {"possessing",      "possessed"};
  163.     {"harassing",       "harassed"};
  164.     {"nuking",          "nuked"};
  165.     {"killing",         "killed"};
  166.     {"lying with",      "lied with"};
  167.     {"buying",          "bought"};
  168.     {"selling",         "sold"};
  169.     {"greeting",        "greeted"};
  170.     {"exposing",        "exposed"};
  171.     {"sniffing",        "sniffed"};
  172.     {"jumping on",      "jumped on"};
  173.     {"marrying",        "married"};
  174.     {"flashing",        "flashed"};
  175.     {"exploding",       "exploded"};
  176.     {"eating",          "ate"};
  177.     {"blessing",        "blessed"};
  178.     {"shaking",         "shook"};
  179.     {"renting",         "rented"};
  180.     {"milking",         "milked"};
  181.     {"pooping on",      "pooped on"};
  182.     {"penetrating",     "penetrated"};
  183.     {"analysing",       "analysed"};
  184.     {"battling",        "battled"};
  185.     {"baking",          "baked"};
  186.     {"carrying",        "carried"};
  187.     {"screaming at",    "screamed at"};
  188.     {"calculating",     "calculated"};
  189.     {"challenging",     "challenged"};
  190.     {"chasing",         "chased"};
  191.     {"chewing",         "chewed"};
  192.     {"decorating",      "decorated"};
  193.     {"educating",       "educated"};
  194.     {"emptying",        "emptied"};
  195.     {"fearing",         "feared"};
  196.     {"hammering",       "hammered"};
  197.     {"impressing",      "impressed"};
  198.     {"kicking",         "kicked"};
  199.     {"reflecting",      "reflected"};
  200.     {"begging",         "begged"};
  201.     {"choking",         "choked"};
  202.     {"correcting",      "corrected"};
  203.     {"draining",        "drained"};
  204.     {"destroying",      "destroyed"};
  205.     {"dividing",        "divided"};
  206.     {"dreaming about",  "dreamt about"};
  207.     {"developing",      "developed"};
  208.     {"drying",          "dried"};
  209.     {"ending",          "ended"};
  210.     {"drowning",        "drowned"};
  211.     {"crushing",        "crushed"};
  212.     {"dressing up",     "dressed up"};
  213.     {"frying",          "fried"};
  214.     {"firing",          "fired"};
  215.     {"producing",       "produced"};
  216.     {"delivering",      "delivered"};
  217.     {"backstabbing",    "backstabbed"};
  218.     {"programming",     "programmed"};
  219.     {"shoving",         "shoved"};
  220.     {"rejecting",       "rejected"};
  221.     {"shopping for",    "shopped for"};
  222.     {"trading",         "traded"};
  223.     {"tickling",        "tickled"};
  224.     {"biting",          "bit"};
  225.     {"unlocking",       "unlocked"};
  226.     {"locking",         "locked"};
  227.     {"wrestling",       "wrestled"};
  228.     {"watching",        "watched"};
  229.     {"laughing at",     "laughed"};
  230.     {"having fun with", "had fun with"};
  231.     {"burning",         "burned"};
  232.     {"drugging",        "drugged"};
  233. }
  234.  
  235. -- Adjectives
  236. local adjectives = {
  237.     -- Colors
  238.     "blue";
  239.     "pink";
  240.     "red";
  241.     "orange";
  242.     "green";
  243.     "black";
  244.     "white";
  245.     "grey";
  246.     "brown";
  247.  
  248.     -- Normal adjectives
  249.     "small";
  250.     "big";
  251.     "tiny";
  252.     "giant";
  253.     "old";
  254.     "young";
  255.     "golden";
  256.     "fast";
  257.     "slow";
  258.     "cool";
  259.     "ugly";
  260.     "adorable";
  261.     "wide-eyed";
  262.     "beautiful";
  263.     "elegant";
  264.     "glamorous";
  265.     "fabulous";
  266.     "clean";
  267.     "magnificent";
  268.     "old-fashioned";
  269.     "plain";
  270.     "brave";
  271.     "calm";
  272.     "lively";
  273.     "kind";
  274.     "happy";
  275.     "thankful";
  276.     "chubby";
  277.     "skinny";
  278.     "shallow";
  279.     "proud";
  280.     "gentle";
  281.     "silly";
  282.     "obedient";
  283.     "delightful";
  284.     "ancient";
  285.     "modern";
  286.     "late";
  287.     "bitter";
  288.     "fresh";
  289.     "greasy";
  290.     "juicy";
  291.     "hot";
  292.     "icy";
  293.     "loose";
  294.     "melted";
  295.     "frozen";
  296.     "nutritious";
  297.     "prickly";
  298.     "rotten";
  299.     "salty";
  300.     "sticky";
  301.     "strong";
  302.     "sweet";
  303.     "tasteless";
  304.     "weak";
  305.     "wet";
  306.     "wooden";
  307.     "yummy";
  308. }
  309.  
  310. -- Get rand
  311. function r(t)
  312.     return t[math.random(1, #t)]
  313. end
  314.  
  315. -- Generate sentence
  316. function sentence()
  317.     local name1 = r(names)
  318.     local adverb1 = r(adverbs)
  319.     local verb1 = r(verbs)
  320.     local verb1Tense = math.random(1, 2)
  321.     local article1 = r(articles)
  322.     local adjective1 = r(adjectives)
  323.     local name2 = r(names)
  324.     if name1 == name2 then name2 = r(names2) end
  325.  
  326.     local sentence = ""
  327.     sentence = sentence .. name1 .. " "
  328.     if verb1Tense == 1 then
  329.         sentence = sentence .. "is "
  330.     end
  331.     sentence = sentence .. adverb1 .. " "
  332.     sentence = sentence .. verb1[verb1Tense] .. " "
  333.     sentence = sentence .. article1 .. " "
  334.     sentence = sentence .. adjective1 .. " "
  335.     sentence = sentence .. name2
  336.  
  337.     return sentence:sub(1, 1):upper() .. sentence:sub(2)
  338. end
  339.  
  340. -- Testing
  341. for i = 1, 10 do
  342.     print("# " .. (i < 10 and "0" or "") .. i .. " -- " .. sentence())
  343. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement