User:Thc/Guide to FFF Botting

Why?
Because FFF means you have no life and it is boring. Also, yay 6 seconds of SY!

Step 1: Download Macro Program

 * AutoIt. Google it.

Step 2: Starting Guild Wars

 * Use the function ShellExecute(...)
 * Useful arguments are -nosound -noshaders -fps 25 -password XXXXX

Step 3: Selecting Character

 * Use GetPixelCheckSum(x1,y1,x2,y2) to detect Character select screen.
 * This function is used to see if a pixel area is the same. In other words, any static pixel area can be used to detect the game state.  Menus, buttons, load screens, borders, etc.  Call the function several times to ensure accurate results.

Step 4: Loading Town, Loading Instance

 * Use GPCS to detect load screens. Use smart/efficient pathing to exit town.  Once out of town, re-enter town again and then re-exit so that it is easier to perform the subsequent runs.

Step 5: Adding Henchmen

 * Send "P" key and use GPCS to detect party screen. It should be in the same location every time, unless you move it (don't).  {ESC} closes the screen.

Step 6: Doing the run

 * Make the mission map take up the entire screen (beforehand). It could help to zoom in one level (zoom out all the way then zoom in once).  Basically, just copy what you normally do into the script.

Step 7: Taking the reward, repeating

 * Close the mission map, run in the general direction of the NPC. Select nearest, {SPACE}, accept quest, accept reward, PROFIT$$$$.  /Resign.  USE GPCS to detect when you have loaded into town, then re-exit town and repeat.

Step 8: Turning in Faction

 * The easiest way to turn in faction is to go to the guild hall. Do this by opening the the guild window (detect with GPCS).  It is advisable to have your own guild/hall - Imperial Isle works best, since the NPC is close and you always spawn in the same place.  Talk to the Faction Rewards and turn in your faction.  Profit$$$.  Exit Guild Hall.  Repeat.

Step A: What if the Bot Gets Stuck?

 * If the bot gets stuck (usually due to lag), a method for detecting and dealing with stuckage is needed. One good place to detect is load screens as load screens are loaded several times a run.  If a load screen is not loaded when it should be, then the bot is stuck.  Create a timeout loop that calls GPCS every cycle until the load screen is loaded or it has timed out.  If it has timed out, you can either a) quit the bot, or b) reload the bot.  To reload the bot, you need a way of invoking the start of the script.  A simple way of doing this is putting your entire script inside a function.  This way, you can call the function at any time to reload the bot.  Liberal usage of global variables here is helpful to allow communication between reloads.

Step B: Troubleshooting, Error-logging

 * Your bot will probably have errors which will need to be ironed out. One tool which can help is error-logging.  Use OpenFile to create a log file and append information with FileWrite.  Time and date can be included as well.  It is also important to close the file stream with CloseFile before the script stops.  Every exit statement should be preceded by a CloseFile.