From NEAT Portal Wiki
Jump to: navigation, search
(Market Money Maker IV)
(Market Money Maker IV)
Line 174: Line 174:
 
<br>56: gosubreturn
 
<br>56: gosubreturn
 
<br>
 
<br>
57: label find4
+
<br> 57: label find4
58: print x checking if we bought stone
+
<br> 58: print x checking if we bought stone
59: ifgoto ( m_city.cityManager.tradesArray[3].amount == %buy_stone_qty% ) find5
+
<br> 59: ifgoto ( m_city.cityManager.tradesArray[3].amount == %buy_stone_qty% ) find5
60: ifgoto ( m_city.cityManager.tradesArray[0].amount == %buy_stone_qty% ) find5
+
<br> 60: ifgoto ( m_city.cityManager.tradesArray[0].amount == %buy_stone_qty% ) find5
61: ifgoto ( m_city.cityManager.tradesArray[1].amount == %buy_stone_qty% ) find5
+
<br> 61: ifgoto ( m_city.cityManager.tradesArray[1].amount == %buy_stone_qty% ) find5
62: ifgoto ( m_city.cityManager.tradesArray[2].amount == %buy_stone_qty% ) find5
+
<br> 62: ifgoto ( m_city.cityManager.tradesArray[2].amount == %buy_stone_qty% ) find5
63: ifgoto ( m_city.cityManager.tradesArray[4].amount == %buy_stone_qty% ) find5
+
<br> 63: ifgoto ( m_city.cityManager.tradesArray[4].amount == %buy_stone_qty% ) find5
64: ifgoto ( m_city.cityManager.tradesArray[5].amount == %buy_stone_qty% ) find5
+
<br> 64: ifgoto ( m_city.cityManager.tradesArray[5].amount == %buy_stone_qty% ) find5
65: ifgoto ( m_city.cityManager.tradesArray[6].amount == %buy_stone_qty% ) find5
+
<br> 65: ifgoto ( m_city.cityManager.tradesArray[6].amount == %buy_stone_qty% ) find5
66: ifgoto ( m_city.cityManager.resource.stone.amount < %stone_max% ) ok_buy_stone
+
<br> 66: ifgoto ( m_city.cityManager.resource.stone.amount < %stone_max% ) ok_buy_stone
67: print x limit reached so no longer buying stone
+
<br> 67: print x limit reached so no longer buying stone
68: buy stone %buy_stone_qty% .01
+
<br> 68: buy stone %buy_stone_qty% .01
69: gosubreturn
+
<br> 69: gosubreturn
 +
<br>
 +
<br> 70: label ok_buy_stone
 +
<br> 71: buy stone %buy_stone_qty% %buy_stone_price%
 +
<br> 72: gosubreturn
 +
<br>
 +
<br> 73: label find5
 +
<br> 74: print x seeing if we sold food
 +
<br> 75: ifgoto ( m_city.cityManager.tradesArray[4].amount == %sell_food_qty% ) find6
 +
<br> 76: ifgoto ( m_city.cityManager.tradesArray[0].amount == %sell_food_qty% ) find6
 +
<br> 77: ifgoto ( m_city.cityManager.tradesArray[1].amount == %sell_food_qty% ) find6
 +
<br> 78: ifgoto ( m_city.cityManager.tradesArray[2].amount == %sell_food_qty% ) find6
 +
<br> 79: ifgoto ( m_city.cityManager.tradesArray[3].amount == %sell_food_qty% ) find6
 +
<br> 80: ifgoto ( m_city.cityManager.tradesArray[5].amount == %sell_food_qty% ) find6
 +
<br> 81: ifgoto ( m_city.cityManager.tradesArray[6].amount == %sell_food_qty% ) find6
 +
<br> 82: ifgoto ( m_city.cityManager.resource.food.amount > %food_min% ) ok_sell_food
 +
<br> 83: print x limit reached so not selling any more food
 +
<br> 84: sell food %sell_food_qty% 99
 +
<br> 85: gosubreturn
 +
<br>
 +
<br> 86: label ok_sell_food
 +
<br> 87: sell food %sell_food_qty% %sell_food_price%
 +
<br> 88: gosubreturn
 +
<br>
 +
<br> 89: label find6
 +
<br> 90: print x seeing if we sold wood
 +
<br> 91: ifgoto ( m_city.cityManager.tradesArray[5].amount == %sell_wood_qty% ) find7
 +
<br> 92: ifgoto ( m_city.cityManager.tradesArray[0].amount == %sell_wood_qty% ) find7
 +
<br> 93: ifgoto ( m_city.cityManager.tradesArray[1].amount == %sell_wood_qty% ) find7
 +
<br> 94: ifgoto ( m_city.cityManager.tradesArray[2].amount == %sell_wood_qty% ) find7
 +
<br> 95: ifgoto ( m_city.cityManager.tradesArray[3].amount == %sell_wood_qty% ) find7
 +
