reactOnNPC v.2.0.2 by hakore

Other plugins for extending OpenKore's functionality. This forum is only for posting new plugins and commenting on existing plugins. For support, use the Support forum.

Moderator: Moderators

Message
Author
hakore
Super Moderators
Super Moderators
Posts: 200
Joined: 16 May 2008, 08:28
Noob?: No
Contact:

Re: reactOnNPC v.2.0.0 by hakore

#121 Post by hakore »

@tomcs70

Just a follow-up, I just realized the modified plugin may screw up after a while when you are in a guild since it will simply record ALL guild chats. It will consume large chunks of memory if you left it for days.

The following modified code for sub onGuildChat will prevent this by limiting the number of guild chats messages recorded (200 is a safe limit since the chat window cannot display more than 200 lines):

Code: Select all

sub onGuildChat
{
	my (undef, $args) = @_;
	my ($chatMsgUser, $chatMsg); # Type: String
	my $msg; # Type: String
	$msg = I18N::bytesToString($args->{message});
	if (($chatMsgUser, $chatMsg) = $msg =~ /(.*?) : (.*)/) {
		$chatMsgUser =~ s/ $//;
		stripLanguageCode(\$chatMsg);
		$msg = "$chatMsgUser : $chatMsg";
	}

	if (!defined %reactOnGuildChat || $reactOnGuildChat{action})
	{
		undef %reactOnGuildChat if defined %reactOnGuildChat;
		$reactOnGuildChat{index} = 0;
		$reactOnGuildChat{msg}[$reactOnGuildChat{index}] = $msg;
	}
	else
	{
		if ($reactOnGuildChat{index} < 200)
		{
			$reactOnGuildChat{index}++;
			$reactOnGuildChat{msg}[$reactOnGuildChat{index}] = $msg;
		}
		else
		{
			shift @{$reactOnGuildChat{msg}};
			push @{$reactOnGuildChat{msg}}, $msg;
			debug "[reactOnNPC] Guild message limit reached. Messages shifted up.\n", "reactOnNPC";
			return;
		}
	}
	debug "[reactOnNPC] Guild message saved ($reactOnGuildChat{index}): \"$msg\".\n", "reactOnNPC";
}
Whatever...

diandra05
Noob
Noob
Posts: 4
Joined: 25 Jun 2008, 20:53
Noob?: Yes

Re: reactOnNPC v.2.0.0 by hakore

#122 Post by diandra05 »

Mucilon
Where is written debug change it to message at all these lines
done...
About the accents, I mean just this:
delapan -> dêlâpån
Just add the symbols above the vowels!
errr... how exactly to do it? is there something in the tutorial (in this topic) that i missed?
You don't need the color codes, like this: ^3FBA11
Everything started with ^ and followed by 6 hexadecimal digits is a color code.
i get it

sorry 4 troubling u so much

Dawg
Human
Human
Posts: 34
Joined: 28 Apr 2008, 07:29

Re: reactOnNPC v.2.0.0 by hakore

#123 Post by Dawg »

sorry for this guys..

but can anyone post the reactonNPC for MyRO?

i cant understand what will i put on my config.txt

sorry for a noob question.. its my 1st time to use.. :(

is mine correct?

reactOnNPC talk num #1~1 {
type number
msg_0 [Bot Check]: Type this number:
msg_1 /(\d+)/
}

dunno.. i already Downloaded d botkiller. i just have to fix my reactonNPC..

tomcs70
Noob
Noob
Posts: 16
Joined: 16 Jun 2008, 22:34
Noob?: Yes

Re: reactOnNPC v.2.0.0 by hakore

#124 Post by tomcs70 »

This is the spanish config.text for thouse playing at hispanic private servers:
it worked for me, i hope i will for you.
----------------------------------------------
reactOnNPC talk num @eval("#g0~1" || "#g1~1" || "#g2~1" || "#g3~1") {
msg_0 /\[Policía\]/
msg_1 /./
msg_2 / monstruo/
msg_3 /./
msg_4 / segundos/
guildMsg_0 /^\D*(\d+)?\D*$/
guildMsg_1 /^\D*(\d+)?\D*$/
guildMsg_2 /^\D*(\d+)?\D*$/
guildMsg_3 /^\D*(\d+)?\D*$/
type number
}
------------------------------------------
Need to say that i've tested it for maybe a few hours.
Here's a pic to prove it! :)
Image
There's still room for improvement, i guess it depends on the server you play.
Thanks again for Hakore.

tomcs70
Noob
Noob
Posts: 16
Joined: 16 Jun 2008, 22:34
Noob?: Yes

Re: reactOnNPC v.2.0.0 by hakore

#125 Post by tomcs70 »

After more testing on my testing server, i found out that this
on config.txt worked all the time:


reactOnNPC talk num @eval("#g0~1" || "#g1~1" || "#g2~1" || "#g3~1") {
msg_0 /\[Policía\]/
msg_1 /./ #<----no extra checking the message
msg_2 /./
msg_3 /./
msg_4 /./
guildMsg_0 /^\D*(\d+)?\D*$/
guildMsg_1 /^\D*(\d+)?\D*$/
guildMsg_2 /^\D*(\d+)?\D*$/
guildMsg_3 /^\D*(\d+)?\D*$/
type number
}

So i'am not shure if these is like a brute hack or something dirty, but after puting it to a lot of hard testing turns out it never failed, not once!, again
i still need to test it on a real live server.
Excuse me if i elaborate too much on the subjet.

taaqui
Noob
Noob
Posts: 2
Joined: 23 Jul 2008, 08:04
Noob?: Yes

