<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>AutoRunScript</title><revhistory><revision><revnumber>8</revnumber><date>2017-12-21 04:02:23</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>7</revnumber><date>2017-12-21 04:01:48</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>6</revnumber><date>2017-12-21 04:01:24</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>5</revnumber><date>2017-01-18 14:04:07</date><authorinitials>Romulus</authorinitials></revision><revision><revnumber>4</revnumber><date>2016-12-24 18:31:28</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>3</revnumber><date>2014-12-31 18:13:53</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>2</revnumber><date>2014-08-12 16:30:26</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>1</revnumber><date>2014-08-12 16:29:58</date><authorinitials>Inanna</authorinitials></revision></revhistory></articleinfo><para>This file, AutoRunScript.txt, is automatically read and loaded at bot startup. Anything in this file will be ran as a script in each city in the bot. The file must be located in the same folder as the bot executable file in order for it to run it. </para><para>The -runscript <ulink url="http://guide.neatportal.com/wiki/AutoRunScript/wiki/StartupParameters#">Startup Parameter</ulink> allows to specify a custom script name to run instead of AutoRunScript.txt. </para><para>Your script contained in this file can be anything. Some common uses are to set map colors, tell <ulink url="http://guide.neatportal.com/wiki/AutoRunScript/wiki/NEATO#">NEATO</ulink> you're connected, auto-use common items like amulets or holiday promo items, and to have alts report back to a main account their city and account status. </para><para>Keep in mind this runs in EVERY city at startup. If you want to use items or perform account maintenance type stuff, you will probably want those things only running from 1 city. You can add something like this to your script at start... </para><itemizedlist><listitem override="none"><screen><![CDATA[if city.timeSlot != 0 goto allCities
]]><![CDATA[
//put your stuff to perform here only in one city
]]><![CDATA[
label allCities
]]><![CDATA[
// put your stuff to perform here for all cities]]></screen></listitem></itemizedlist><para>Another example is for editing the auto use items list via script and also using special/promo limited items. This one will only run in the oldest (city.timeSlot = 0) city... </para><itemizedlist><listitem override="none"><screen><![CDATA[label autorun
]]><![CDATA[
if city.timeSlot != 0 return
]]><![CDATA[
// the following line is for items you want it to use all of until it runs out
// for example promo items you gain from npc farming attacks, amulets, etc.
]]><![CDATA[
Settings.autoUseItems(["player.box.whatever", "player.item.whatever", "player.stuff.goes.here", "add.as.many.as.you.like"], [ ])
]]><![CDATA[
]]><![CDATA[
// the following 2 lines are for adding 5x per day use items, like 50% upkeep buffs
]]><![CDATA[
if ItemCount("player.item.chocolatecoin") item = "player.item.chocolatecoin" // 50% upkeep or similar item
if ItemCount("player.item.chocolatecoin") gosub use5items
]]><![CDATA[
return
]]><![CDATA[
label use5items
numberOfItems = ItemCount(item)
if numberOfItems execute "useitem {item}"
if numberOfItems execute "repeat {min(numberOfItems,5)}"
return]]></screen></listitem></itemizedlist><!--rule (<hr>) is not applicable to DocBook--><para> <ulink url="http://guide.neatportal.com/wiki/AutoRunScript/wiki/CategoryExtras#">CategoryExtras</ulink> </para></article>