<br> 96: ifgoto ( m_city.cityManager.tradesArray[4].amount == %sell_wood_qty% ) find7
 +
<br> 97: ifgoto ( m_city.cityManager.tradesArray[6].amount == %sell_wood_qty% ) find7
 +
<br> 98: ifgoto ( m_city.cityManager.resource.wood.amount > %wood_min% ) ok_sell_wood
 +
<br> 99: print x limit reached so not selling any more wood
 +
<br> 100: sell lumber %sell_wood_qty% 99
 +
<br> 101: gosubreturn
 +
<br>
 +
<br> 102: label ok_sell_wood
 +
<br> 103: sell lumber %sell_wood_qty% %sell_wood_price%
 +
<br> 104: gosubreturn
 +
<br>
 +
<br> 105: label find7
 +
<br> 106: print x seeing if we sold iron
 +
<br> 107: ifgoto ( m_city.cityManager.tradesArray[6].amount == %sell_iron_qty% ) find8
 +
<br> 108: ifgoto ( m_city.cityManager.tradesArray[0].amount == %sell_iron_qty% ) find8
 +
<br> 109: ifgoto ( m_city.cityManager.tradesArray[1].amount == %sell_iron_qty% ) find8
 +
<br> 110: ifgoto ( m_city.cityManager.tradesArray[2].amount == %sell_iron_qty% ) find8
 +
<br> 111: ifgoto ( m_city.cityManager.tradesArray[3].amount == %sell_iron_qty% ) find8
 +
<br> 112: ifgoto ( m_city.cityManager.tradesArray[4].amount == %sell_iron_qty% ) find8
 +
<br> 113: ifgoto ( m_city.cityManager.tradesArray[5].amount == %sell_iron_qty% ) find8
 +
<br> 114: ifgoto ( m_city.cityManager.resource.iron.amount > %iron_min% ) ok_sell_iron
 +
<br> 115: print x limit reached so not selling any more iron
 +
<br> 116: sell iron %sell_iron_qty% 99
 +
<br> 117: gosubreturn
 +
<br>
 +
<br> 118: label ok_sell_iron
 +
<br> 119: sell iron %sell_iron_qty% %sell_iron_price%
 +
<br> 120: gosubreturn
 +
<br>
 +
<br> 121: label find8
 +
<br> 122: print x musta sold stone
 +
<br> 123: ifgoto ( m_city.cityManager.resource.stone.amount > %stone_min% ) ok_sell_stone
 +
<br> 124: print x limit reached so not selling any more stone
 +
<br> 125: sell stone %sell_stone_qty% 99
 +
<br> 126: gosubreturn
 +
<br>
 +
<br> 127: label ok_sell_stone
 +
<br> 128: sell stone %sell_stone_qty% %sell_stone_price%
 +
<br> 129: gosubreturn
 +
<br>
 +
<br> 130: label setup
 +
<br> 131: config trade:0
 +
<br> 132: canceltrade
 +
<br> 133: print x initializing
 +
<br> 134: ifgoto ( %buy_food_qty% == %buy_wood_qty% ) error
 +
<br> 135: ifgoto ( %buy_food_qty% == %buy_iron_qty% ) error
 +
<br> 136: ifgoto ( %buy_food_qty% == %buy_stone_qty% ) error
 +
<br> 137: ifgoto ( %buy_food_qty% == %sell_food_qty% ) error
 +
<br> 138: ifgoto ( %buy_food_qty% == %sell_wood_qty% ) error
 +
<br> 139: ifgoto ( %buy_food_qty% == %sell_iron_qty% ) error
 +
<br> 140: ifgoto ( %buy_food_qty% == %sell_stone_qty% ) error
 +
<br> 141: ifgoto ( %buy_wood_qty% == %buy_iron_qty% ) error
 +
<br> 142: ifgoto ( %buy_wood_qty% == %buy_stone_qty% ) error
 +
<br> 143: ifgoto ( %buy_wood_qty% == %sell_food_qty% ) error
 +
<br> 144: ifgoto ( %buy_wood_qty% == %sell_wood_qty% ) error
 +
<br> 145: ifgoto ( %buy_wood_qty% == %sell_iron_qty% ) error
 +
<br> 146: ifgoto ( %buy_wood_qty% == %sell_stone_qty% ) error
 +
<br> 147: ifgoto ( %buy_iron_qty% == %buy_stone_qty% ) error
 +
<br> 148: ifgoto ( %buy_iron_qty% == %sell_food_qty% ) error
 +
<br> 149: ifgoto ( %buy_iron_qty% == %sell_wood_qty% ) error
 +
<br> 150: ifgoto ( %buy_iron_qty% == %sell_iron_qty% ) error
 +
<br> 151: ifgoto ( %buy_iron_qty% == %sell_stone_qty% ) error
 +
<br> 152: ifgoto ( %buy_stone_qty% == %sell_food_qty% ) error
 +
<br> 153: ifgoto ( %buy_stone_qty% == %sell_wood_qty% ) error
 +
