[HELP] standpoint/distance

Forum closed. All further discussion to be discussed at https://github.com/OpenKore/

Moderator: Moderators

Message
Author
6r1sw0Ld
Noob
Noob
Posts: 5
Joined: 21 Jun 2008, 20:14
Noob?: No

[HELP] standpoint/distance

#1 Post 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
Last edited by 6r1sw0Ld on 24 Jun 2008, 13:06, edited 7 times in total.

iamanoob
Plain Yogurt
Plain Yogurt
Posts: 82
Joined: 04 Apr 2008, 09:49

Re: [HELP] about standpoint

#2 Post 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
Image
DARKest Ninja

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

Re: [HELP] standpoint/distance & about relog

#3 Post by hakore »

1) My hands are full at the moment. I'll check on this some other time.

2) ignoreInvalidLogin 1
Whatever...

iamanoob
Plain Yogurt
Plain Yogurt
Posts: 82
Joined: 04 Apr 2008, 09:49

Re: [HELP] standpoint/distance & about relog

#4 Post 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"
Image
DARKest Ninja

6r1sw0Ld
Noob
Noob
Posts: 5
Joined: 21 Jun 2008, 20:14
Noob?: No

Re: [HELP] standpoint/distance & about relog

#5 Post by 6r1sw0Ld »

thnx hakore ^_^

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

Re: [HELP] standpoint/distance & about relog

#6 Post 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?
Whatever...

6r1sw0Ld
Noob
Noob
Posts: 5
Joined: 21 Jun 2008, 20:14
Noob?: No

Re: [HELP] standpoint/distance & about relog

#7 Post by 6r1sw0Ld »

just plain map-routing that includes warp npc or just like iamanoob saying about his problem

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

Re: [HELP] standpoint/distance & about relog

#8 Post 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.
Whatever...

iamanoob
Plain Yogurt
Plain Yogurt
Posts: 82
Joined: 04 Apr 2008, 09:49

Re: [HELP] standpoint/distance & about relog

#9 Post 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! =)
Image
DARKest Ninja

6r1sw0Ld
Noob
Noob
Posts: 5
Joined: 21 Jun 2008, 20:14
Noob?: No

Re: [HELP] standpoint/distance & about relog

#10 Post 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.

Locked