Openkore.com

OpenKore Forums
It is currently 20 Jul 2018, 12:42

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Check equiped items in within EventMacro
PostPosted: 06 Mar 2018, 17:16 
Offline
Human
Human

Joined: 09 Dec 2016, 09:05
Posts: 30
Hello. Me need help to create a macro.
Code:
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.
:(


Top
 Profile  
 
 Post subject: Re: Check equiped items in within EventMacro
PostPosted: 06 Mar 2018, 18:12 
Offline
Halfway to Eternity
Halfway to Eternity
User avatar

Joined: 17 Nov 2017, 23:32
Posts: 316
Location: Malaysia
Only have the one checking other player for macro (not sure for eventMacro & this is outdated)

Code:
$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..
:(

_________________

Wiki & Google are your best allies.
iRO server supporter.
Image


Last edited by fadreus on 06 Mar 2018, 18:15, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Check equiped items in within EventMacro
PostPosted: 06 Mar 2018, 18:15 
Offline
Human
Human

Joined: 09 Dec 2016, 09:05
Posts: 30
I try to use:
Code:
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
=\


Top
 Profile  
 
 Post subject: Re: Check equiped items in within EventMacro
PostPosted: 06 Mar 2018, 19:19 
Offline
Human
Human

Joined: 09 Dec 2016, 09:05
Posts: 30
I try:
Code:
$Item = &eval($::players{$::playersID[$::char->{charID}]}->{headgear}{top})

and take result: 33

T__T


Top
 Profile  
 
 Post subject: Re: Check equiped items in within EventMacro
PostPosted: 06 Mar 2018, 21:05 
Offline
Human
Human

Joined: 09 Dec 2016, 09:05
Posts: 30
I found a workaround:
Code:
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.
= \


Top
 Profile  
 
 Post subject: Re: Check equiped items in within EventMacro
PostPosted: 07 Mar 2018, 01:36 
Offline
Been there done that!
Been there done that!

Joined: 24 Mar 2012, 04:13
Posts: 112
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"))


Top
 Profile  
 
 Post subject: Re: Check equiped items in within EventMacro
PostPosted: 07 Mar 2018, 03:05 
Offline
Halfway to Eternity
Halfway to Eternity
User avatar

Joined: 17 Nov 2017, 23:32
Posts: 316
Location: Malaysia
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. :?

_________________

Wiki & Google are your best allies.
iRO server supporter.
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group