Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
demonnic committed Dec 12, 2023
0 parents commit 98742fc
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Muddle
uses: demonnic/[email protected]

- name: Upload MPackage
uses: actions/upload-artifact@v2
with:
name: run-lua-code
path: build/tmp/
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.vscode/
build/
sub-projects/
doc/
.output
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Echo Package

The echo package provides a means of testing triggers via the command line with four command aliases;
`` `echo, `cecho, `decho, `hecho``.

All act as if the given text came from the game itself and will fire any matching triggers.

See [Triggers](https://wiki.mudlet.org/w/Manual:Introduction#Triggers) for further information on matching text.

## `echo Alias

Displays text on the screen and tells all matching triggers to fire. For coloring use one
of the other functions mentioned below.

```txt
-- examples
> `echo text - displays text on the main screen and tells all matching triggers to fire
> `echo This is a sample line from the game$$And this is a new line.
```

See [echo](https://wiki.mudlet.org/w/Manual:Lua_Functions#echo), [feedTriggers](https://wiki.mudlet.org/w/Manual:Lua_Functions#feedTriggers),

## `cecho Alias

Like echo, but you can add color information using color names and ANSI values.

```txt
-- example: color format is <foreground:background>
> `cecho <green:red>green on red<r> reset$$<124:100>foreground of ANSI124 and background of ANSI100<r>
```

See [cecho](https://wiki.mudlet.org/w/Manual:Lua_Functions#cecho), [cfeedTriggers](https://wiki.mudlet.org/w/Manual:Lua_Functions#cfeedTriggers).

## `decho Alias

Like cecho, but you can add color information using <r,g,b> format.

```txt
-- example
> `decho <0,128,0:128,0,0>green on red<r> reset
```

See [decho](https://wiki.mudlet.org/w/Manual:Lua_Functions#decho), [dfeedTriggers](https://wiki.mudlet.org/w/Manual:Lua_Functions#dfeedTriggers).

## `hecho Alias

Like cecho, but you can add color information using hex #RRGGBB format.

```txt
-- example
> `hecho #008000,800000green on red#r reset
```

See [hecho](https://wiki.mudlet.org/w/Manual:Lua_Functions#hecho), [hfeedTriggers](https://wiki.mudlet.org/w/Manual:Lua_Functions#hfeedTriggers).
6 changes: 6 additions & 0 deletions mfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"package": "echo",
"version": "1.0",
"author": "Mudlet",
"title": "A set of aliases to test triggers on the command line."
}
5 changes: 5 additions & 0 deletions src/aliases/`cecho.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
local s = matches[2]

s = string.gsub(s, "%$", "\n")
cfeedTriggers("\n" .. s .. "\n")
echo("\n")
5 changes: 5 additions & 0 deletions src/aliases/`decho.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
local s = matches[2]

s = string.gsub(s, "%$", "\n")
dfeedTriggers("\n" .. s .. "\n")
echo("\n")
5 changes: 5 additions & 0 deletions src/aliases/`echo.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
local s = matches[2]

s = string.gsub(s, "%$", "\n")
feedTriggers("\n" .. s .. "\n")
echo("\n")
5 changes: 5 additions & 0 deletions src/aliases/`hecho.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
local s = matches[2]

s = string.gsub(s, "%$", "\n")
hfeedTriggers("\n" .. s .. "\n")
echo("\n")
18 changes: 18 additions & 0 deletions src/aliases/aliases.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"name": "`echo",
"regex": "`echo (.+)"
},
{
"name": "`cecho",
"regex": "`cecho (.+)"
},
{
"name": "`decho",
"regex": "`decho (.+)"
},
{
"name": "`hecho",
"regex": "`hecho (.+)"
}
]

0 comments on commit 98742fc

Please sign in to comment.