]> git.lizzy.rs Git - furrybot.git/commitdiff
Add bullshit command from 9front
authorElias Fleckenstein <eliasfleckenstein@web.de>
Mon, 13 Sep 2021 14:46:14 +0000 (16:46 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Mon, 13 Sep 2021 14:46:14 +0000 (16:46 +0200)
bot.lua
bullshit [new file with mode: 0755]
bullshit.lua [new file with mode: 0644]

diff --git a/bot.lua b/bot.lua
index e75613999110647f6367ceaf82e3d2120aaacaa9..16b872f5a303466180d0f9eb6eb8a37839d01e3a 100644 (file)
--- a/bot.lua
+++ b/bot.lua
@@ -201,7 +201,7 @@ end
 return function(_http, _env, _storage)
        http, env, storage = _http, _env, _storage
 
-       for _, f in ipairs {"nsfw", "roleplay", "death", "economy", "random", "http", "operator"} do
+       for _, f in ipairs {"nsfw", "roleplay", "death", "economy", "random", "http", "operator", "bullshit"} do
                local func, err = env.loadfile("clientmods/furrybot/" .. f .. ".lua")
 
                if not func then
diff --git a/bullshit b/bullshit
new file mode 100755 (executable)
index 0000000..73265c4
--- /dev/null
+++ b/bullshit
@@ -0,0 +1,153 @@
+app
+blockchain
+cloud
+grid
+base
+engine
+metadata
+replication
+factory
+strategy
+configuration |
+information |
+interface
+singleton
+framework
+NoSQL |
+cache
+persistence |
+self-signing |
+deep-learning |
+scripting |
+template
+realtime |
+realtime-java |
+just-in-time |
+full-stack |
+API
+service
+event
+rails
+polling |
+injection |
+pipelining |
+firewall
+standard
+GPU |
+shader
+agile ^
+advanced ^
+converged ^
+leveraged ^
+extended ^
+decentralized ^
+basic ^
+core |
+hardware
+software
+database
+rich-client |
+DOM |
+CSS |
+CMS |
+STM |
+map/reduce |
+reduce/map |
+descriptor
+hypervisor
+callback |
+method
+table
+package
+plugin
+browser
+extension
+open-source ^
+module
+enhancement
+proxy
+hosting
+wrapper
+storage
+social ^
+private ^
+component
+markup
+lifecycle |
+flexible ^
+patented ^
+abstract ^
+stateless ^
+optimized ^
+virtualized ^
+extensible ^
+compliant ^
+scale-out ^
+session |
+content-driven |
+high-performance |
+general-purpose |
+out-scaling |
+generic ^
+mobile ^
+responsive ^
+progressive ^
+property |
+secure ^
+overflow-preventing ^
+non-blocking ^
+self-healing ^
+ISO-certified ^
+encrypted ^
+proven ^
+open ^
+RESTful ^
+content-addressed ^
+asynchronous ^
+object-oriented ^
+immutable ^
+anonymous ^
+transactional ^
+distributed ^
+structured ^
+managed ^
+webscale ^
+lossless ^
+virtual ^
+shared ^
+stable ^
+SQL *
+JSON *
+XML *
+YAML *
+XMPP *
+SOAP *
+HTML *
+AJAX *
+ORM *
+SVG *
+ACPI *
+WEB2.0 *
+SSL *
+HTTP *
+TOR *
+ActivityPub *
+layer $
+element |
+manager $
+frontend $
+backend $
+control $
+controller $
+framework $
+database $
+generator $
+optimizer $
+interface $
+solution $
+dependency |
+locator $
+-oriented %
+-based %
+-aware %
+-scale %
diff --git a/bullshit.lua b/bullshit.lua
new file mode 100644 (file)
index 0000000..aa53d73
--- /dev/null
@@ -0,0 +1,64 @@
+local http, env, storage
+local C = minetest.get_color_escape_sequence
+
+-- taken from 9front source code: /rc/bin/bullshit
+local bullshit_code = [[
+function min(a, b){
+       if(a > b)
+               return b
+       else
+               return a
+}
+function suffix(){
+       if(hassuffix = (rand() < 0.2))
+               return suffixes[int(rand() * nsuffix)]
+       return ""
+}
+$2 == "*" { protocol[nprotocol++] = $1; next }
+$2 == "$" { end[nend++] = $1; next }
+$2 == "%" { suffixes[nsuffix++] = $1; next }
+$2 == "^" { start[nstart++] = $1; next }
+$2 == "|" { noend[nword] = 1 }
+{ word[nword++] = $1; next }
+END {
+       srand()
+       last = -1
+       out = 0
+       total = int(rand() * 7) + 3
+       n = int(rand() * min(total - out, 3))
+       for(i = 0; i < n; i++)
+               printf "%s ", start[int(rand() * nstart)]
+       out += n
+       hassuffix = 0
+       n = int(rand() * min(total - out, 3))
+       for(i = 0; i < n; i++)
+               printf "%s%s ", word[last = int(rand() * nword)], suffix()
+       out += n
+       if(rand() > 0.5){
+               n = int(rand() * 3)
+               for(i = 0; i < n; i++)
+                       printf "%s %s", protocol[int(rand() * nprotocol)], (i != n-1) ? "over " : ""
+               out += n
+               last = -1
+               hassuffix = 0
+       }
+       n = int(rand() * min(total - out, 3))
+       if(out + n == 1 || last == -1)
+               n += 2
+       for(i = 0; i < n; i++)
+               printf "%s%s ", word[last = int(rand() * nword)], suffix()
+       if(rand() < 0.1 || (last >= 0 && noend[last]) || hassuffix)
+               printf "%s ", end[int(rand() * nend)]
+       print ""
+}
+]]
+
+function furrybot.commands.bullshit(name)
+       local pf = env.io.popen("awk '" .. bullshit_code .. "' clientmods/furrybot/bullshit", "r")
+       local bullshit = pf:read("*a")
+       furrybot.ping_message(name, bullshit:sub(1, #bullshit - 2), furrybot.colors.system)
+end
+
+return function(_http, _env, _storage)
+       http, env, storage = _http, _env, _storage
+end