<br> 154: ifgoto ( %buy_stone_qty% == %sell_iron_qty% ) error
 +
<br> 155: ifgoto ( %buy_stone_qty% == %sell_stone_qty% ) error
 +
<br> 156: ifgoto ( %sell_food_qty% == %sell_wood_qty% ) error
 +
<br> 157: ifgoto ( %sell_food_qty% == %sell_iron_qty% ) error
 +
<br> 158: ifgoto ( %sell_food_qty% == %sell_stone_qty% ) error
 +
<br> 159: ifgoto ( %sell_wood_qty% == %sell_iron_qty% ) error
 +
<br> 160: ifgoto ( %sell_wood_qty% == %sell_stone_qty% ) error
 +
<br> 161: ifgoto ( %sell_iron_qty% == %sell_stone_qty% ) error
 +
<br>
 +
<br> 162: buy food %buy_food_qty% %buy_food_price%
 +
<br> 163: buy lumber %buy_wood_qty% %buy_wood_price%
 +
<br> 164: buy iron %buy_iron_qty% %buy_iron_price%
 +
<br> 165: buy stone %buy_stone_qty% %buy_stone_price%
 +
<br> 166: sell food %sell_food_qty% %sell_food_price%
 +
<br> 167: sell lumber %sell_wood_qty% %sell_wood_price%
 +
<br> 168: sell iron %sell_iron_qty% %sell_iron_price%
 +
<br> 169: sell stone %sell_stone_qty% %sell_stone_price%
 +
<br> 170: Gosubreturn
 +
<br> 171: label error
 +
<br> 172: print x error
 +
<br> 173: print x all buy and sell qty values must be different
 +
<br> 174: print x please try again
 +
<br> 175: goto exit
 +
<br> 176: label end
 +
<br> 177: ifgoto ( m_city.cityManager.resource.food.amount < %food_min% ) done
 +
<br> 178: print x WARNING we are going to sell food
 +
<br> 179: print x Warning 30 sec
 +
<br> 180: sleep 10
 +
<br> 181: print x 20 seconds
 +
<br> 182: print x Warning
 +
<br> 183: print x Warning selling 10m food @5
 +
<br> 184: print x 12 seconds
 +
<br> 185: print x Warning
 +
<br> 186: print x Warning
 +
<br> 187: print x 8 seconds
 +
<br> 188: print x Warning
 +
<br> 189: print x too late
 +
<br>
 +
<br> 190: sell food 9999999 2.5
 +
<br> 191: loop 3
 +
<br> 192: goto finished
 +
<br>
 +
<br> 193: label done
 +
<br> 194: print x not enough food to sell to raise cash
 +
<br> 195: print x i hope your limit was not too low
 +
<br> 196: print x or your heroes may be running away
 +
<br> 197: goto exit
 +
<br>
 +
<br> 198: label finished
 +
<br> 199: print x Thats it we ran out cash twice
 +
<br> 200: print x the good news is we did sell food before
 +
<br> 201: print x exiting, so the heroes are safe
 +
<br>
 +
<br> 202: label exit
 +
<br> 203: print x thank you come again
 +
<br> 204: print x don't forget to thank the author
  
70: label ok_buy_stone
 
71: buy stone %buy_stone_qty% %buy_stone_price%
 
72: gosubreturn
 
 
73: label find5
 
74: print x seeing if we sold food
 
75: ifgoto ( m_city.cityManager.tradesArray[4].amount == %sell_food_qty% ) find6
 
76: ifgoto ( m_city.cityManager.tradesArray[0].amount == %sell_food_qty% ) find6
 
77: ifgoto ( m_city.cityManager.tradesArray[1].amount == %sell_food_qty% ) find6
 
78: ifgoto ( m_city.cityManager.tradesArray[2].amount == %sell_food_qty% ) find6
 
79: ifgoto ( m_city.cityManager.tradesArray[3].amount == %sell_food_qty% ) find6
 
80: ifgoto ( m_city.cityManager.tradesArray[5].amount == %sell_food_qty% ) find6
 
81: ifgoto ( m_city.cityManager.tradesArray[6].amount == %sell_food_qty% ) find6
 
82: ifgoto ( m_city.cityManager.resource.food.amount > %food_min% ) ok_sell_food
 
83: print x limit reached so not selling any more food
 
84: sell food %sell_food_qty% 99
 
85: gosubreturn
 
 
86: label ok_sell_food
 
87: sell food %sell_food_qty% %sell_food_price%
 
88: gosubreturn
 
 
89: label find6
 
90: print x seeing if we sold wood
 
91: ifgoto ( m_city.cityManager.tradesArray[5].amount == %sell_wood_qty% ) find7
 
92: ifgoto ( m_city.cityManager.tradesArray[0].amount == %sell_wood_qty% ) find7
 
93: ifgoto ( m_city.cityManager.tradesArray[1].amount == %sell_wood_qty% ) find7
 
