[Pogamut-list] Item

jakub.gemrot pogamut-forum at artemis.ms.mff.cuni.cz
Tue Jun 23 21:53:17 CEST 2009


Re: Item

Author: jakub.gemrot

There are two problems in finding nearest health:

1) you have to know/guess where items really are, note
that Pogamut doesn't tell you whether item is really spawned
at place of Item.navpoint that is obtained from memory.getKnownItems().

You may say if Item A is spawned if memory.getSeeItem(A.ID) != null

Also note that every Item has field navpoint, so if you want to check
whether item A is or is not spawned at navpoint A.navpoint do this:

if (memory.getSeeNavPoint(A.navpoint.id) != null) {
// item A may be spawned
  if (memory.getSeeItem(A.ID) != null) {
    // item is spawned
  }
}

2) to find nearest item means to find all paths from your position
to all possibly spawned items

This is really impractical to do through GETPATH command. Instead
install last Pogamut version (2.4.1).
There is a FloydWarshallMap object you can use as 
replacement for GETPATH method.

I've written this in haste, so if you don't understand something, just ask :-)

Cheers!

Jakub





More information about the Pogamut-list mailing list