TradeScript102013-02-03 22:30:48Inanna92013-01-08 15:22:32Inanna82012-12-23 02:37:34Inanna72012-12-21 04:20:44Romulus62012-12-19 19:56:24Romulus52012-12-19 19:33:57Romulus42012-12-19 19:32:34Romulus32012-12-19 19:32:00Romulus22012-12-19 16:35:19Inanna12012-12-19 16:35:11Inanna 8 execute "sleep " + delay
if city.tradesArray.length > 8 execute "canceltrade " + city.tradesArray[0].id
if city.tradesArray.length > 8 goto check
]]> 0 if sellLimit >=1 if prices[1] - prices[3] < prices[2] * (1 + gain) goto nextres
if sellLimit < 1 sellLimit = min(max(1, (resGold - city.resource.gold) / prices[1] / 2), (city.resource.gold - 1) / prices[3]) // we are low on gold
sellVolume = floor(min(canSell, sellLimit, MAX_TRADE - max(0, floor(min(maxRes - city.resource[resName].amount, (city.resource.gold - resGold) / prices[2]))) / 3))
if sellVolume > 0 execute "sell " + res + " " + sellVolume + " " + prices[1]
buyVolume = floor(min(maxRes - city.resource[resName].amount, (city.resource.gold - resGold) / prices[2], MAX_TRADE))
if buyVolume > 0 execute "buy " + res + " " + buyVolume + " " + prices[0]
goto nextres]]> ScriptExamples