94: ifgoto ( m_city.cityManager.tradesArray[2].amount == %sell_wood_qty% ) find7
 
95: ifgoto ( m_city.cityManager.tradesArray[3].amount == %sell_wood_qty% ) find7
 
96: ifgoto ( m_city.cityManager.tradesArray[4].amount == %sell_wood_qty% ) find7
 
97: ifgoto ( m_city.cityManager.tradesArray[6].amount == %sell_wood_qty% ) find7
 
98: ifgoto ( m_city.cityManager.resource.wood.amount > %wood_min% ) ok_sell_wood
 
99: print x limit reached so not selling any more wood
 
100: sell lumber %sell_wood_qty% 99
 
101: gosubreturn
 
 
102: label ok_sell_wood
 
103: sell lumber %sell_wood_qty% %sell_wood_price%
 
104: gosubreturn
 
 
105: label find7
 
106: print x seeing if we sold iron
 
107: ifgoto ( m_city.cityManager.tradesArray[6].amount == %sell_iron_qty% ) find8
 
108: ifgoto ( m_city.cityManager.tradesArray[0].amount == %sell_iron_qty% ) find8
 
109: ifgoto ( m_city.cityManager.tradesArray[1].amount == %sell_iron_qty% ) find8
 
110: ifgoto ( m_city.cityManager.tradesArray[2].amount == %sell_iron_qty% ) find8
 
111: ifgoto ( m_city.cityManager.tradesArray[3].amount == %sell_iron_qty% ) find8
 
112: ifgoto ( m_city.cityManager.tradesArray[4].amount == %sell_iron_qty% ) find8
 
113: ifgoto ( m_city.cityManager.tradesArray[5].amount == %sell_iron_qty% ) find8
 
114: ifgoto ( m_city.cityManager.resource.iron.amount > %iron_min% ) ok_sell_iron
 
115: print x limit reached so not selling any more iron
 
116: sell iron %sell_iron_qty% 99
 
117: gosubreturn
 
 
118: label ok_sell_iron
 
119: sell iron %sell_iron_qty% %sell_iron_price%
 
120: gosubreturn
 
 
121: label find8
 
122: print x musta sold stone
 
123: ifgoto ( m_city.cityManager.resource.stone.amount > %stone_min% ) ok_sell_stone
 
124: print x limit reached so not selling any more stone
 
125: sell stone %sell_stone_qty% 99
 
126: gosubreturn
 
 
127: label ok_sell_stone
 
128: sell stone %sell_stone_qty% %sell_stone_price%
 
129: gosubreturn
 
 
130: label setup
 
131: config trade:0
 
132: canceltrade
 
133: print x initializing
 
134: ifgoto ( %buy_food_qty% == %buy_wood_qty% ) error
 
135: ifgoto ( %buy_food_qty% == %buy_iron_qty% ) error
 
136: ifgoto ( %buy_food_qty% == %buy_stone_qty% ) error
 
137: ifgoto ( %buy_food_qty% == %sell_food_qty% ) error
 
138: ifgoto ( %buy_food_qty% == %sell_wood_qty% ) error
 
139: ifgoto ( %buy_food_qty% == %sell_iron_qty% ) error
 
140: ifgoto ( %buy_food_qty% == %sell_stone_qty% ) error
 
141: ifgoto ( %buy_wood_qty% == %buy_iron_qty% ) error
 
142: ifgoto ( %buy_wood_qty% == %buy_stone_qty% ) error
 
143: ifgoto ( %buy_wood_qty% == %sell_food_qty% ) error
 
144: ifgoto ( %buy_wood_qty% == %sell_wood_qty% ) error
 
145: ifgoto ( %buy_wood_qty% == %sell_iron_qty% ) error
 
146: ifgoto ( %buy_wood_qty% == %sell_stone_qty% ) error
 
147: ifgoto ( %buy_iron_qty% == %buy_stone_qty% ) error
 
148: ifgoto ( %buy_iron_qty% == %sell_food_qty% ) error
 
149: ifgoto ( %buy_iron_qty% == %sell_wood_qty% ) error
 
150: ifgoto ( %buy_iron_qty% == %sell_iron_qty% ) error
 
151: ifgoto ( %buy_iron_qty% == %sell_stone_qty% ) error
 
152: ifgoto ( %buy_stone_qty% == %sell_food_qty% ) error
 
153: ifgoto ( %buy_stone_qty% == %sell_wood_qty% ) error
 
154: ifgoto ( %buy_stone_qty% == %sell_iron_qty% ) error
 
155: ifgoto ( %buy_stone_qty% == %sell_stone_qty% ) error
 
156: ifgoto ( %sell_food_qty% == %sell_wood_qty% ) error
 
157: ifgoto ( %sell_food_qty% == %sell_iron_qty% ) error
 
158: ifgoto ( %sell_food_qty% == %sell_stone_qty% ) error
 
159: ifgoto ( %sell_wood_qty% == %sell_iron_qty% ) error
 
