Page 1 of 2

[HELP] standpoint/distance

Posted: 21 Jun 2008, 21:04
by 6r1sw0Ld
hi hello gud day

1. help about talking to kafra to use warp but the bot will not move near to her.
just like specify a standpoint or distance for selling item or buying items.
I just want my bot talk to kafra with specified distance or not moving near to her if the kafra is in vision of the bot.

2. is there a way that the bot can automatically logging-in again even if it says "incorrect password" and not force you to type your password again because In the server im playing it has some login problems even if you type your valid password.

tnx and god bless

Re: [HELP] about standpoint

Posted: 21 Jun 2008, 21:38
by iamanoob
yah me too
i dont know how to configure it...
i dont know what files should i modify
ive tried to mess up Task::Route but its still the same

Re: [HELP] standpoint/distance & about relog

Posted: 22 Jun 2008, 07:33
by hakore
1) My hands are full at the moment. I'll check on this some other time.

2) ignoreInvalidLogin 1

Re: [HELP] standpoint/distance & about relog

Posted: 22 Jun 2008, 09:02
by iamanoob
ok, thanks hakore

kore is at 217 92
warp npc is at 210 106
npc is on sight range of kore
but still it doesnt talk to it on that position
i dont know why kore comes near to it
if it comes near to it, could i disable it if its already on range
or could i set its standpoint

ive edited this

Code: Select all

elsif ( Task::Route->getRoute(\@solution, $field, $char->{pos_to}, $self->{mapSolution}[0]{pos}) ) {
			# NPC is reachable from current position
			# >> Then "route" to it
			debug "Walking towards the NPC\n", "route";
			my $task = new Task::Route(
				x => $self->{mapSolution}[0]{pos}{x},
				y => $self->{mapSolution}[0]{pos}{y},
				maxTime => $self->{maxTime},
				distFromGoal => 21,
				avoidWalls => $self->{avoidWalls},
				solution => \@solution
			);
			$self->setSubtask($task);

		}
ive edited distFromGoal from 10 to 21
from my example, it doesnt move on 217,92
but it still does that "Walking towards the NPC"

Re: [HELP] standpoint/distance & about relog

Posted: 22 Jun 2008, 10:24
by 6r1sw0Ld
thnx hakore ^_^

Re: [HELP] standpoint/distance & about relog

Posted: 22 Jun 2008, 17:26
by hakore
Regarding the standpoint thingy, may I know through which method are you talking to the NPC? Console command 'talknpc'? Or just plain map-routing that includes warp NPCs in portals.txt?

Re: [HELP] standpoint/distance & about relog

Posted: 22 Jun 2008, 21:16
by 6r1sw0Ld
just plain map-routing that includes warp npc or just like iamanoob saying about his problem

Re: [HELP] standpoint/distance & about relog

Posted: 23 Jun 2008, 08:15
by hakore
Implementing map-route standpoint into Kore is quite complicated since we will have to mess with portals.txt's format.

We can probably make a config option for the desired distance from the warp NPC though, but I don't feel we need such variation in warp NPC standpoints. The hard-coded distance of 10 is already reasonable enough.

Anyways, if you feel like messing with this, there are two places you need to look at. iamanoob already pinpointed one, but he missed its counterpart:

MapRoute.pm (Line 173)

Code: Select all

		} elsif (distance($char->{pos_to}, $self->{mapSolution}[0]{pos}) <= 10) {
MapRoute.pm (Line 206)

Code: Select all

		} elsif ( Task::Route->getRoute(\@solution, $field, $char->{pos_to}, $self->{mapSolution}[0]{pos}) ) {
			# NPC is reachable from current position
			# >> Then "route" to it
			debug "Walking towards the NPC\n", "route";
			my $task = new Task::Route(
				x => $self->{mapSolution}[0]{pos}{x},
				y => $self->{mapSolution}[0]{pos}{y},
				maxTime => $self->{maxTime},
				distFromGoal => 10,
				avoidWalls => $self->{avoidWalls},
				solution => \@solution
			);
			$self->setSubtask($task);
In both codes, change the hardcoded number 10 to your desired distance.

This is mainly based on code logic, I didn't test this myself, so just please do the honor.

Re: [HELP] standpoint/distance & about relog

Posted: 23 Jun 2008, 11:19
by iamanoob
i really am a noob XD
i havent noticed that line 173
ive tried to modify it for 2 hours and havent seen that (i r phailed :( )

anyways thanks hakore
for distance 14
kore is at 217 92
warp npc is at 210 106
replace 10 with 21
i dont know the reason why it was 21 but from 10-23
21 was for distance 14 from you to the warp npc


thanks again hakore!
mwah! =)

Re: [HELP] standpoint/distance & about relog

Posted: 24 Jun 2008, 08:37
by 6r1sw0Ld
thnx again hakore ur d best ...

one more question sir hakore, how can kore/bot talk to an npc without "talk resp".

for example talking to "npc healer" that will just heal you after talking to him without talk response.