File: eval.lua

package info (click to toggle)
swift-im 2.0~beta1%2Bdev47-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 13,508 kB
  • sloc: cpp: 79,149; python: 1,397; xml: 546; sh: 150; ansic: 54; makefile: 40
file content (14 lines) | stat: -rw-r--r-- 450 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

function eval_command(command, params, message)
   assert(loadstring(params))()
   swiftob_reply_to(message, "done")
end

function evalr_command(command, params, message)
   result = assert(loadstring(params))()
   swiftob_reply_to(message, "" .. result)
end

swiftob_register_command("eval", "Owner", "Evaluate an expression", eval_command)
swiftob_register_command("evalr", "Owner", "Evaluate an expression and return the result", evalr_command)