160: ifgoto ( %sell_wood_qty% == %sell_stone_qty% ) error
 
161: ifgoto ( %sell_iron_qty% == %sell_stone_qty% ) error
 
 
162: buy food %buy_food_qty% %buy_food_price%
 
163: buy lumber %buy_wood_qty% %buy_wood_price%
 
164: buy iron %buy_iron_qty% %buy_iron_price%
 
165: buy stone %buy_stone_qty% %buy_stone_price%
 
166: sell food %sell_food_qty% %sell_food_price%
 
167: sell lumber %sell_wood_qty% %sell_wood_price%
 
168: sell iron %sell_iron_qty% %sell_iron_price%
 
169: sell stone %sell_stone_qty% %sell_stone_price%
 
170: Gosubreturn
 
171: label error
 
172: print x error
 
173: print x all buy and sell qty values must be different
 
174: print x please try again
 
175: goto exit
 
176: label end
 
177: ifgoto ( m_city.cityManager.resource.food.amount < %food_min% ) done
 
178: print x WARNING we are going to sell food
 
179: print x Warning 30 sec
 
180: sleep 10
 
181: print x 20 seconds
 
182: print x Warning
 
183: print x Warning selling 10m food @5
 
184: print x 12 seconds
 
185: print x Warning
 
186: print x Warning
 
187: print x 8 seconds
 
188: print x Warning
 
189: print x too late
 
 
190: sell food 9999999 2.5
 
191: loop 3
 
192: goto finished
 
 
193: label done
 
194: print x not enough food to sell to raise cash
 
195: print x i hope your limit was not too low
 
196: print x or your heroes may be running away
 
197: goto exit
 
 
198: label finished
 
199: print x Thats it we ran out cash twice
 
200: print x the good news is we did sell food before
 
201: print x exiting, so the heroes are safe
 
 
202: label exit
 
203: print x thank you come again
 
204: print x don't forget to thank the author
 
 
</div>
 
</div>
  

Revision as of 23:47, 28 December 2011

Medal Farming

This is a simple script for medal farming.

If you have any problems you may receive help in the forum.

Script by: voidship

// Version 2011-09-06
1: config npc:0
2: label start
3: ifgosub ( m_city.cityManager.fields[9].type >= 0 ) abandon
4: sleep 3
5: ifgosub ( m_city.cityManager.fields[9].type >= 0 ) abandon
6: sleep 3
7: ifgosub ( m_city.cityManager.fields[9].type >= 0 ) abandon
8: sleep 3
9: ifgosub ( m_city.cityManager.fields[9].type >= 0 ) abandon
10: ifgosub ( m_city.AnyIdleHero(any) = true ) attack
11: loop start

12: label abandon
13: abandon xxx,yyy
14: gosubreturn

15: label attack
16: attack xxx,yyy any a:13000,w:1,p:1,sw:1,c:1,cata:1
17: gosubreturn

Market Money Maker IV

Great script for trading in the market. Please read the notes inside the script and if you have any questions please refer to the forum.

Script by: schwak

// IF YOU RUN OUT OF GOLD YOUR HEROES WILL LEAVE!!!
// Thanks go to sgaggerj for the idea of turning the buy and sell
// quantities into variables!! Great idea!

set buy_food_price 2.5
set buy_wood_price 24.5
set buy_stone_price .5
set buy_iron_price 19
//^^^^^^^^^^^^^^^^^

set sell_food_price 4.2
set sell_wood_price 33
set sell_stone_price .9
set sell_iron_price 25
//^^^^^^^^^^^^^^^^^

// You must have enough gold on hand to make your initail purchases
// before running the program. Also, you must have enough left over
// to make more purchases if you buy anything.

// The following variiable must be MORE than your
// most expensive purchase. (i.e. 6m wood @ 25 =150m)

set gold_limit 150000000
//^^^^^^^^^^^^^^^^^
// This is where sgaggerj deserves kudos:

// Enter the quantity of each commodity the you
// want to buy or sell with each transaction.
// The following 8 variables MUST BE UNIQUE
// if any 2 are the same you will not be happy

set buy_food_qty 8000000
set buy_wood_qty 5000000
set buy_stone_qty 9999999
set buy_iron_qty 5000001

set sell_food_qty 9000000
set sell_wood_qty 2500000
set sell_stone_qty 9999998
set sell_iron_qty 2500001
//^^^^^^^^^^^^^^^^^


set food_max 5000111000
set wood_max 2000111000
set stone_max 10000111000
set iron_max 2000111000

//^^^^^^^^^^^^^^^^^

set food_min 400111000
set wood_min 5111000
set stone_min 20111000
set iron_min 5111000
//^^^^^^^^^^^^^^^^^

1: gosub setup

2: label wait
3: print x checking
4: ifgoto ( m_city.cityManager.resource.gold < %gold_limit% ) end
5: Ifgosub ( m_city.cityManager.tradesArray.length < 8 ) find1
6: print x waiting
7: sleep rnd:30
8: loop wait

