@oldpal/

Dumb Talk Input

Lua

No description

fork
loading
Files
  • main.lua

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.2102172801883191","path":"main.lua","file":{"path":"main.lua","content":{"asEncoding":{"base64":"LS0gQnkgT2xkUGFsSGFwcHkKCgotLSB0aGluZ1tzdHJpbmddID0gcmVwbGFjZVtzdHJpbmddCgotLSB0aGVzZSBzZXR0aW5ncyBiYXNpY2FsbHkgZXF1YWwgRW5nbGlzaCB0byBMb2xjYXQgdHJhbnNsYXRvci4KCmxvY2FsIGZpbmRBbmRSZXBsYWNlID0gey0tIGN1c3RvbWl6ZSB0aGlzIGFzIHlvdSB3YW50LgoJLS0gcHVuY3R1YXRpb24gCglbIi4iXSAgICAgICA9ICIhIjsKCVsiISJdICAgICAgID0gIiEhISI7CglbIj8iXSAgICAgICA9ICIhPyE/IjsKCQoJLS0gYmFzaWNzIAoJWyJpIl0gICAgICAgID0gIm1lIjsKCVsiYW4iXSAgICAgICA9ICJ1aG4iOwoJWyJhIl0gICAgICAgID0gInVoIjsKCVsidGhlIl0gICAgICA9ICJ0ZWgiOwoJWyJ0aGlzIl0gICAgID0gImRpcyI7CglbImhhdmUiXSAgICAgPSAiaGF6IjsKCVsiZXZlciJdICAgICA9ICJldnZhIjsKCVsieW91ciJdICAgICA9ICJ1ciI7CglbInRoYW5rcyJdICAgPSAiJ2Rhbmt6IjsKCVsibG92ZSJdICAgICA9ICJsdXYiOwoJWyJsb3ZlZCJdICAgID0gImx1dmQiOwoJWyJ0aGVyZSJdICAgID0gImRlciI7CglbInRoZWlyIl0gICAgPSAiZGhlciI7CglbImRvIl0gICAgICAgPSAiZHUiOwoJWyJwbGVhc2UiXSAgID0gInBsZXoiOwoJWyJzdG9wIl0gICAgID0gInN0YXAiOwoJWyJtZWFuIl0gICAgID0gIm1lZW4iOwoJWyJoZWxsbyJdICAgID0gImhhaSI7CglbIndoYXQiXSAgICAgPSAid3V0IjsKCVsiYW5kIl0gICAgICA9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VuJ3QiOwoJWyJ0aGV5J3JlIl0gID0gImRleSdyZSI7CglbImlzbid0Il0gICAgPSAibm8gaXMiOwoJWyJpdCdzIl0gICAgID0gIml0eiBleiI7CglbIndoYXQncyJdICAgPSAid3V0eiI7CglbImhlJ3MiXSAgICAgPSAiaGltIGl6IjsKCVsic2hlJ3MiXSAgICA9ICJoZXIgaXoiOwoJCgktLSBtZWFuIHRvIG5pY2UgKG1pZ2h0IG5vdCB3YW50IHRoaXMpIAoJWyJzdWNrIl0gICAgID0gInJvY2siOwoJWyJzdWNrcyJdICAgID0gInJvY2t6IjsKCVsic3R1cGlkIl0gICA9ICJzbWVydHoiOwoJCgktLSBhZGRpbmcgInoiIAoJWyJpdHMiXSAgICAgID0gIml0eiI7CglbImZsaWVzIl0gICAgPSAiZmx5eiI7CglbImxvdmVzIl0gICAgPSAibHV2eiI7CglbImFueXdheSJdICAgPSAiYW55d2F5eiI7CglbImh1Z3MiXSAgICAgPSAiaHVnZ2lleiI7CglbIm1lIl0gICAgICAgPSAibWV6IjsKCVsiaG9wZSJdICAgICA9ICJob3BleiI7CglbInRoYW5rIl0gICAgPSAiJ2Rhbmt6IjsKCVsibW9tIl0gICAgICA9ICJtdW16IjsKCVsiZ2V0Il0gICAgICA9ICJnZXR6IjsKCVsiam9pbiJdICAgICA9ICJqb2lueiI7CglbImVhdCJdICAgICAgPSAiZWF0eiI7CglbImVhdHMiXSAgICAgPSAiZWF0eiI7CglbInNlZSJdICAgICAgPSAic2VleiI7CglbInRpbWVzIl0gICAgPSAidGllbXoiOwoJWyJ3YXMiXSAgICAgID0gIndheiI7CglbImlzIl0gICAgICAgPSAiaXoiOwoJCgktLSBleHRyYSAoZSlkIAoJWyJtYWRlIl0gICAgID0gIm1hZGVkIjsKCVsic2F3Il0gICAgICA9ICJzYXdlZCI7CglbImdvdCJdICAgICAgPSAiZ290dGVkIjsKCVsiY3JlYXRlZCJdICA9ICJjcmVhdGVkZWQiOwoJCgktLSBoZWhlIAoJWyJrZ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vcmQgPSBuZXdXb3JkOnN1YigxLGktMSkuLiIgIi4ubmV3V29yZDpzdWIoaSsxKQoJCQkJCWVuZAoJCQkJZW5kCgkJCQl3b3JkID0gbmV3V29yZDpnc3ViKCIgIiwiIikKCQkJZW5kCgkJCW5ldyA9IG5ldy4uIiAiLi4ocmVwbGFjZSBvciB3b3JkKQoJCQlzdGFydE9mU2VudGVuY2UgPSBmYWxzZQoJCWVuZAoJCWlmKHB1bmN0dWF0aW9uKXRoZW4KCQkJbmV3ID0gbmV3Li4oZmluZEFuZFJlcGxhY2VbcHVuY3R1YXRpb25dIG9yIHB1bmN0dWF0aW9uKQoJCWVuZAoJZW5kCglyZXR1cm4gbmV3OnN1YigyKTsKZW5kCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KCnByaW50KCJ0eXBlIHNvbWV0aGluZyBhbmQgcHJlc3MgZW50ZXIiKQpwcmludCgpCgp3aGlsZSB0cnVlIGRvCglsb2NhbCBtc2cgPSBpby5yZWFkKCkKCXByaW50KCkKCXByaW50KCkKCWlmKHRvc3RyaW5nKG1zZykpdGhlbgoJCWxvY2FsIG5ldyA9IHNvdW5kRHVtYihtc2cpCgkJcHJpbnQobmV3KQoJZW5kCmVuZAoKCgoKCgoKCgoK"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
-- By OldPalHappy


