Get your references right



This is not going to be a complete list of available references in NEAT. Look at it as a getting started guide. You will find most of the commonly used references but for the total list use Dismayed's list.

How to use a reference


All references are based on the following format

( reference {operator} value )

every valid reference will return a value in the log tab if preceeded by print.

If you try to grab a reference that does not exist it will give a 1069 error.

An example is trying to print the heroname from marching army number 6 when you have only got 5 armies marching.


e.g

print m_context.sellPrice(0) will show you the current price of food
To make it easier on the eyes you can add a comment on what it is in front

e.g

print food is now sold for ( m_context.sellPrice(0) )

To use this reference in a script you need a comparable, an ifgoto or an ifgosub command and a label to go to.

e.g.
ifgoto ( m_context.sellPrice(0) < 5 ) buyfood
That will tell the bot to find a label named buyfood if the price of food is less than 5
Next step is tieing the two parts together

1: label checkfoodprice
2: ifgoto ( m_context.sellPrice(0) < 5 ) buyfood
3: loop

4: label buyfood
5: buy food 9999999 5
6: goto checkfoodprice

A simple script like that will keep checking the price of food and post a bid every time it drops below 5


What is Array?



Basicall it is the number in the list. You can refer to the number in the list by changing the array number

e.g. 1: print ( m_city.cityManager.tradesArray[0].resType )
where 0 is the first in the list and 9 is the last in the market window.


Market references




If you just want to check the prices for the various resources use the following lines.
print sellPrice food ( m_context.sellPrice(0) )

print buyPrice food ( m_context.buyPrice(0) )
The first line will check the current sell price on food posted in the market and the second will check the highest posted bid.

To differenciate between the different resources you can replace 0 with 1, 2 or 3 for wood stone and iron respectively.
You can also type the res name out as shown below.
print x –sellPrice food m_city.cityManager.sellPrice(food)

You can check for the amount being traded with the following line
print ( m_city.cityManager.tradesArray[0].amount )

What is being traded? To see the resource name being traded use this
print ( m_city.cityManager.tradesArray[0].resourceName )
The following will return the resnumber being traded.
print ( m_city.cityManager.tradesArray[0].resType )

Is it buying or selling?
print ( m_city.cityManager.tradesArray[0].tradeTypeName )
print ( m_city.cityManager.tradesArray[0].tradeType )
1 means selling 0 means buying

What price is being used in the trade?
print ( m_city.cityManager.tradesArray[0].price )

Curious about what evony calls your trade?
print ( m_city.cityManager.tradesArray[0].id )

How much has it moved so far?
print ( m_city.cityManager.tradesArray[0].dealedAmount )
print ( m_city.cityManager.tradesArray[0].dealedTotal )

War references


Incoming enemies


Do we have incoming armies?
print m_city.cityManager.hasEnemyArmies
This line returns either True or False.
print m_city.cityManager.hasEnemyArmiesWithin(60)
This one lets you check if they are closer than 60 seconds

How many attacks are coming?
print m_city.cityManager.NumberOfRealAttacks

What is the attackers lordname, cityname and alliance?
print m_city.cityManager.enemyArmies[0].king
print m_city.cityManager.enemyArmies[0].startPosName
print m_city.cityManager.enemyArmies[0].alliance

Check if enemy is carrying resources
print m_city.cityManager.enemyArmies[0].resource.food
print m_city.cityManager.enemyArmies[0].resource.wood
print m_city.cityManager.enemyArmies[0].resource.stone
print m_city.cityManager.enemyArmies[0].resource.iron

Check what troops enemy is sending
print m_city.cityManager.enemyArmies[0].troop.peasants
print m_city.cityManager.enemyArmies[0].troop.militia
print m_city.cityManager.enemyArmies[0].troop.scouter
print m_city.cityManager.enemyArmies[0].troop.pikemen
print m_city.cityManager.enemyArmies[0].troop.swordsmen
print m_city.cityManager.enemyArmies[0].troop.archer
print m_city.cityManager.enemyArmies[0].troop.lightCavalry
print m_city.cityManager.enemyArmies[0].troop.heavyCavalry
print m_city.cityManager.enemyArmies[0].troop.carriage
print m_city.cityManager.enemyArmies[0].troop.ballista
print m_city.cityManager.enemyArmies[0].troop.batteringRam
print m_city.cityManager.enemyArmies[0].troop.catapult

What hero is the enemy sending lvl, name?
print m_city.cityManager.enemyArmies[0].heroLevel
print m_city.cityManager.enemyArmies[0].hero


CategoryHowTo

References-Kento11 (last edited 2012-10-02 18:59:42 by Inanna)