9: label find1
10: print x checking if we bought food
11: ifgoto ( m_city.cityManager.tradesArray[0].amount == %buy_food_qty% ) find2
12: ifgoto ( m_city.cityManager.tradesArray[1].amount == %buy_food_qty% ) find2
13: ifgoto ( m_city.cityManager.tradesArray[2].amount == %buy_food_qty% ) find2
14: ifgoto ( m_city.cityManager.tradesArray[3].amount == %buy_food_qty% ) find2
15: ifgoto ( m_city.cityManager.tradesArray[4].amount == %buy_food_qty% ) find2
16: ifgoto ( m_city.cityManager.tradesArray[5].amount == %buy_food_qty% ) find2
17: ifgoto ( m_city.cityManager.tradesArray[6].amount == %buy_food_qty% ) find2
18: ifgoto ( m_city.cityManager.resource.food.amount < %food_max% ) ok_buy_food
19: print x limit reached so no longer buying food
20: buy food %buy_food_qty% .01
21: gosubreturn

22: label ok_buy_food
23: buy food %buy_food_qty% %buy_food_price%
24: gosubreturn

25: label find2
26: print x checking if we bought wood
27: ifgoto ( m_city.cityManager.tradesArray[1].amount == %buy_wood_qty% ) find3
28: ifgoto ( m_city.cityManager.tradesArray[0].amount == %buy_wood_qty% ) find3
29: ifgoto ( m_city.cityManager.tradesArray[2].amount == %buy_wood_qty% ) find3
30: ifgoto ( m_city.cityManager.tradesArray[3].amount == %buy_wood_qty% ) find3
31: ifgoto ( m_city.cityManager.tradesArray[4].amount == %buy_wood_qty% ) find3
32: ifgoto ( m_city.cityManager.tradesArray[5].amount == %buy_wood_qty% ) find3
33: ifgoto ( m_city.cityManager.tradesArray[6].amount == %buy_wood_qty% ) find3
34: ifgoto ( m_city.cityManager.resource.wood.amount < %wood_max% ) ok_buy_wood
35: print x limit reached so no longer buying wood
36: buy wood %buy_wood_qty% .01
37: gosubreturn

38: label ok_buy_wood
39: buy lumber %buy_wood_qty% %buy_wood_price%
40: gosubreturn

41: label find3
42: print x checking if we bought iron
43: ifgoto ( m_city.cityManager.tradesArray[2].amount == %buy_iron_qty% ) find4
44: ifgoto ( m_city.cityManager.tradesArray[0].amount == %buy_iron_qty% ) find4
45: ifgoto ( m_city.cityManager.tradesArray[1].amount == %buy_iron_qty% ) find4
46: ifgoto ( m_city.cityManager.tradesArray[3].amount == %buy_iron_qty% ) find4
47: ifgoto ( m_city.cityManager.tradesArray[4].amount == %buy_iron_qty% ) find4
48: ifgoto ( m_city.cityManager.tradesArray[5].amount == %buy_iron_qty% ) find4
49: ifgoto ( m_city.cityManager.tradesArray[6].amount == %buy_iron_qty% ) find4
50: ifgoto ( m_city.cityManager.resource.iron.amount < %iron_max% ) ok_buy_iron
51: print x limit reached so no longer buying iron
52: buy iron %buy_iron_qty% .01
53: gosubreturn

54: label ok_buy_iron
55: buy iron %buy_iron_qty% %buy_iron_price%
56: gosubreturn

57: label find4
58: print x checking if we bought stone
59: ifgoto ( m_city.cityManager.tradesArray[3].amount == %buy_stone_qty% ) find5
60: ifgoto ( m_city.cityManager.tradesArray[0].amount == %buy_stone_qty% ) find5
61: ifgoto ( m_city.cityManager.tradesArray[1].amount == %buy_stone_qty% ) find5
62: ifgoto ( m_city.cityManager.tradesArray[2].amount == %buy_stone_qty% ) find5
63: ifgoto ( m_city.cityManager.tradesArray[4].amount == %buy_stone_qty% ) find5
64: ifgoto ( m_city.cityManager.tradesArray[5].amount == %buy_stone_qty% ) find5
65: ifgoto ( m_city.cityManager.tradesArray[6].amount == %buy_stone_qty% ) find5
66: ifgoto ( m_city.cityManager.resource.stone.amount < %stone_max% ) ok_buy_stone
67: print x limit reached so no longer buying stone
68: buy stone %buy_stone_qty% .01
69: gosubreturn

70: label ok_buy_stone
71: buy stone %buy_stone_qty% %buy_stone_price%
72: gosubreturn

