responseOnNPCImage "response base on NPC Image" by abt123
Moderator: Moderators
-
- Noob
- Posts: 7
- Joined: 02 Aug 2008, 23:43
- Noob?: Yes
Re: responseOnNPCImage "response base on NPC Image" by abt123
Hehe!! I also have a working one.....anyways what did I do is trimming ???? down the plugins....then use a macro hooks to get the image (e.g bkd0,bkd9,bkd2) the macro do the talk num 092...
Re: responseOnNPCImage "response base on NPC Image" by abt123
are there any new updates regarding the anti bot for myRO? all the 3 images are recognized but only the last image was used by the plugin. is there any solution for this problem? thanks in advance.
Re: responseOnNPCImage "response base on NPC Image" by abt123
can anyone please help us with using this for myRO?? because the plugin only answers the third image.. not the all three..
Re: responseOnNPCImage "response base on NPC Image" by abt123
can anyone reupload the plugin files please.. i cant download it..
Re: responseOnNPCImage "response base on NPC Image" by abt123
@kakai
I wonder if u give clues about adding twice "next" in the plugins, sir..
Because my OK just answers
the last number only, instead of 3..
This is my console log, really need your help guys..
I wonder if u give clues about adding twice "next" in the plugins, sir..
Because my OK just answers
the last number only, instead of 3..
This is my console log, really need your help guys..
- Attachments
-
- console.txt
- (60.97 KiB) Downloaded 483 times
Re: responseOnNPCImage "response base on NPC Image" by abt123
i'm not download this plugin
Re: responseOnNPCImage "response base on NPC Image" by abt123
*bump*
Mucilon we really need ur help here..
Mucilon we really need ur help here..
Re: responseOnNPCImage "response base on NPC Image" by abt123
Smb can give me that plugin) just want to read)
and respImageTable.txt pls...
and respImageTable.txt pls...
Please use pin function for uploading your file contents!
Re: responseOnNPCImage "response base on NPC Image" by abt123
This is it..
Credit to: abt123
Still, facing the same problem, hope someone here could help..
Edit: Attached the plugin.
Credit to: abt123
Code: Select all
#########################################################################
# This software is open source, licensed under the GNU General Public
# License, version 2.
# Basically, this means that you're allowed to modify and distribute
# this software. However, if you distribute modified versions, you MUST
# also distribute the source code.
# See http://www.gnu.org/licenses/gpl.html for the full license.
#########################################################################
###########################
# responseOnNPCImage v1.0.1
#
# (C)2007 abt123
# For OpenKore 1.9.x
#
# NOTE: This plugin meant to be use with hakore's reactOnNPC
#
package responseOnNPCImage;
use strict;
use Plugins;
use Globals qw(%talk);
use Commands; #qw(run register unregister)
use Settings; # qw(addConfigFile delConfigFile);
use FileParsers qw(parseDataFile);
use Log qw(message error);
use I18N qw(bytesToString);
my %imageTable;
my $imageName;
my @NPCresponses;
Plugins::register('responseOnNPCImage', 'respose base on NPC Image', \&onUnload);
my $cmd = Commands::register(['talkImage', 'talk response by image', \&cmdTalkImage]);
my $hooks = Plugins::addHooks(
['packet/npc_image', \&onNPCImage],
['packet_pre/npc_talk_number', \&onNPCTalkInput],
['packet_pre/npc_talk_text', \&onNPCTalkInput],
['packet/npc_talk_responses', \&onNPCResponses]
);
my $imgf = Settings::addControlFile('respImageTable.txt', loader => [\&parseDataFile, \%imageTable]);
sub onUnload {
Plugins::delHooks($hooks);
Commands::unregister($cmd);
Settings::removeFile($imgf);
undef %imageTable;
undef $imageName;
undef @NPCresponses;
}
sub onNPCImage {
my (undef, $args) = @_;
$imageName = bytesToString($args->{npc_image});
return unless $imageName;
message "[responseOnNPCImage] Image name >> \"$imageName\"\n", "info";
}
sub onNPCTalkInput {
my (undef, $args) = @_;
$talk{ID} = $args->{ID};
}
sub onNPCResponses {
my (undef, $args) = @_;
my $msg = I18N::bytesToString(unpack("Z*", substr($args->{RAW_MSG}, 8)));
@NPCresponses = ();
my @preTalkResponses = split /:/, $msg;
foreach my $response (@preTalkResponses) {
$response =~ s/\^[a-fA-F0-9]{6}//g;
push @NPCresponses, $response if ($response ne '');
}
}
sub cmdTalkImage {
my (undef, $args) = @_;
my $cmd = '';
if ($args !~ /resp|num|text/) {
error "Syntax Error in function 'talkImage' (Talk to NPC base on NPC image)\n" .
"Usage: talkImage <resp | num | text>\n";
return;
}
if ($imageName eq '') {
error "[responseOnNPCImage] Doesn't seen any image yet!\n";
return;
}
if (defined $imageTable{$imageName} && $imageTable{$imageName} ne '') {
if ($args eq 'num') {
$cmd = "talk num $imageTable{$imageName}";
} elsif ($args eq 'text') {
$cmd = "talk text $imageTable{$imageName}";
} elsif ($args eq 'resp') {
message "[responseOnNPCImage] Match \"$imageTable{$imageName}\" to response list.\n", "info";
my $i = 0;
foreach (@NPCresponses) {
last if ($_ =~ /$imageTable{$imageName}/i);
$i++;
}
if ($i < (scalar @NPCresponses)) {
$cmd = "talk resp $i";
} else {
error "[responseOnNPCImage] Can not match \"$imageTable{$imageName}\" to response list.\n";
message "[responseOnNPCImage] You must response by yourself now!\n", "info";
}
}
} else {
if ($args eq 'num') {
if ($imageTable{'imageNameEqual'} eq 'num') {
$cmd = "talk num $imageName";
} else {
error "[responseOnNPCImage] Image name not equal to number.\n";
message "[responseOnNPCImage] You must response by yourself now!\n", "info";
}
} elsif ($args eq 'text') {
if ($imageTable{'imageNameEqual'} eq 'text') {
$cmd = "talk text $imageName";
} else {
error "[responseOnNPCImage] Image name not equal to text.\n";
message "[responseOnNPCImage] You must response by yourself now!\n", "info";
}
} elsif ($args eq 'resp') {
if ($imageTable{'imageNameEqual'} eq 'resp') {
message "[responseOnNPCImage] Match \"$imageName\" to response list.\n", "info";
my $i = 0;
foreach (@NPCresponses) {
next unless $_;
last if ($_ =~ /$imageName/i);
$i++;
}
if ($i < (scalar @NPCresponses)) {
$cmd = "talk resp $i";
} else {
error "[responseOnNPCImage] Can not match \"$imageName\" to response list.\n";
message "[responseOnNPCImage] You must response by yourself now!\n", "info";
}
} else {
error "[responseOnNPCImage] Image name not equal to response choice.\n";
message "[responseOnNPCImage] You must response by yourself now!\n", "info";
}
}
}
if ($cmd ne '') {
message "[responseOnNPCImage] Executing command \"$cmd\".\n", "success";
Commands::run($cmd);
$imageName = '';
}
}
return 1;
Edit: Attached the plugin.
Re: responseOnNPCImage "response base on NPC Image" by abt123
^
^
^
that file is must be in .pl format how to make a .pl format for it to work on plugins can anyone help?
^
^
that file is must be in .pl format how to make a .pl format for it to work on plugins can anyone help?