Cleaned up things, RENAMED VARIABLES! now we have ANSW_R_* and ANSW_L_* namespaces...
[mirrors/libpurple-core-answerscripts.git] / purple / answerscripts.d / 10-menu.pl
CommitLineData
b44d7b66
H
1#!/usr/bin/env perl
2#Just for you to see that you can use almost any language :-)
3use strict;
4use warnings;
b6065058 5use v5.10; #given/when (if you need to use older PERL, you can find older version in GIT)
b44d7b66 6
b6065058
H
7given ($ENV{ANSW_MSG}) {
8 when (/^!help$/) { print qx{ grep -o 'when \(/[^\$/]*' "$0" | grep -o '!.*' | tr '\n' ',' }; }
9 when (/^!ping$/) { print "PONG"; }
b1866b8c
H
10 when (/^!whoami$/) { print "You are: $ENV{ANSW_R_NAME}"; }
11 when (/^!whoareyou$/) { print "Hello, my name is $ENV{ANSW_L_NAME} ;-)"; }
12 when (/^!version$/) { print "$ENV{ANSW_L_AGENT} $ENV{ANSW_L_AGENT_VERSION}"; }
13 when (/^!status$/) { print "[$ENV{ANSW_L_STATUS}] $ENV{ANSW_L_STATUS_MSG}"; }
b6065058
H
14 when (/^!(reboot|reset|restart|halt)$/) { print "Broadcast message: The system is going down for reboot NOW !!"; }
15 when (/^!google/) { print "UTFG Yourself: http://google.com/"; }
16 when (/^!uptime$/) { print qx{uptime}; }
17 when (/^!date$/) { print qx{date}; }
18 when (/^!dmesg$/) { print qx{ dmesg | tail -n 5 | tr '\n' '\t' } }
b44d7b66 19}
This page took 0.13094 seconds and 4 git commands to generate.