73: label find5
74: print x seeing if we sold food
75: ifgoto ( m_city.cityManager.tradesArray[4].amount == %sell_food_qty% ) find6
76: ifgoto ( m_city.cityManager.tradesArray[0].amount == %sell_food_qty% ) find6
77: ifgoto ( m_city.cityManager.tradesArray[1].amount == %sell_food_qty% ) find6
78: ifgoto ( m_city.cityManager.tradesArray[2].amount == %sell_food_qty% ) find6
79: ifgoto ( m_city.cityManager.tradesArray[3].amount == %sell_food_qty% ) find6
80: ifgoto ( m_city.cityManager.tradesArray[5].amount == %sell_food_qty% ) find6
81: ifgoto ( m_city.cityManager.tradesArray[6].amount == %sell_food_qty% ) find6
82: ifgoto ( m_city.cityManager.resource.food.amount > %food_min% ) ok_sell_food
83: print x limit reached so not selling any more food
84: sell food %sell_food_qty% 99
85: gosubreturn

86: label ok_sell_food
87: sell food %sell_food_qty% %sell_food_price%
88: gosubreturn

89: label find6
90: print x seeing if we sold wood
91: ifgoto ( m_city.cityManager.tradesArray[5].amount == %sell_wood_qty% ) find7
92: ifgoto ( m_city.cityManager.tradesArray[0].amount == %sell_wood_qty% ) find7
93: ifgoto ( m_city.cityManager.tradesArray[1].amount == %sell_wood_qty% ) find7
94: ifgoto ( m_city.cityManager.tradesArray[2].amount == %sell_wood_qty% ) find7
95: ifgoto ( m_city.cityManager.tradesArray[3].amount == %sell_wood_qty% ) find7
96: ifgoto ( m_city.cityManager.tradesArray[4].amount == %sell_wood_qty% ) find7
97: ifgoto ( m_city.cityManager.tradesArray[6].amount == %sell_wood_qty% ) find7
98: ifgoto ( m_city.cityManager.resource.wood.amount > %wood_min% ) ok_sell_wood
99: print x limit reached so not selling any more wood
100: sell lumber %sell_wood_qty% 99
101: gosubreturn

102: label ok_sell_wood
103: sell lumber %sell_wood_qty% %sell_wood_price%
104: gosubreturn

105: label find7
106: print x seeing if we sold iron
107: ifgoto ( m_city.cityManager.tradesArray[6].amount == %sell_iron_qty% ) find8
108: ifgoto ( m_city.cityManager.tradesArray[0].amount == %sell_iron_qty% ) find8
109: ifgoto ( m_city.cityManager.tradesArray[1].amount == %sell_iron_qty% ) find8
110: ifgoto ( m_city.cityManager.tradesArray[2].amount == %sell_iron_qty% ) find8
111: ifgoto ( m_city.cityManager.tradesArray[3].amount == %sell_iron_qty% ) find8
112: ifgoto ( m_city.cityManager.tradesArray[4].amount == %sell_iron_qty% ) find8
113: ifgoto ( m_city.cityManager.tradesArray[5].amount == %sell_iron_qty% ) find8
114: ifgoto ( m_city.cityManager.resource.iron.amount > %iron_min% ) ok_sell_iron
115: print x limit reached so not selling any more iron
116: sell iron %sell_iron_qty% 99
117: gosubreturn

118: label ok_sell_iron
119: sell iron %sell_iron_qty% %sell_iron_price%
120: gosubreturn

121: label find8
122: print x musta sold stone
123: ifgoto ( m_city.cityManager.resource.stone.amount > %stone_min% ) ok_sell_stone
124: print x limit reached so not selling any more stone
125: sell stone %sell_stone_qty% 99
126: gosubreturn

127: label ok_sell_stone
128: sell stone %sell_stone_qty% %sell_stone_price%
129: gosubreturn

130: label setup
131: config trade:0
132: canceltrade
133: print x initializing
134: ifgoto ( %buy_food_qty% == %buy_wood_qty% ) error
135: ifgoto ( %buy_food_qty% == %buy_iron_qty% ) error
136: ifgoto ( %buy_food_qty% == %buy_stone_qty% ) error
137: ifgoto ( %buy_food_qty% == %sell_food_qty% ) error
138: ifgoto ( %buy_food_qty% == %sell_wood_qty% ) error
139: ifgoto ( %buy_food_qty% == %sell_iron_qty% ) error
140: ifgoto ( %buy_food_qty% == %sell_stone_qty% ) error
141: ifgoto ( %buy_wood_qty% == %buy_iron_qty% ) error
142: ifgoto ( %buy_wood_qty% == %buy_stone_qty% ) error
143: ifgoto ( %buy_wood_qty% == %sell_food_qty% ) error
144: ifgoto ( %buy_wood_qty% == %sell_wood_qty% ) error
145: ifgoto ( %buy_wood_qty% == %sell_iron_qty% ) error
146: ifgoto ( %buy_wood_qty% == %sell_stone_qty% ) error
147: ifgoto ( %buy_iron_qty% == %buy_stone_qty% ) error
148: ifgoto ( %buy_iron_qty% == %sell_food_qty% ) error
149: ifgoto ( %buy_iron_qty% == %sell_wood_qty% ) error
150: ifgoto ( %buy_iron_qty% == %sell_iron_qty% ) error
151: ifgoto ( %buy_iron_qty% == %sell_stone_qty% ) error
152: ifgoto ( %buy_stone_qty% == %sell_food_qty% ) error
153: ifgoto ( %buy_stone_qty% == %sell_wood_qty% ) error
154: ifgoto ( %buy_stone_qty% == %sell_iron_qty% ) error
155: ifgoto ( %buy_stone_qty% == %sell_stone_qty% ) error
156: ifgoto ( %sell_food_qty% == %sell_wood_qty% ) error
157: ifgoto ( %sell_food_qty% == %sell_iron_qty% ) error
158: ifgoto ( %sell_food_qty% == %sell_stone_qty% ) error
159: ifgoto ( %sell_wood_qty% == %sell_iron_qty% ) error
160: ifgoto ( %sell_wood_qty% == %sell_stone_qty% ) error
161: ifgoto ( %sell_iron_qty% == %sell_stone_qty% ) error

