How to get item position on ground

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

TormenT
Human
Human
Posts: 33
Joined: 13 Nov 2012, 07:57
Noob?: No

How to get item position on ground

#1 Post by TormenT »

i know this get char position, but it is possible to change this variable "::char" to some other that get the position of the item on the floor, i want use move x y to item for openkore use greed.

Code: Select all

 $mx = @eval($::char->{pos}{x})
$my = @eval($::char->{pos}{y})
i have this macro and if item in console appears in this format "Item Exists: Garra de Harpia (0) x 1" macro dont trigger and dont possible get position with regexp, only this format "Item Exist: Garra de Harpia (1) x 1 (259, 222)"


Code: Select all

automacro greed {
	console /\(.*)\: (/Cauda de Dragão|Escama de Dragão|Canino de Dragão|Ferradura em Chamas|Pele de Dragão|Pequeno Chifre Maligno|Cauda de Escorpião|Coração Incandescente|Lenha em Brasa|Erva Branca/) \((.*)\) x (.*) \((.*), (.*)\)/
	map mag_dun02
	overrideAI 1
	exclusive 1
	run-once 1
	call use
}

macro use {
	$itemPos = $.lastMatch5 $.lastMatch6
	do move $itemPos
	do ss 1013
	do ss 1013 
	log XXXXXXXXXXXXXXXGANANCIAXXXXXXXXXXXXXXXXXXXXX
	do tele
	log XXXXXXXXXXXXXXXXTELEPORTXXXXXXXXXXXXXXXXXXXX
	release greed
}
is possible to use "if" in automacro?
I want to do something if no item has the word on the island, he does teleport action, and if you have "Item" him to do another action, but I do not know how
any ideas?

Thanks
TormenT
Human
Human
Posts: 33
Joined: 13 Nov 2012, 07:57
Noob?: No

Re: How to get item position on ground

#2 Post by TormenT »

Thanks, but this metod u use only get position of Item Apears not Item exist, i solved with another form