Re: reactOnNPC v.2.0.0 by hakore

#126 Post by taaqui »

Good day

I am with the same problem in Brazil in called server ragnadesire, with a small difference that it this receiving the numbers from ant-bot for publichat and not for guildchat, configures thus config.txt - http://www.ragnadesire.com/antbot/
reactOnNPC talk num @eval("#c0~1" || "#c1~1" || "#c~1" || "#c3~1") {
type number
msg_0 /\[Policial\]
msg_1 /./
msg_2 / monstros/
msg_3 /./
msg_4 /restam/
chatMsg_0 /^\D*(\d+)?\D*$/
chatMsg_1 /^\D*(\d+)?\D*$/
chatMsg_2 /^\D*(\d+)?\D*$/
chatMsg_3 /^\D*(\d+)?\D*$/
}
it continues not functioning
[Jul 23 00:08:20 2008.17] [GM] Policial: Sinto muito, mas eu devo saber se você está jogando ou usando Bot.
[Jul 23 00:08:20 2008.18] Unknown #110018708: [Policial]
[Jul 23 00:08:20 2008.18] [dist=0] Yellow Plant (0): sey eyu to sa
[Jul 23 00:08:20 2008.19] [dist=1] Monstro Yellow Plant (0): *Thanks*
[Jul 23 00:08:20 2008.20] [dist=0] Drops (2): nubo coxib pigu
[Jul 23 00:08:20 2008.21] [dist=1] Monstro Drops (2): *Kiss*
[Jul 23 00:08:20 2008.23] [dist=0] Thief Mushroom (3): emele 720 awibiv
[Jul 23 00:08:20 2008.23] [dist=1] Monstro Thief Mushroom (3): *Help*
[Jul 23 00:08:20 2008.29] [dist=0] Cramp (4): emosut usiriv yif oj
[Jul 23 00:08:20 2008.29] [dist=1] Monstro Cramp (4): *Kiss*
[Jul 23 00:08:20 2008.36] Unknown #110018708:
[Jul 23 00:08:20 2008.37] Unknown #110018708: Observe o que os monstros dizem no seu chat, apenas 1 deles irá falar números, você deve digitar o número que o monstro falou...
[Jul 23 00:08:20 2008.37] Unknown #110018708:
[Jul 23 00:08:20 2008.38] Unknown #110018708: restam noventa segundos para responder
[Jul 23 00:08:20 2008.38] Unknown #110018708: auto-continuando a conversa
[Jul 23 00:08:20 2008.57] Existe um NPC: Unknown #110018708 (161, 262) (ID 110018708) - (0)
[Jul 23 00:08:20 2008.57] Unknown #110018708: Digite 'talk num <número#>' para entrar um número.
Image

reactOnNPC.pl in annex
we modify for publiChat

I ask for to help of all , since already thankful
Attachments

[The extension pl has been deactivated and can no longer be displayed.]


Mucilon
Cybernatic Entity
Cybernatic Entity
Posts: 249
Joined: 04 Apr 2008, 13:15
Noob?: Yes
Location: Brazil

Re: reactOnNPC v.2.0.0 by hakore

#127 Post by Mucilon »

Analyzing your modified plugin, try to use this hook:
['packet/public_chat', \&onPublicChat, undef],
the same used at the kadiliman plugin.

taaqui
Noob
Noob
Posts: 2
Joined: 23 Jul 2008, 08:04
Noob?: Yes

Re: reactOnNPC v.2.0.0 by hakore

#128 Post by taaqui »

oba Mucilon tudo bom?
descobrir que você é usuário do forum BR pelo "bill" administrado de la, se poder da uma ajuda em relação a esse tópico, so da uma passada la blz? vlw cara
http://openkore.com.br/forum/showthread ... #post69566

ringbolt
Noob
Noob
Posts: 3
Joined: 26 Jul 2008, 13:01
Noob?: No

Re: reactOnNPC v.2.0.0 by hakore

#129 Post by ringbolt »

@taaqui
You need to configure the mon_control.txt for all 0 0 0, and put the monsters on your lockmap as monster 1 0 0, so that your bot won't try to atack the monsters of the anti-bot. After done that, you need to change the config of the reactOnNpc.

reactOnNPC talk num @eval("#c0~1" || "#c1~1" || "#c~1" || "#c3~1") {
type number
msg_0 /\[Policial\]
msg_1 /./
msg_2 / monstros/
msg_3 /./
msg_4 /restam/
chatMsg_0 /^\D*(\d+)?\D*$/
chatMsg_1 /^\D*(\d+)?\D*$/
chatMsg_2 /^\D*(\d+)?\D*$/
chatMsg_3 /^\D*(\d+)?\D*$/
}

@all
As you see in the kore log that you posted, the monsters doesn't use the pub chat to tell the number, they use that dist=0 thing. I play that server to, and i'm with the same problem. I spend some time analysing more attently the anti-bot with a help of a friend, and i noticed that when the anti-bot is trigged for me and the monsters say the things and the number, my friend whos right by my side can't see the monsters speeking, only i can. Does anybody have a clue on what to do them?

I appreciate the attention. (sorry about the bad inglish)

*this is my reactOnNPC.pl
Attachments

[The extension pl has been deactivated and can no longer be displayed.]


Mucilon
Cybernatic Entity
Cybernatic Entity
Posts: 249
Joined: 04 Apr 2008, 13:15
Noob?: Yes
Location: Brazil

Re: reactOnNPC v.2.0.0 by hakore

#130 Post by Mucilon »

It is simple!
Use debug 2 and search the code received by the monster message at the Receive.pm file. That way you will find out which type of message is it!

Post Reply