162: buy food %buy_food_qty% %buy_food_price%
163: buy lumber %buy_wood_qty% %buy_wood_price%
164: buy iron %buy_iron_qty% %buy_iron_price%
165: buy stone %buy_stone_qty% %buy_stone_price%
166: sell food %sell_food_qty% %sell_food_price%
167: sell lumber %sell_wood_qty% %sell_wood_price%
168: sell iron %sell_iron_qty% %sell_iron_price%
169: sell stone %sell_stone_qty% %sell_stone_price%
170: Gosubreturn
171: label error
172: print x error
173: print x all buy and sell qty values must be different
174: print x please try again
175: goto exit
176: label end
177: ifgoto ( m_city.cityManager.resource.food.amount < %food_min% ) done
178: print x WARNING we are going to sell food
179: print x Warning 30 sec
180: sleep 10
181: print x 20 seconds
182: print x Warning
183: print x Warning selling 10m food @5
184: print x 12 seconds
185: print x Warning
186: print x Warning
187: print x 8 seconds
188: print x Warning
189: print x too late

190: sell food 9999999 2.5
191: loop 3
192: goto finished

193: label done
194: print x not enough food to sell to raise cash
195: print x i hope your limit was not too low
196: print x or your heroes may be running away
197: goto exit

198: label finished
199: print x Thats it we ran out cash twice
200: print x the good news is we did sell food before
201: print x exiting, so the heroes are safe

202: label exit
203: print x thank you come again
204: print x don't forget to thank the author

Power Level Hero

Great script to level your hero quicker that also builds troops with said hero. If you need help with this script please ask in the forum.

Script by: Candy

// Troop Builder & Hero Trainer 1: label MAINLOOP 2: waithero HERONAME 3: gosub checkPopulation 4: gosub checkTrain 5: gosub checkNextCity


6: label checkPopulation 7: ifgosub ( m_city.cityManager.resource.curPopulation > 40000 ) buildTroop 8: gosubreturn


9: label buildTroop 10: ifgosub ( m_city.cityManager.troop.archer < 450000 ) buildArchers 11: ifgosub ( m_city.cityManager.troop.scouter < 450000 ) buildScouts 12: production 100 100 100 100 13: gosubreturn


14: label buildArchers 15: production 0 0 0 0 16: sleep rnd:3:5 17: train a:10000 HERONAME 18: sleep rnd:3:5 19: train a:10000 HERONAME 20: production 100 100 100 100 21: gosubreturn


22: label buildScouts 23: production 0 0 0 0 24: sleep rnd:3:5 25: train s:10000 HERONAME 26: sleep rnd:3:5 27: train s:10000 HERONAME 28: production 100 100 100 100 29: gosubreturn


30: label checkTrain 31: ifgosub ( m_city.cityManager.troop.archer > 350000 ) heroTrain 32: gosubreturn


33: label heroTrain //change the npc 10 coords to be the ones listed 3 miles from your city when you run the last line of this script 34: attack xxx,xxx HERONAME s:5000,a:95000 35: waithero HERONAME 36: sleep rnd:7:9 37: attack xxx,xxx HERONAME s:5000,a:95000 38: waithero HERONAME 39: sleep rnd:7:9 40: attack xxx,xxx HERONAME s:5000,a:95000 41: waithero HERONAME 42: sleep rnd:7:9 43: attack xxx,xxx HERONAME s:5000,a:95000 44: waithero HERONAME 45: sleep rnd:7:9 46: attack xxx,xxx HERONAME s:5000,a:95000 47: waithero HERONAME 48: sleep rnd:3:5 49: attack xxx,xxx HERONAME s:5000,a:95000 50: gosubreturn


51: label checkNextCity 52: reinforce xxx,xxx HERONAME s:1 // change the coords to be the next city you send your hero 53: loop //findfield npc 10 3 HERONAME s:5000,a:95000 //run this line first, so that it finds for you the npc 10 coords within 3 miles of your city and copy paste it into the section heroTrain