5689
Comment:
|
6482
|
Deletions are marked like this. | Additions are marked like this. |
Line 5: | Line 5: |
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. | 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 at References. |
Line 10: | Line 10: |
All references are based on the following format | All references are based on the following format: |
Line 14: | Line 14: |
every valid reference will return a value in the log tab if preceeded by print. | Every valid reference will return a value in the log tab if preceeded by print. |
Line 20: | Line 20: |
e.g | e.g.: |
Line 25: | Line 25: |
e.g | e.g.: |
Line 32: | Line 32: |
e.g. <<BR>> | e.g.: <<BR>> |
Line 35: | Line 35: |
That will tell the bot to find a label named buyfood if the price of food is less than 5 | That will tell the bot to find a label named buyfood if the price of food is less than 5. |
Line 37: | Line 37: |
Next step is tieing the two parts together | Next step is tying the two parts together: |
Line 47: | Line 47: |
A simple script like that will keep checking the price of food and post a bid every time it drops below 5 | A simple script like that will keep checking the price of food and post a bid every time it drops below 5. <<BR>> Make sure to get your spelling right. Scripts are case sensitive. If the reference is fieldId, fieldid or FieldId won't work.<<BR>> The same applies for correct spacing. Miss a space and your reference won't work. <<BR>><<BR>> Correct way -> ifgoto ( m_context.sellPrice(0) < 5 ) buyfood<<BR>> Wrong way -> ifgoto ( m_context.sellPrice(0) < 5) buyfood<<BR>> Wrong way -> ifgoto ( m_context.sellPrice(0) < 5 ) buyfood<<BR>> Wrong way -> ifgoto ( m_context.sellPrice (0)< 5) buyfood<<BR>> Wrong way -> ifgoto (m_context.sellPrice(0) <5 ) buyfood<<BR>> Wrong way -> ifgoto (m_context.sellPrice (0)<5) buyfood<<BR>> <<BR>> Taking the time to write references properly the first time around can save you hours and days of debugging later. |
Line 51: | Line 64: |
Basicall it is the number in the list. You can refer to the number in the list by changing the array number | Basically it is the number in the list. You can refer to the number in the list by changing the array number: |
Line 69: | Line 82: |
To differenciate between the different resources you can replace 0 with 1, 2 or 3 for wood stone and iron respectively. | To differentiate between resources you can replace 0 with 1, 2, or 3 for wood, stone, and iron respectively. |
Line 75: | Line 88: |
You can check for the amount being traded with the following line | You can check for the amount being traded with the following line: |
Line 79: | Line 92: |
What is being traded? To see the resource name being traded use this | What is being traded? To see the resource name being traded use this: |
Line 93: | Line 106: |
1 means selling 0 means buying | 1 means selling, 0 means buying |
Line 116: | Line 129: |
This one lets you check if they are closer than 60 seconds<<BR>> | This one lets you check if they are closer than 60 seconds.<<BR>> |
Line 126: | Line 139: |
Check if enemy is carrying resources<<BR>> | Check if enemy is carrying resources:<<BR>> |
Line 132: | Line 145: |
Check what troops enemy is sending<<BR>> | Check what troops enemy is sending:<<BR>> |
Line 146: | Line 159: |
What hero is the enemy sending lvl, name?<<BR>> | What hero is the enemy sending (lvl, name)?<<BR>> |
Get your references right
Contents
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 at References.
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 tying 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.
Make sure to get your spelling right. Scripts are case sensitive. If the reference is fieldId, fieldid or FieldId won't work.
The same applies for correct spacing. Miss a space and your reference won't work.
Correct way -> ifgoto ( m_context.sellPrice(0) < 5 ) buyfood
Wrong way -> ifgoto ( m_context.sellPrice(0) < 5) buyfood
Wrong way -> ifgoto ( m_context.sellPrice(0) < 5 ) buyfood
Wrong way -> ifgoto ( m_context.sellPrice (0)< 5) buyfood
Wrong way -> ifgoto (m_context.sellPrice(0) <5 ) buyfood
Wrong way -> ifgoto (m_context.sellPrice (0)<5) buyfood
Taking the time to write references properly the first time around can save you hours and days of debugging later.
What is Array?
Basically 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 differentiate between 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