kalexi
13.06.2008, 17:38
Хочу чтобы когда мне писали в приват запускалось приложение, для этого использую этот плагин, но почемуто не хочет работать((
control\macros.txt
# macro
package appLauncher;
use strict;
use Globals;
use Plugins;
use Log qw(debug message warning error);
use Commands;
use Utils;
Plugins::register('appLauncher', 'Launch MS Windows/Unix applications.', \&Unload, \&Unload);
my $hook = Commands::register(
['launch','Launch MS Windows/Unix applications.',\&launch]
);
sub Unload {
Commands::unregister($hook);
}
sub launch {
my (undef, $args) = @_;
my @args = split(/ /, $args);
if($args[0]){
launchApp(1, $args[0]);
message "Launching $args[0]\n";
}else{
message("Syntax Error in function 'launch'\nUsage: launch < patch >\nWhere < patch > is a patch to your application.\n","info");
}
}
return 1;
control\config.txt
alertSound - {
eventList private chat
notInTown 0
inLockOnly 0
play D:\RO\BOT\sounds\phone.wav
Macro launch D:\RO\BOT\BotMail.exe
}
Пишет это и отказывается запускать:
...
[Jun 13 17:27:12 2008.84] Loading control\macros.txt...
[Jun 13 17:27:12 2008.96] control\macros.txt: ignoring ');' (munch, munch, strange food)
[Jun 13 17:27:12 2008.99] control\macros.txt: ignoring line 'sub Unload {' (munch, munch, strange block)
[Jun 13 17:27:13 2008.11] control\macros.txt: ignoring line 'sub launch {' (munch, munch, strange block)
[Jun 13 17:27:13 2008.33] control\macros.txt: ignoring '}' (munch, munch, strange food)
[Jun 13 17:27:13 2008.87] [macro] hooking to AI_pre
...
Сохраняю в UTF-8. Первая строчка закоментирована.
control\macros.txt
# macro
package appLauncher;
use strict;
use Globals;
use Plugins;
use Log qw(debug message warning error);
use Commands;
use Utils;
Plugins::register('appLauncher', 'Launch MS Windows/Unix applications.', \&Unload, \&Unload);
my $hook = Commands::register(
['launch','Launch MS Windows/Unix applications.',\&launch]
);
sub Unload {
Commands::unregister($hook);
}
sub launch {
my (undef, $args) = @_;
my @args = split(/ /, $args);
if($args[0]){
launchApp(1, $args[0]);
message "Launching $args[0]\n";
}else{
message("Syntax Error in function 'launch'\nUsage: launch < patch >\nWhere < patch > is a patch to your application.\n","info");
}
}
return 1;
control\config.txt
alertSound - {
eventList private chat
notInTown 0
inLockOnly 0
play D:\RO\BOT\sounds\phone.wav
Macro launch D:\RO\BOT\BotMail.exe
}
Пишет это и отказывается запускать:
...
[Jun 13 17:27:12 2008.84] Loading control\macros.txt...
[Jun 13 17:27:12 2008.96] control\macros.txt: ignoring ');' (munch, munch, strange food)
[Jun 13 17:27:12 2008.99] control\macros.txt: ignoring line 'sub Unload {' (munch, munch, strange block)
[Jun 13 17:27:13 2008.11] control\macros.txt: ignoring line 'sub launch {' (munch, munch, strange block)
[Jun 13 17:27:13 2008.33] control\macros.txt: ignoring '}' (munch, munch, strange food)
[Jun 13 17:27:13 2008.87] [macro] hooking to AI_pre
...
Сохраняю в UTF-8. Первая строчка закоментирована.