Check equiped items in within EventMacro

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

Moderator: Moderators

Message
Author
Glikadin
Human
Human
Posts: 29
Joined: 09 Dec 2016, 09:05
Noob?: Yes

Check equiped items in within EventMacro

#1 Post 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.
:(

User avatar
fadreus
The Kore Devil
The Kore Devil
Posts: 708
Joined: 17 Nov 2017, 23:32
Noob?: No
Location: Genting Highland, Malaysia
Contact:

Re: Check equiped items in within EventMacro

#2 Post 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..
:(
Last edited by fadreus on 06 Mar 2018, 18:15, edited 1 time in total.

iRO Supporter.
Read before you ask is the wisest thing human can do.
Unless you're a cat.
Image

Glikadin
Human
Human
Posts: 29
Joined: 09 Dec 2016, 09:05
Noob?: Yes

Re: Check equiped items in within EventMacro

#3 Post 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
=\

Glikadin
Human
Human
Posts: 29
Joined: 09 Dec 2016, 09:05
Noob?: Yes

Re: Check equiped items in within EventMacro

#4 Post by Glikadin »

I try:

Code: Select all

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

T__T

Glikadin
Human
Human
Posts: 29
Joined: 09 Dec 2016, 09:05
Noob?: Yes

Re: Check equiped items in within EventMacro

#5 Post 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.
= \

c4c1n6kr3m1
The Way Of Human
The Way Of Human
Posts: 150
Joined: 24 Mar 2012, 04:13
Noob?: Yes

Re: Check equiped items in within EventMacro

#6 Post 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"))

User avatar
fadreus
The Kore Devil
The Kore Devil
Posts: 708
Joined: 17 Nov 2017, 23:32
Noob?: No
Location: Genting Highland, Malaysia
Contact:

Re: Check equiped items in within EventMacro

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

iRO Supporter.
Read before you ask is the wisest thing human can do.
Unless you're a cat.
Image

Post Reply