translate && del Redundant codes && some new var

This commit is contained in:
Denny Dai
2015-05-30 01:30:08 +08:00
parent 75c23b86e9
commit 2347defd47
10 changed files with 18 additions and 100 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
PluginList("echo", "输出");
PluginList("echo", "Echo what you typed.");
if (preg_match("/^".TAG."echo (.*)$/", $_GET['text'], $matches)) {
$BOT->exec("msg ".$from." ".$matches[1]);
}
+2 -2
View File
@@ -1,7 +1,7 @@
<?php
PluginList("help", "查看帮助");
PluginList("help", "Ask for help");
if (preg_match("/^".TAG."help$/", $_GET['text'])) {
$plugin_list = "欢迎使用来自Dennx.com的TG-BOT";
$plugin_list = "Welcome to use TG-BOT From Dennx.com";
foreach ($plugins as $value) {
$plugin_list .= "\n".$value;
}
+7 -7
View File
@@ -1,12 +1,12 @@
<?php
PluginList("ipto", "IP变形");
PluginList("ipto", "Change the form of IP address");
if (preg_match("/^".TAG."ipto (.*)$/", $_GET['text'], $matches)) {
$arr = explode('.',$matches[1]);
$msg = 'IP: '.$arr[0].'.'.$arr[1].'.'.$arr[2].'.'.$arr[3];
$msg .= "\n整数型: ".($arr[0] * pow(256,3) + $arr[1] * pow(256,2) + $arr[2] * 256 + $arr[3]);
$msg .= "\n八进制: 0".decoct($arr[0]).".0".decoct($arr[1]).".0".decoct($arr[2]).'.0'.decoct($arr[3]);
$msg .= "\n十六进制: 0x".dechex($arr[0]).".0x".dechex($arr[1]).".0x".dechex($arr[2]).'.0x'.dechex($arr[3]);
$msg .= "\n变态十六进制: 0x0000000000".dechex($arr[0]).".0x0000000000".dechex($arr[1]).".0x0000000000".dechex($arr[2]).'.0x0000000000'.dechex($arr[3]);
$msg .= "\n原ip、八进制、十六进制以及变态十六进制ip可以任意组合,如: 0".decoct($arr[0]).'.0x0000000000'.dechex($arr[1]).'.'.$arr[2].'.0x'.dechex($arr[3]);
$msg = 'IP: '.$arr[0].'.'.$arr[1].'.'.$arr[2].'.'.$arr[3];
$msg .= "\nint: ".($arr[0] * pow(256,3) + $arr[1] * pow(256,2) + $arr[2] * 256 + $arr[3]);
$msg .= "\noct: 0".decoct($arr[0]).".0".decoct($arr[1]).".0".decoct($arr[2]).'.0'.decoct($arr[3]);
$msg .= "\nhex: 0x".dechex($arr[0]).".0x".dechex($arr[1]).".0x".dechex($arr[2]).'.0x'.dechex($arr[3]);
$msg .= "\nfucking hex: 0x0000000000".dechex($arr[0]).".0x0000000000".dechex($arr[1]).".0x0000000000".dechex($arr[2]).'.0x0000000000'.dechex($arr[3]);
$msg .= "\nYou can combine them with any combination. Such as: 0".decoct($arr[0]).'.0x0000000000'.dechex($arr[1]).'.'.$arr[2].'.0x'.dechex($arr[3]);
$BOT->exec("msg ".$from." ".escapeString($msg));
}
+2 -2
View File
@@ -1,5 +1,5 @@
<?php
//PluginList("trans", "翻译");
//PluginList("trans", "translate");
if (preg_match("/^".TAG."trans (.*)$/", $_GET['text'], $matches)) {
$matches = explode(" ", $matches[1], 2);
if (!isset($matches[1])) {
@@ -10,7 +10,7 @@ if (preg_match("/^".TAG."trans (.*)$/", $_GET['text'], $matches)) {
$text = $matches[1];
}
$trans = file_get_contents("http://tool.dennx.com/translate/?text=".$text."&to=".$to);
$msg = "翻译结果: ".$trans;
$msg = "Result: ".$trans;
$BOT->exec("msg ".$from." ".escapeString($msg));
}
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
PluginList("tts", "文字转语音");
PluginList("tts", "Text To Speech");
if (preg_match("/^".TAG."tts (.*)$/", $_GET['text'], $matches)) {
$mp3 = file_get_contents("http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&text=".$matches[1]);
$file = fopen($_GET['from'].".mp3","w");