Skip to content

Instantly share code, notes, and snippets.

@keevitaja
Created January 14, 2019 13:54
Show Gist options
  • Save keevitaja/a1ff7d450980c50086f1f02af2015492 to your computer and use it in GitHub Desktop.
Save keevitaja/a1ff7d450980c50086f1f02af2015492 to your computer and use it in GitHub Desktop.
const { app, component, controllers, system, options } = require('jedmud-component')
component(()=> {
const { alias, short, trigger, block, gag } = controllers
alias.set('^yolo$', ()=> system.send('say yolo'))
short.set('^y$', 'yolo')
short.set('^rl ', '#system reload ')
const id = trigger.set('\{say\}You say', ()=> {
system.print('testing it')
})
trigger.set('\{say\}You say', ()=> {
system.print('testing this trigger it')
})
trigger.set('Jedhi the little rebel', (a, b, c, d, e)=> {
system.print('testing the revel')
trigger.disable(id)
}, {
omit: true,
once: false
})
const bid = block.set('You still have to kill', '^$', (lines, stripped)=> {
system.print(stripped)
}, { omit: true, first: true, enabled: false, once: true })
block.set('an animate banana peel', 'Eexlthalatomus', (lines, stripped)=> {
system.print('-------------------')
system.print(lines)
system.print('-------------------')
}, { omit: true })
alias.set('^cpc$', ()=> {
block.enable(bid)
system.send('cp c')
})
block.set('\<MAPSTART\>', '\<MAPEND\>', (lines, stripped)=> {
system.print(stripped)
system.print('FOUND MAP')
}, { omit: true })
gag.set('^\{say\}', '{woot}')
alias.set('^optset ([a-z]+) (.*)$', (key, value)=> {
options.set(key, value)
})
alias.set('^optget ([a-z]+)$', (key)=> {
system.print(options.get(key))
})
alias.set('^optdel ([a-z]+)$', (key)=> {
options.delete(key)
system.print('deleted')
})
alias.set('^test$', ()=> {
i = j + 4
system.print('test... test')
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment