Bots to move to priest for buffs when skill is inactive.

All resolved question will be found here. It is recommended that you browse / search through this section first and see if your question has been answered before

Moderators: Moderators, Documentation Writers

Message
Author
LeHartx
Noob
Noob
Posts: 17
Joined: 21 Jul 2017, 12:02
Noob?: Yes

Bots to move to priest for buffs when skill is inactive.

#1 Post by LeHartx »

So the priest will be in a party and be planted in a stationery spot in a given map.
I want the other party members to move to the priest for buffs when statusInactive.

Any idea how to do it? I've tried researching about it but to no avail. Please help.

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

Re: Bots to move to priest for buffs when skill is inactive.

#2 Post by hakore »

Two macro/automacro blocks that set/unset lockMap_x/lockMap_y depending on the currently active/inactive status
Whatever...

LeHartx
Noob
Noob
Posts: 17
Joined: 21 Jul 2017, 12:02
Noob?: Yes

Re: Bots to move to priest for buffs when skill is inactive.

#3 Post by LeHartx »

hakore wrote:Two macro/automacro blocks that set/unset lockMap_x/lockMap_y depending on the currently active/inactive status
I've tried draft coding, can you see it for me and correct the mistakes? :(

Code: Select all

automacro buff
{
	location mapname
	run-once 1
	if ($.status!=blessing || $.status!=agi)
	{
		log Buffs inactive, moving to priest. # print msg in console
		do move 100 100 # move to stationery priest coordinates
	}
	if ($.status==blessing && $.status==agi)
	{
		log I have Blessing & Agi on me.
		release buff
	} 
	exclusive 1
}

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

Re: Bots to move to priest for buffs when skill is inactive.

#4 Post by hakore »

Nice try on your macro. The logic is there, but the syntax is shouting "Oh shit!"

Also, issuing a move command may not be the best solution as this may conflict with other AI routines along the way. So like I said, setting lockMap_x and _y will force the bot to move on its own to that spot as intended.

Maybe others can help you build your macro correctly.

BTW, the doCommand block will fairly do well for this purpose.

Code: Select all

## This assumes there are only two doCommand blocks in your config.txt

doCommand conf lockMap_x 100;;conf lockMap_y 100;;conf doCommand_0_disabled 1;;conf doCommand_1_disabled 0 {
	inLockOnly 1
	whenStatusInactive Blessing, Increase AGI
	disabled 0
	timeout 10
}

doCommand conf lockMap_x none;;conf lockMap_y none;;conf doCommand_0_disabled 0;;conf doCommand_1_disabled 1 {
	inLockOnly 1
	whenStatusActive Blessing, Increase AGI
	disabled 0
	timeout 10
}
You can also set lockMap_randX and Y if you wish so you won't easily be pranked by warpers.
Whatever...

LeHartx
Noob
Noob
Posts: 17
Joined: 21 Jul 2017, 12:02
Noob?: Yes

Re: Bots to move to priest for buffs when skill is inactive.

#5 Post by LeHartx »

Uhh I've tried with your codes but the error keeps popping up

Code: Select all

Unknown command 'lockMap_x'. Please read the documentation for a list of commands.
http://openkore.com/index.php/Category:Console_Command
Have any idea? I pasted it in config.txt. No macros.

Seems like the "doCommand conf" is a wrong syntax?

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

Re: Bots to move to priest for buffs when skill is inactive.

#6 Post by hakore »

A quick review, there should be no space after the double semi-colons. My bad.

Code: Select all

 doCommand conf lockMap_x 100;;conf lockMap_y 100;;etc...
Please try this.
Whatever...

LeHartx
Noob
Noob
Posts: 17
Joined: 21 Jul 2017, 12:02
Noob?: Yes

Re: Bots to move to priest for buffs when skill is inactive.

#7 Post by LeHartx »

Alright no errors this time but this came up.

Code: Select all

Invalid coordinates specified for lockMap, coordinates are unwalkable
Invalid coordinates specified for randomWalk (coordinates are unwalkable); randomWalk disabled
I then added route_randomWalk 0 & 1 to the given codes to make it move.

However this still comes up,

Code: Select all

Config 'lockMap_x' is already *None*
Config 'lockMap_y' is already *None*
thus making it not move again.

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

Re: Bots to move to priest for buffs when skill is inactive.

#8 Post by hakore »

Of course you need to change 100, 100 to the correct coordinates. Is it even walkable to begin with? If it is, then _randX/Y should be set so that it only covers walkable tiles. Experiment with different values.

You should reset routeRandomWalk to 1 again since openkore disabled it for you when you specified lockMap_randX/Y that covers unwalkable tiles.

If you also notice, I wrote it assumes there are exactly two doCommand blocks in your whole config.txt

If you're not sure, manually type conf doCommand_0 up to _5 so you'll see you're disabling the correct one. The basic idea is if one triggers, it should disable itself and enable the other, so the "config is already" notice should never appear.
Whatever...

LeHartx
Noob
Noob
Posts: 17
Joined: 21 Jul 2017, 12:02
Noob?: Yes

Re: Bots to move to priest for buffs when skill is inactive.

#9 Post by LeHartx »

It seems quite buggy, sometimes it moves to the coordinates when it doesn't have bless or agi, and sometimes it just continues with attacking mobs.

And when it does reach the correct coordinates and gets the buffs, it still continues sitting there without doing anything.

Code: Select all

doCommand conf lockMap_x 364;;conf lockMap_y 220;;conf doCommand_0_disabled 1;;conf doCommand_1_disabled 0 {
   inLockOnly 1
   whenStatusInactive Blessing, Increase AGI
   attackAuto 0
   disabled 0
   timeout 10
}

doCommand conf lockMap_x none;;conf lockMap_y none;;conf doCommand_0_disabled 0;;conf doCommand_1_disabled 1 {
   inLockOnly 1
   whenStatusActive Blessing, Increase AGI
   attackAuto 2
   route_randomWalk 1
   disabled 0
   timeout 10
}
Am I doing something wrong here?

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

Re: Bots to move to priest for buffs when skill is inactive.

#10 Post by hakore »

Code: Select all

doCommand conf lockMap_x 364;;conf lockMap_y 220;;conf attackAuto 0;;conf route_randomWalk 0;;conf doCommand_0_disabled 1;;conf doCommand_1_disabled 0 {
   inLockOnly 1
   whenStatusInactive Blessing, Increase AGI
   disabled 0
   timeout 10
}

doCommand conf lockMap_x none;;conf lockMap_y none;;conf attackAuto 2;;conf route_randomWalk 1;;conf doCommand_0_disabled 0;;conf doCommand_1_disabled 1 {
   inLockOnly 1
   whenStatusActive Blessing, Increase AGI
   disabled 0
   timeout 10
}
Whatever...

Locked