From e6add15b639d94ddf9cc0f00e2e0d12ebbae5597 Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Sat, 5 Dec 2015 22:41:33 +0000 Subject: Added coffee,pool,cat --- cowsay/cowsay.lua | 49 +++++++++++++++++++++++++++++++++++++++++++- cowsay_weechat/cowsay.lua | 52 ++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 97 insertions(+), 4 deletions(-) mode change 100644 => 100755 cowsay/cowsay.lua diff --git a/cowsay/cowsay.lua b/cowsay/cowsay.lua old mode 100644 new mode 100755 index f91d1b0..a596e96 --- a/cowsay/cowsay.lua +++ b/cowsay/cowsay.lua @@ -1,4 +1,4 @@ - +#!/usr/bin/lua -------------------------------------------------------------------------------- -- my drawing function ascii_nerd( name ) @@ -84,6 +84,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 + -------------------------------------------------------------------------------- for k,v in ipairs(arg) do if v == "nerd" then @@ -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 , goat , juice , nerd ", -- args + "[shoot , goat , juice , nerd , coffee , pool , cat ", -- 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 -- cgit v1.2.3