Page 1 of 1

Check equiped items in within EventMacro

Posted: 06 Mar 2018, 17:16
by Glikadin
Hello. Me need help to create a macro.

Code: Select all

macro HatQuests {
	if (&eval(($::questList->{62963}->{time})?1:0) == 1) {
		$QuestEndTime = &eval($::questList->{62963}->{time})
		if ($QuestEndTime > $.time) {
			stop
		}
		$QuestEndTime = undef
	}
	if (???IsEquippedID???lowHead??? == 5403) {
		pause 1
	} else {
		#here instruction
		stop
	}
	if (???IsEquippedID???topHead??? == 5378) {
		pause 1
	} else {
		#here instruction
                stop
	}
}
But i have a problem: need to use some conditions in within macro. Dont use automacro condition.
:(

Re: Check equiped items in within EventMacro

Posted: 06 Mar 2018, 18:12
by fadreus
Only have the one checking other player for macro (not sure for eventMacro & this is outdated)

Code: Select all

$top = @eval (Misc::headgearName($::players{$::playersID[$id]}->{headgear}{top}))
$mid = @eval (Misc::headgearName($::players{$::playersID[$id]}->{headgear}{mid}))
$low = @eval (Misc::headgearName($::players{$::playersID[$id]}->{headgear}{low}))
Found this:
vitriol wrote:you should look at Globals.pm for the list of players on screen. And then loop for each player and compare the coordinates. that file also contains everything else you requested as well but it's easier with plugins imho since you can use functions like this one in Actors/Item.pm

# $ActorItem->equippedInSlot(slot)
# slot: slot to check
# Returns: wheter item is equipped in $slot
sub equippedInSlot {
my ($self, $slot) = @_;
return ($self->{equipped} & $equipSlot_rlut{$slot});
}

Don't know if you can make use of this..
:(

Re: Check equiped items in within EventMacro

Posted: 06 Mar 2018, 18:15
by Glikadin
I try to use:

Code: Select all

macro test {
	$Item = &eval($::char->{headgear}{top})
	[
		log =================
		log ITEM = $Item
		log =================
	]
}
But i get wrong ID :
Criatura Academy Hat (ID:18730) , i get : 341
=\

Re: Check equiped items in within EventMacro

Posted: 06 Mar 2018, 19:19
by Glikadin
I try:

Code: Select all

$Item = &eval($::players{$::playersID[$::char->{charID}]}->{headgear}{top})
and take result: 33

T__T

Re: Check equiped items in within EventMacro

Posted: 06 Mar 2018, 21:05
by Glikadin
I found a workaround:

Code: Select all

macro HatQuests {
   if (&eval(($::questList->{62963}->{time})?1:0) == 1) {
      $QuestEndTime = &eval($::questList->{62963}->{time})
      if ($QuestEndTime > $.time) {
         stop
      }
      $QuestEndTime = undef
   }
   if (CheckHaveItem(5403) == 1) {
		pause 1
   } else {
		#here instruction
		stop
   }
   if (CheckHaveItem(5378) == 1) {
		pause 1
   } else {
		#here instruction
		stop
   }
}

sub CheckHaveItem {
	my ($ItemID) = @_;
	my $CheckingItem = $char->inventory->getByNameID($ItemID) ;
	unless ($CheckingItem) {
		return 0;
	}
	return 1;
}
'CheckHaveItem' return 1 if you have item (equiped or in inventory) and 0 if you not have.
= \

Re: Check equiped items in within EventMacro

Posted: 07 Mar 2018, 01:36
by c4c1n6kr3m1
i don't know if u can use this
this was part of eval condotion on my old macro

( !$::char->{equipment}{leftAccessory} || ( $::char->{equipment}{leftAccessory}{name} ne "Bloodied Shackle Ball"))

Re: Check equiped items in within EventMacro

Posted: 07 Mar 2018, 03:05
by fadreus
Wondering if Brazil forum have some lead.
I don't know Portuguese to start searching. >w<
I heard their community is more active than here.
Also most current dev are from Brazil.

Only found some from Indo & Chinese community which is outdated as well. :?