From NEAT Portal Wiki
Jump to: navigation, search
m (Notes and Comments)
(Formatting the lines)
Line 39: Line 39:
 
Configs may be written one per line, eg:
 
Configs may be written one per line, eg:
  
<blockquote>
+
<blockquote><pre>
 
config comfort:1<br>
 
config comfort:1<br>
 
config trade:0<br>
 
config trade:0<br>
 
config valley:10<br>
 
config valley:10<br>
</blockquote>
+
</pre></blockquote>
  
 
or all together on one line, eg:
 
or all together on one line, eg:
<blockquote>
+
<blockquote><pre>
 
config comfort:1,trade:0,valley:10<br>
 
config comfort:1,trade:0,valley:10<br>
</blockquote>
+
</pre></blockquote>
  
 
Directives and policies are written one per line with a space between them and the input, eg:
 
Directives and policies are written one per line with a space between them and the input, eg:
<blockquote>
+
<blockquote><pre>
 
capturedfirelimit 70<br>
 
capturedfirelimit 70<br>
 
traininghero BigGuy 120<br>
 
traininghero BigGuy 120<br>
 
resourcelimits 2b 50m 1b 30m<br>
 
resourcelimits 2b 50m 1b 30m<br>
 
distancepolicy 7 15 5 20 15<br>
 
distancepolicy 7 15 5 20 15<br>
</blockquote>
+
</pre></blockquote>
  
 
==Errors in Goals==
 
==Errors in Goals==

Revision as of 12:11, 1 June 2011

How to Use and Write Goals

Goals are where you tell the bot what you want it to do. Each city has it's own individual goals window for editing. Configurations, directives, and policies are all entered in the goals window to tell the bot what to do.

Goals Scripts City Settings.png

Syntax Highlighting

You will notice the words you type in are colored. These colors are to guide you through proper goals writing. Some things you type will show up in red. Normally this means you have typed something invalid into your goals and should fix it, but sometimes it can also be a valid line that just isn't added to the bot's internal syntax highlighting list yet. New features may show up red for awhile until they are added.

Config switches

Certain config goals in the bot can be turned on and off with a 0 or 1. Still others have a 2 or higher number as an option. Each configuation goal will be explained in the guide later, but for general knowledge: 0 means off/no/false 1 means on/yes/true

Notes and Comments

You may "comment" out certain lines by adding a // or # at the beginning of the line. The bot will not perform any goals written on a commented line. This is a good way to remind yourself what a line does, eg:

// Tell my bot not to fire any hero I capture of lvl 100 or higher<br>
capturedfirelimit 100<br>
// Tell my bot to farm lvl 5 npcs<br>
config npc:5<br>

or a good way to temporarily turn off a feature in your goals, eg:

// Tell my bot to send resources from this city to AnotherTown<br>
#keepresource AnotherTown w:20000000,i:20000000 5000000<br>

Formatting the lines

Configs may be written one per line, eg:

config comfort:1<br>
config trade:0<br>
config valley:10<br>

or all together on one line, eg:

config comfort:1,trade:0,valley:10<br>

Directives and policies are written one per line with a space between them and the input, eg:

capturedfirelimit 70<br>
traininghero BigGuy 120<br>
resourcelimits 2b 50m 1b 30m<br>
distancepolicy 7 15 5 20 15<br>

Errors in Goals

Sometimes when you save changes and set goals, the log window will show you an error. I have found that at least 75% of all users will read the bottom line of the error, eg:

21:05:16 (City) - setting goals
21:05:16 (City) - SENDTROOPS: Invalid parameters: asdf
21:05:16 (City) - expected: sendtroops coords trooptype local_min remote_min quantity
21:05:16 (City) - examples: sendtroops 50,50 archer 500k 100k 100k
21:05:16 (City) - sendtroops 50,50 scout 200k 100k -1
21:05:16 (City) - comfort policy set to: popraise in every 15 to 18 minutes
21:05:16 (City) - Config: hero:1, fortification:1, trainpol:0, buildnpc:20, keepatthome:1, reservedbarrack:1, troopsusepopmax:1, troop:1, feastinghallspace:1, valley:10, wallqueuetime:0.5, comfort:1, troopqueuetime:2, trade:0, npc:5,
21:05:16 (City) - ERROR IN GOALS, please check!!!

The error in this case is not "21:05:16 (City) - ERROR IN GOALS, please check!!!" but instead it is "21:05:16 (City) - SENDTROOPS: Invalid parameters: asdf"

Please when posting questions or requests for help on the Y.A.E.B. forums, read the entire error first to see if the solution may be obvious, then use this wiki's search feature or the Y.A.E.B. forum's search for a solution, and finally paste the entire error as I have above along with the debugging log (explained below) and your goals script if you still can't figure it out.

Debugging

The bot has powerful built-in debugging features. When you encounter an error that you're unable to figure out from the given clues, click on the "City Settings" tab in the city window with the problem.

Debugsettings.PNG

In this window you will see the individual features of the bot listed out. Simply check the relevant box or boxes, and wait for the problem/error to happen again. The bot should describe the processes it's working through in great detail for you. Copy and paste this debug log with your post for help on the Y.A.E.B. forums.