-- thing[string] = replace[string]

-- these settings basically equal English to Lolcat translator.

local findAndReplace = {-- customize this as you want.
	-- punctuation 
	["."]       = "!";
	["!"]       = "!!!";
	["?"]       = "!?!?";
	
	-- basics 
	["i"]        = "me";
	["an"]       = "uhn";
	["a"]        = "uh";
	["the"]      = "teh";
	["this"]     = "dis";
	["have"]     = "haz";
	["ever"]     = "evva";
	["your"]     = "ur";
	["thanks"]   = "'dankz";
	["love"]     = "luv";
	["loved"]    = "luvd";
	["there"]    = "der";
	["their"]    = "dher";
	["do"]       = "du";
	["please"]   = "plez";
	["stop"]     = "stap";
	["mean"]     = "meen";
	["hello"]    = "hai";
	["what"]     = "wut";
	["and"]      = "an";
	["many"]     = "much";
	["more"]     = "MOAR";
	["about"]    = "bout";
	["said"]     = "sayed";
	["think"]    = "tink";
	["did"]      = "doed";
	["that"]     = "taht";
	["okay"]     = "okey";
	["he"]       = "him";
	["she"]      = "her";
	
	-- less basic 
	["little"]   = "'lil";
	["happy"]    = "happee";
	["because"]  = "becuz";
	["funny"]    = "funni";
	["really"]   = "relly";
	["yourself"] = "urself";
	["thought"]  = "thinked";
	["should"]   = "shud";
	["anymore"]  = "aymoar";
	["hello"]    = "HAI";
 	
	-- nouns 
	["village"]  = "villeg";
	["computer"] = "compooter";
	["mother"]   = "mommiez";
	["people"]   = "peepz";
	["birds"]    = "burdiez";
	["paper"]    = "papperz";
	["dog"]      = "puppiez";
	
	-- concatentations 
	["haven't"]  = "hasn't";
	["you're"]   = "you is";
	["i'm"]      = "I are";
	["don't"]    = "dun't";
	["they're"]  = "dey're";
	["isn't"]    = "no is";
	["it's"]     = "itz ez";
	["what's"]   = "wutz";
	["he's"]     = "him iz";
	["she's"]    = "her iz";
	
	-- mean to nice (might not want this) 
	["suck"]     = "rock";
	["sucks"]    = "rockz";
	["stupid"]   = "smertz";
	
	-- adding "z" 
	["its"]      = "itz";
	["flies"]    = "flyz";
	["loves"]    = "luvz";
	["anyway"]   = "anywayz";
	["hugs"]     = "huggiez";
	["me"]       = "mez";
	["hope"]     = "hopez";
	["thank"]    = "'dankz";
	["mom"]      = "mumz";
	["get"]      = "getz";
	["join"]     = "joinz";
	["eat"]      = "eatz";
	["eats"]     = "eatz";
	["see"]      = "seez";
	["times"]    = "tiemz";
	["was"]      = "waz";
	["is"]       = "iz";
	
	-- extra (e)d 
	["made"]     = "maded";
	["saw"]      = "sawed";
	["got"]      = "gotted";
	["created"]  = "createded";
	
	-- hehe 
	["kelly"]    = "stoopid";
}

-- these only affect words longer than 3 characters that aren't in the lookup table above
local deleteVowelChance      = 20/100 -- 20%
local deleteConsonantsChance = 10/100 -- 10%




local function soundDumb(s)
	local new = ""
	for sentence,punctuation in s:gmatch("([^.!?]*)([.!?]*)") do
		local startOfSentence = true
		for word in sentence:gsub("%.",""):gmatch("%S+") do
			local replace = findAndReplace[word:lower()]
			if(replace)then
				if(startOfSentence)then
					replace = replace:sub(1,1):upper()..replace:sub(2)	
				end
			elseif(#word>3)then
				local newWord = word
				for i = 2,#word-1 do
					local deleteChance = (word:sub(i,i):find("[AEIOUaeiou]"))and vowelDeleteChance or deleteConsonantsChance
					if(math.random()<deleteChance)then
						newWord = newWord:sub(1,i-1).." "..newWord:sub(i+1)
					end
				end
				word = newWord:gsub(" ","")
			end
			new = new.." "..(replace or word)
			startOfSentence = false
		end
		if(punctuation)then
			new = new..(findAndReplace[punctuation] or punctuation)
		end
	end
	return new:sub(2);
end
----------------------------------------------------------------------------------

print("type something and press enter")
print()

while true do
	local msg = io.read()
	print()
	print()
	if(tostring(msg))then
		local new = soundDumb(msg)
		print(new)
	end
end