Routing between mosk_dun02 and mosk_dun03

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

Moderators: Moderators, Developers

Message
Author
sofax222
Developers
Developers
Posts: 214
Joined: 24 Nov 2010, 03:08
Noob?: Yes

Re: Routing between mosk_dun02 and mosk_dun03

#21 Post by sofax222 »

kLabMouse wrote: the .dist file is used to calculate the route. It's build automatically from .fld file.
Actially, I use th UltraEdit to Edit the .fld file. And, remove the .dist file, let it to re-build automatically from .fld file.
Because, I get the definitions from the fields/tools/gat_to_fld2.pl, such as:

Code: Select all

use constant {
	TILE_NOWALK => 0,
	TILE_WALK => 1,
	TILE_SNIPE => 2,
	TILE_WATER => 4,
	TILE_CLIFF => 8,
};

# conversion (ex. $TILE_TYPE[0] = TILE_WALK = 1), (ex. $TILE_TYPE[1] = TILE_NOWALK = 0)
my @TILE_TYPE = (	TILE_WALK,				# 0) Walkable
					TILE_NOWALK,			# 1) Non-walkable
					TILE_WATER,				# 2) Non-walkable water
					TILE_WALK|TILE_WATER,	# 3) Walkable water
					TILE_WATER|TILE_SNIPE,	# 4) Non-walkable water (snipable)
					TILE_CLIFF|TILE_SNIPE,	# 5) Cliff (snipable)
					TILE_CLIFF);			# 6) Cliff (not snipable)

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: Routing between mosk_dun02 and mosk_dun03

#22 Post by EternalHarvest »

sofax222 wrote:the "run" of "$pathfinding" is Python program.
Isn't it in C++?

Actually, that caused this problem:
closestWalkableSpot: find the closest position that is walkable (up to 2 blocks away)
- and the NPC portal was in more than 2 blocks from the closest walkable position. Increased to 7 blocks in r7735, should work now for mosk_dun03. It probably should search for maximum distance NPCs are visible and talkable on, but that can cause problems with misplaced portals.

sofax222
Developers
Developers
Posts: 214
Joined: 24 Nov 2010, 03:08
Noob?: Yes

Re: Routing between mosk_dun02 and mosk_dun03

#23 Post by sofax222 »

Isn't it in C++?
Yes, it is in C++ !

Thanks a lot !
Now my openkore is r7677, I will try the r7735 what you say !

Nicodareus
Noob
Noob
Posts: 17
Joined: 12 Feb 2012, 17:56
Noob?: Yes

Re: Routing between mosk_dun02 and mosk_dun03

#24 Post by Nicodareus »

Is this working for everyone else? My bot still gets stuck from moscovia --> mosk_fild01, but can navigate from mosk_fild01 --> mosk_fild02 fine. Then stands at 207 276 indefinitely, probably because the coordinates are wrong for the npc interact..idk. Help please!

Config.txt
######################################################
allowedMaps moscovia, mosk_fild01, mosk_fild02, mosk_dun01, mosk_dun02
allowedMaps_reaction 0
lockMap mosk_dun02
saveMap moscovia 223 191
saveMap_warpToBuyOrSell 1
######################################################

Portals.txt (manually added)
#moscovia --> mosk_dun02
moscovia 140 50 mosk_fild01 95 93 0 c c r0 c c c n
mosk_fild01 86 104 mosk_fild02 204 54 c c r2 c c c r1 c n
mosk_dun01 207 276 mosk_dun02 165 30 c c r0 n

sofax222
Developers
Developers
Posts: 214
Joined: 24 Nov 2010, 03:08
Noob?: Yes

Re: Routing between mosk_dun02 and mosk_dun03

#25 Post by sofax222 »

I use a macro with the setting in the portals.txt.
In the portals.txt:

Code: Select all

moscovia 136 48 mosk_fild01 95 93
mosk_fild01 86 104 mosk_fild02 204 54 0 c c r2 c c c r1 c n
mosk_fild02 190 257 mosk_dun01 189 45
mosk_dun01 207 276 mosk_dun02 165 30 0 c c r0
And the macro:

Code: Select all

automacro MoscoviaToMoskFld1 {
	location moscovia 136 50 140 46
	equipped 火忍西怒畢的腰帶
	inventory "古斯里琴" == 1
	console /^.*0\s{2}往鯨魚島出發.*$/i
	run-once 1
	call {
		pause 1
		do uneq 火忍西怒畢的腰帶
		pause 1
		do eq 古斯里琴
		pause 2
		do talk resp 0
		pause 1
		release all
	} 
}

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: Routing between mosk_dun02 and mosk_dun03

#26 Post by EternalHarvest »

You can add openkore commands into dialog sequence (even in portals.txt) with:

Code: Select all

a="eq something"

sofax222
Developers
Developers
Posts: 214
Joined: 24 Nov 2010, 03:08
Noob?: Yes

Re: Routing between mosk_dun02 and mosk_dun03

#27 Post by sofax222 »

EternalHarvest wrote:You can add openkore commands into dialog sequence (even in portals.txt) with:

Code: Select all

a="eq something"
Does it support r7762 ?
Is there any example ?
Is one "a" for one command ?
Is one "a" for commands ?
Or I can add multiple "a" pamameters ?

But this case, the openkore is inactive talking with NPC not active !

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: Routing between mosk_dun02 and mosk_dun03

#28 Post by EternalHarvest »

Does it support r7762 ?
It's a very old feature, should work.
Is there any example ?
No idea.
Is one "a" for one command ?
Is one "a" for commands ?
You can put multiple commands with ";;", as usual.
Or I can add multiple "a" pamameters ?
You can, since it's just another NPC conversation code.
But this case, the openkore is inactive talking with NPC not active !
What?

sofax222
Developers
Developers
Posts: 214
Joined: 24 Nov 2010, 03:08
Noob?: Yes

Re: Routing between mosk_dun02 and mosk_dun03

#29 Post by sofax222 »

EternalHarvest wrote:
But this case, the openkore is inactive talking with NPC not active !
What?
Usually, openkore start to talk to npc with "talk" or "talknpc" command !
But in this case, openkore need to walk close to the NPC,
and wait, then the NPC will actively talk to openkore !

So, in my macro, there is no any "talknpc" command, but only "talk resp" command !

iMikeLance
Moderators
Moderators
Posts: 208
Joined: 01 Feb 2010, 17:37
Noob?: No
Location: Brazil - MG
Contact:

Re: Routing between mosk_dun02 and mosk_dun03

#30 Post by iMikeLance »

sofax222 wrote:
EternalHarvest wrote:
But this case, the openkore is inactive talking with NPC not active !
What?
Usually, openkore start to talk to npc with "talk" or "talknpc" command !
But in this case, openkore need to walk close to the NPC,
and wait, then the NPC will actively talk to openkore !

So, in my macro, there is no any "talknpc" command, but only "talk resp" command !
That's right, you can't left-click the NPC ingame and you can't start talking with it by the usual way. The npc automatically starts talking with you when you get near the specified area, and this "specified area" isn't always a walkable path near the NPC, sometimes it's far from it.


EDIT: Just found out that talknpc supports a=<string>, where <string> is a console command. But even with that talknpc requires kore to start the talk sequence, where in this case it should be started by the NPC when entering the area.

Locked