• My Pages
  • Comments
  • Add Link
  • Subscribe
  • Subscribe User
  • Edit (Text)
  • Rename Page
  • Copy Page
  • Load Page
  • Save Page
  • Delete Page
  • Attachments
  • Check Spelling
  • Diffs
  • Info
  • Revert to this revision
  • XML
  • Render as Docbook
  • Print View
  • Raw Text
  • Delete Cache
  • Like Pages
  • Local Site Map
  • Remove Spam
  • Package Pages
  • Sync Pages
    • Diff for "CategoryGoals"
    Differences between revisions 9 and 15 (spanning 6 versions)
    Revision 9 as of 2012-08-16 22:08:42
    Size: 4469
    Editor: Inanna
    Comment:
    Revision 15 as of 2012-09-18 16:28:34
    Size: 302
    Editor: Inanna
    Comment:
    Deletions are marked like this. Additions are marked like this.
    Line 3: Line 3:
    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 you want it to do. = How to write your goals =
    Line 5: Line 5:
    {{attachment:Goals_Scripts_City_Settings.png}} <<Include(GoalsFordummies)>>
    Line 7: Line 7:
    == 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.
    = Syntax Highlighting =
    Line 10: Line 9:
    == 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:
    <<Include(SyntaxHighlighting)>>
    Line 13: Line 11:
     . 0 means off/no/false
     . 1 means on/yes/true
    = Notes and Comments =
    Line 16: Line 13:
    == 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:
    <<Include(Comments)>>
    Line 19: Line 15:
    {{{
    // Tell my bot not to fire any hero I capture of lvl 100 or higher
    capturedfirelimit 100
    // Tell my bot to farm lvl 5 npcs
    config npc:5
    }}}
    or a good way to temporarily turn off a feature in your goals, eg:
    <<Include(Debugging)>>
    Line 27: Line 17:
    {{{
    // Tell my bot to send resources from this city to AnotherTown
    #keepresource AnotherTown w:20000000,i:20000000 5000000
    }}}
    == Formatting the lines ==
    Configs may be written one per line, eg:
    = Hero Strings in Goals =
    Line 34: Line 19:
    {{{
    config comfort:1
    config trade:0
    config valley:10
    }}}
    or all together on one line, eg:
    <<Include(HeroString)>>
    Line 41: Line 21:
    {{{
    config comfort:1,trade:0,valley:10
    }}}
    Directives and policies are written one per line with a space between them and the input, eg:

    {{{
    capturedfirelimit 70
    traininghero BigGuy 120
    resourcelimits 2b 50m 1b 30m
    distancepolicy 7 15 5 20 15
    }}}
    == 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, buildnpc:20, keepatthome:1, reservedbarrack:1, troopsusepopmax:1, valley:10, comfort:1, troopqueuetime:2, 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 forums, read the entire error first to see if the solution may be obvious, then use this wiki's search feature or the 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 "Debug Settings" tab in the city window with the problem.

    {{attachment:Debugsettings.PNG}}

    In this window you will see the individual features of the bot listed out. Simply check the relevant box or boxes, check Verbose, and wait for the problem/error to happen again. For example, if your bot is not farming npcs and you can't figure out why, check '''Verbose''' and '''Npc Farming''' boxes and uncheck the others. '''Normal''' can remain checked, it will not affect it.

    The bot should describe the processes it's working through in great detail for you. Remember that the bot only performs actions in one city at a time. The city currently "in focus" may not be the one with the problem. Wait a few minutes until you see the city in question gain focus, you'll know it because there will be a lot of spam with Verbose debugging. Copy and paste this debug log with your post for help on the forums.
    ----
    CategoryGoals

    How to write your goals

    Syntax Highlighting

    You will notice the words you type in are colored, for example:

    http://img7.imageshack.us/img7/5626/introtogoals.png

    These colors are to guide you through proper goal writing. Sometimes 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.


    CategoryHowTo

    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 or scripts written on a commented line.

    This is a good way to remind yourself what a line is meant to do, e.g.:

    • // Tell my bot not to fire any hero I capture of lvl 100 or higher
      keepcapturedheroes any:level>=100
      // Tell my bot to farm lvl 5 npcs
      config npc:5

    It is also a good way to temporarily turn off a feature in your goals, e.g.:

    • // Disable the next line temporarily until I get around to porting my city...
      #keepresource AnotherTown w:20000000,i:20000000 5000000

    You can also use comments to separate your goals into sections, e.g.:

    • // resource stuff
      config trade:1
      tradepolicy /type:food /min:3d /batch:1m
      tradepolicy /type:wood /min:10m /max:30m /batch:1m /allowselltomin
      tradepolicy /type:stone /min:500m /batch:1m
      tradepolicy /type:iron /min:10m /max:30m /batch:1m /allowselltomin
      tradepolicy /type:gold /min:100m
      keepresources hubcity w:25m,i:25m,f:700m 10m
      
      // hero stuff
      config hero:20,keepatthome:1,feastinghallspace:1
      keepheroes any:level>=100|any:base>=65
      keepcapturedheroes any:level>=100|any:base>=70
      traininghero bigdude 120 180 0
      
      // farming stuff
      config npc:5,buildnpc:5
      npcheroes 5 any,!bigdude


    CategoryHowTo

    Understanding Errors

    Sometimes when you save changes and set goals, the log window will show you an error. I have found that MOST users will read only the last line of the error, rather than the entire error showing them the problem. For example:

    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, buildnpc:20, keepatthome:1, reservedbarrack:1, troopsusepopmax:1, valley:10, comfort:1, troopqueuetime:2, 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 the error is is "21:05:16 (City) - SENDTROOPS: Invalid parameters: asdf"

    Using debug to find a problem

    Any time you post on the forum requesting help, we're going to ask you for the debug log. This many sound like gibberish, but it's not too hard. Let's pretend you have config hunting:5 in your goals, but the bot is not attacking valleys for medals and you have no idea why. First step, go to the city with the problem. Now click on the "Debug Settings" tab near the top, next to the "Goal" and "Script" tabs. In this window you will see the individual features of the bot listed:

    http://img254.imageshack.us/img254/5354/debugsettings.png

    Once there, check Normal, Verbose, and Valley. Normal because that's probably already on. Verbose because you want to check this ALWAYS for EVERY debug log no matter what the issue is. And finally Valley because your problem is with the bot not hitting valleys. If your bot was failing to attack npcs instead, you'd select Normal, Verbose, and Npc Farming instead. If your bot wasn't trading properly, you'd select Normal, Verbose, and Trading instead....and so forth.

    Now patiently sit and wait until that city gets focus. Focus occurs in one city at a time, down the row from left to right, as the bot performs its tasks. Just like a real player would in game, the bot will only "click" on one city at a time to do things. You will know when your debug city gets focus because it will say something like "City receives focus" followed by a ton of spam in the logging window at the bottom. Let this run for about a minute, then turn off Verbose and Valley debugging by unchecking those boxes.

    Now click on CITY LOG so that you can only see the logging output for the city in question and not all the others. Scroll up to the start where you saw "City receives focus" and copy it all the way down. Go to your forum post and paste the debug log along with your goals for that city and an explanation of your problem.

    If you're feeling adventurous, you can read all that spam and probably figure out your own problem. For example, you may see "HUNTING: Error - not enough troops!" and know that it's not attacking valleys because you don't have enough troops there. Or you may see "HUNTING: Error - all rally slots are full!" and know that it's not attacking valleys because your npc farmers or transports or something is hogging all your rally slots. Most errors are in understandable wording. If you can't figure it out, we're happy to help on the forum.


    CategoryHowTo

    Hero Strings in Goals

    Many places in the bot will allow you to specify heroes. The selection or list of heroes to be used will be referred to as the hero-string in various other places in this wiki.


    You may list hero names individually, and/or exclude heroes with '!name', and/or include all heroes with 'any' or even use no hero at all with 'none'. For example,

    • valleyheroes Biggy this would allow only hero Biggy to attack valleys & flats

    • npcheroes !Smarty,!Biggy,any this would allow any hero except Smarty and except Biggy to hit npcs

    • npcheroes 10 Biggy,Polly,Smarty this would allow heroes Biggy, Polly, and Smarty to hit npc10s

    • reinforce 123,456 any c:100000 this would allow you to reinforce 123,456 with cav and any available hero


    You may also use advanced filters in hero-strings in the format of hero:filter. The hero name list (or 'any') must be stated first, followed by the filter(s). Any filters listed will apply to the entire line. For example,

    • valleyheroes any:attack>180 this would allow any hero with an attack over 180 to attack valleys & flats

    • valleyheroes any:politics<200 this would allow any hero with politics under 200 to attack valleys & flats

    • npcheroes 8 any:politics=best this would allow the best politics hero to hit npc8s

    • npcheroes 5 farmer:attack<200 this would allow any hero named Farmer who's attack is under 200 to attack npc5s

    • npcheroes 10 any:attack>300,base>60 this would allow any attack hero with both an attack over 300 AND a base over 60 to hit npc10s

    • attack 111,222 !Biggy,any:attack>180 c:99k,s:1k this would attack coordinates 111,222 with any hero over 180 attack other than hero Biggy with 99k cavs, 1k scouts

    • attack 111,222 !Polly,any:attack<100 w:5k this would attack coordinates 111,222 with any hero under 100 attack other than hero Polly with 5k warriors


    If you wish to apply separate filters to separate heroes, use multiple lines. For example,

    • npcheroes 5 any:base>60

    • npcheroes 5 any:attack<300

    The above lines mean that npc5s can be farmed with any hero that has greater than 60 base OR any hero that has less than 300 attack.


    If you wish to include heroes of specific names regardless of whether they meet the conditional filter for that line, put them on separate lines:

    • npcheroes 5 bob,fred,joe

    • npcheroes 5 any:attack>=60

    The above lines mean that npc5s can be farmed by any hero named "bob", "fred", or "joe", OR any hero with 60+ base.


    Multiple lines can be concatenated (combined) into a single line with the | symbol. For example,

    • npcheroes 5 bob,fred,joe|any:attack>=60

    The above line means exactly the same thing as the 2 before it.

    • npcheroes 5 bob,any:attack>=60

    If you were to instead use the line above, it would mean npc5s can be farmed with any hero that has both the name bob AND has an attack of 60+.

    • npcheroes 5 any:base>60,attack<300

    With those rules standing, the above line would mean you can farm npc5s with any hero that has both a base higher than 60 AND an attack under 300.


    All possible filters for use in hero-strings are:

    • attack or att
    • politics or pol
    • intel or int
    • loyalty or loy
    • level or lvl
    • experience or exp
    • points or pts
    • base or bse

    All possible comparisons to use in filters are:

    • < (less than)

    • > (greater than)

    • = (equal to)
    • != (not equal to)
    • <> (not equal to)

    • <= (less than or equal to)

    • >= (greater than or equal to)

    "Best" and "Worst" can be used in place of values for comparisons, for example:

    • npcheroes 10 any:attack=best would allow npc10s to be farmed with the best attack hero.

    • npcheroes 5 any:attack<best would allow npc5s to be farmed with any hero lower than the best attack hero.

    Stats can be compared to other stats in place of values, for example:

    • npcheroes 5 any:attack>politics would allow any hero with an attack score greater than its politics score.

    • npcheroes 5 any:politics>level would allow any hero with a politics score greater than its level.

    Wildcards can be used for the hero list. * will represent 1 or more characters, ? will represent 1 character. For example,

    • npcheroes 5 att*:attack>200 would allow npc5s to be farmed with any hero over 200 attack that has "att" in its name.

    • npcheroes 5 *:base>60 would allow npc5s to be farmed with any hero that has a base over 60.

    • npcheroes 5 att??int:base>=69 would allow npc5s to be farmed with any hero named "att69int," "att70int," etc. who's base is 69+.

    Hero strings cannot consist of only a single number. This is a safety precaution for people blindly replacing older goals of "herofirelimit 100" with "keepheroes 100" and unexpectedly losing a valuable hero. If you use heroes with pure number names, for example "100" you can still trick the hero string into accepting it, by adding something more than just that single number.

    • npcheroes 8 100,100 This would allow the hero named "100" (or the hero named "100" :P) to farm npc8s.


    CategoryHowTo


    CategoryGoals

    CategoryGoals (last edited 2012-09-18 16:28:45 by Inanna)