summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2015-12-05 22:41:33 +0000
committerFreeArtMan <dos21h@gmail.com>2015-12-05 22:41:33 +0000
commite6add15b639d94ddf9cc0f00e2e0d12ebbae5597 (patch)
treead752ea798d0cabb770b5d17e72e3828b610d7af
parent5dd7be8251a68a4e6c340f234d697e02108e097b (diff)
downloadcode-snippets-e6add15b639d94ddf9cc0f00e2e0d12ebbae5597.tar.gz
code-snippets-e6add15b639d94ddf9cc0f00e2e0d12ebbae5597.zip
Added coffee,pool,cat
-rwxr-xr-x[-rw-r--r--]cowsay/cowsay.lua49
-rw-r--r--cowsay_weechat/cowsay.lua52
2 files changed, 97 insertions, 4 deletions
diff --git a/cowsay/cowsay.lua b/cowsay/cowsay.lua
index f91d1b0..a596e96 100644..100755
--- a/cowsay/cowsay.lua
+++ b/cowsay/cowsay.lua
@@ -1,4 +1,4 @@
-
+#!/usr/bin/lua
--------------------------------------------------------------------------------
-- my drawing
function ascii_nerd( name )
@@ -85,6 +85,47 @@ function ascii_juice( name1, name2 )
end
--------------------------------------------------------------------------------
+-- http://ascii.co.uk/art/coffee
+function ascii_coffee( name )
+ local s = ""
+ if name == nil then name = "Single Expresso" end
+ if name ~= nil then name = "Single Expresso for " .. name end
+
+s = s .. [[ .-=-.
+ ,|`~'|
+ `| | ]] .. name .. [[
+ `~']]
+
+ return s
+end
+--------------------------------------------------------------------------------
+--http://ascii.co.uk/art/pool
+function ascii_pool( name )
+ local s = ""
+ if name == nil then name = "" end
+
+s = s .. [[,_____,_____, 6 __
+T\ :. .^\,_/_\_I_ ]] .. name .. [[
+I ^T=====;=====T /|
+ I I _|_|]]
+
+ return s
+end
+--------------------------------------------------------------------------------
+--http://ascii.co.uk/art/cat
+function ascii_cat( text )
+ local s = ""
+ if text == nil then text = "mmeeoowwrr!" end
+
+s = s .. [[
+ ) _. ]] .. text .. [[
+ (___)''
+ / ,_,/
+ /'"\ )\]]
+ return s
+end
+
+--------------------------------------------------------------------------------
for k,v in ipairs(arg) do
if v == "nerd" then
print( ascii_nerd( arg[k+1] ) )
@@ -94,5 +135,11 @@ for k,v in ipairs(arg) do
print( ascii_shoot( arg[k+1] ) )
elseif v == "juice" then
print( ascii_juice( arg[k+1], arg[k+2]))
+ elseif v == "coffee" then
+ print( ascii_coffee( arg[k+1] ))
+ elseif v == "pool" then
+ print( ascii_pool( arg[k+1] ))
+ elseif v == "cat" then
+ print( ascii_cat( arg[k+1] ))
end
end
diff --git a/cowsay_weechat/cowsay.lua b/cowsay_weechat/cowsay.lua
index d29614b..03228d2 100644
--- a/cowsay_weechat/cowsay.lua
+++ b/cowsay_weechat/cowsay.lua
@@ -98,6 +98,47 @@ function ascii_juice( name1, name2 )
return s
end
+--------------------------------------------------------------------------------
+-- http://ascii.co.uk/art/coffee
+function ascii_coffee( name )
+ local s = ""
+ if name == nil then name = "Single Expresso" end
+ if name ~= nil then name = "Single Expresso for " .. name end
+
+s = s .. [[ .-=-.
+ ,|`~'|
+ `| | ]] .. name .. [[
+ `~']]
+
+ return s
+end
+--------------------------------------------------------------------------------
+--http://ascii.co.uk/art/pool
+function ascii_pool( name )
+ local s = ""
+ if name == nil then name = "" end
+
+s = s .. [[,_____,_____, 6 __
+T\ :. .^\,_/_\_I_ ]] .. name .. [[
+I ^T=====;=====T /|
+ I I _|_|]]
+
+ return s
+end
+--------------------------------------------------------------------------------
+--http://ascii.co.uk/art/cat
+function ascii_cat( text )
+ local s = ""
+ if text == nil then text = "mmeeoowwrr!" end
+
+s = s .. [[
+ ) _. ]] .. text .. [[
+ (___)''
+ / ,_,/
+ /'"\ )\]]
+ return s
+end
+
function cs_print_list()
weechat.print("","buf "..weechat.current_buffer())
weechat.print(weechat.current_buffer(),"/msg #mainlv br br")
@@ -107,12 +148,17 @@ function cs_command( cmd, args )
cmd = string.lower(cmd)
weechat.print("",cmd..":"..args)
if cmd == "nerd" then
- --weechat.print("",ascii_nerd(arg1))
weechat.command( weechat.current_buffer(), ascii_nerd(args) )
elseif cmd == "goat" then
weechat.command( weechat.current_buffer(), ascii_goat(args) )
elseif cmd == "shoot" then
weechat.command( weechat.current_buffer(), ascii_shoot(args) )
+ elseif cmd == "coffee" then
+ weechat.command( weechat.current_buffer(), ascii_coffee(args) )
+ elseif cmd == "pool" then
+ weechat.command( weechat.current_buffer(), ascii_pool(args) )
+ elseif cmd == "cat" then
+ weechat.command( weechat.current_buffer(), ascii_cat(args) )
else
weechat.print(weechat.current_buffer(), "Unknown command")
end
@@ -140,11 +186,11 @@ end
weechat.register("cowsay", "FreeArtMan", "0.0.1", "Beerware", "ASCII drawing in commanline", "", "")
weechat.hook_command("cowsay",
"cowsay", -- description
- "[shoot <name>, goat <name>, juice <line1> <line2>, nerd <name>", -- args
+ "[shoot <name>, goat <name>, juice <line1> <line2>, nerd <name>, coffee <text>, pool <name>, cat <text>", -- args
" list: \n"..
" add: \n"..
" del: \n\n"..
"If no command is given, all phrases are listed.",
- "nerd|juice|goat|shoot", -- completion
+ "nerd|juice|goat|shoot|coffee|pool|, -- completion
"cowsay_init",
"") \ No newline at end of file