here is a patch for a new and improved auto talk cont
this patch will add a 1 second delay before it send the talk cont command (move delay to a config option?)
i have tested this on iro valkrie running through the entire novice land from front to back with autoTalkCont set to 1
and it worked flawlessly not disconnecting once !
Code: Select all
Index: Network/Receive/kRO/Sakexe_0.pm
===================================================================
--- Network/Receive/kRO/Sakexe_0.pm (revision 7333)
+++ Network/Receive/kRO/Sakexe_0.pm (working copy)
@@ -4354,10 +4354,10 @@
$ai_v{npc_talk}{time} = time;
if ($config{autoTalkCont}) {
- message TF("%s: Auto-continuing talking\n", $name), "npc";
- $messageSender->sendTalkContinue($ID);
+ #message TF("%s: Auto-continuing talking\n", $name), "npc";
+ #$messageSender->sendTalkContinue($ID);
# This time will be reset once the NPC responds
- $ai_v{npc_talk}{time} = time + $timeout{'ai_npcTalk'}{'timeout'} + 5;
+ #$ai_v{npc_talk}{time} = time + $timeout{'ai_npcTalk'}{'timeout'} + 5;
} else {
message TF("%s: Type 'talk cont' to continue talking\n", $name), "npc";
}
Index: Network/Receive/ServerType0.pm
===================================================================
--- Network/Receive/ServerType0.pm (revision 7333)
+++ Network/Receive/ServerType0.pm (working copy)
@@ -4327,10 +4327,10 @@
$ai_v{npc_talk}{time} = time;
if ($config{autoTalkCont}) {
- message TF("%s: Auto-continuing talking\n", $name), "npc";
- $messageSender->sendTalkContinue($ID);
+ #message TF("%s: Auto-continuing talking\n", $name), "npc";
+ #$messageSender->sendTalkContinue($ID);
# This time will be reset once the NPC responds
- $ai_v{npc_talk}{time} = time + $timeout{'ai_npcTalk'}{'timeout'} + 5;
+ #$ai_v{npc_talk}{time} = time + $timeout{'ai_npcTalk'}{'timeout'} + 5;
} else {
message TF("%s: Type 'talk cont' to continue talking\n", $name), "npc";
}
Index: Task/TalkNPC.pm
===================================================================
--- Task/TalkNPC.pm (revision 7333)
+++ Task/TalkNPC.pm (working copy)
@@ -95,6 +95,8 @@
$self->{time} = time;
$self->{stage} = 'Not Started';
$self->{mapChanged} = 0;
+
+ $self->{talkContWaitDone} = 0;
}
# Overrided method.
@@ -170,7 +172,25 @@
my $step = $self->{steps}[0];
my $npcTalkType = $ai_v{npc_talk}{talk};
- if ($step =~ /^w(\d+)/i) {
+ if ($config{autoTalkCont} && $npcTalkType eq 'next') {
+ if ($self->{talkContWaitDone} == 1) {
+ message TF("%s: NEW Auto-continuing talking\n", $self->{target}->name), "npc";
+
+ $self->{talkContWaitDone} = 0;
+ $messageSender->sendTalkContinue($self->{ID});
+ } else {
+ message TF("%s: waiting 1 second before Auto-continuing talking\n", $self->{target}->name), "npc";
+
+ # Wait x seconds
+ my $time = 1;
+ $ai_v{npc_talk}{time} = time + $time;
+ $self->{time} = time + $time;
+ $self->{talkContWaitDone} = 1;
+ }
+
+ return;
+ }
+ elsif ($step =~ /^w(\d+)/i) {
# Wait x seconds.
my $time = $1;
$ai_v{npc_talk}{time} = time + $time;