Dasffion / Mastercraft

Mastercraft Suite
5 stars 3 forks source link

Buying water order variable not set #9

Closed dylb0t closed 3 months ago

dylb0t commented 4 years ago

[Script finished (In 1.9137215 seconds): automapper.cmd(214)] mc_mix.cmd(242): [return:] mc_mix.cmd(243): [return] mc_mix.cmd, mc_include.cmd(1182): [action (order) on] mc_mix.cmd, mc_include.cmd(1183): [pause 0.5]

mc_mix.cmd, mc_include.cmd(1184): [gosub ORDER] mc_mix.cmd, mc_include.cmd(1268): [var Order ] mc_mix.cmd, mc_include.cmd(1269): [var LOCATION ORDER_1] mc_mix.cmd, mc_include.cmd(1270): [ORDER_1:] mc_mix.cmd, mc_include.cmd(1271): [pause 0.1] mc_mix.cmd, mc_include.cmd(1272): [matchre WAIT ^...wait|^Sorry\,] mc_mix.cmd, mc_include.cmd(1273): [matchre IMMOBILE ^You don't seem to be able to move to do that] mc_mix.cmd, mc_include.cmd(1274): [matchre WEBBED ^You can't do that while entangled in a web] mc_mix.cmd, mc_include.cmd(1275): [matchre STUNNED ^You are still stunned] mc_mix.cmd, mc_include.cmd(1276): [matchre ORDER_1 ^The attendant says\,\s\"You (can|may) purchase ..\sJust order it again and we'll see it done!\" ] mc_mix.cmd, mc_include.cmd(1277): [matchre fullhands ^You realize your hands are full, and stop.] mc_mix.cmd, mc_include.cmd(1278): [matchre lack.coin you don't have enough coins|you don't have that much] mc_mix.cmd, mc_include.cmd(1279): [matchre RETURN ^The attendant takes some coins from you and hands you ..] mc_mix.cmd, mc_include.cmd(1280): [matchre RETURN pay the sales clerk] mc_mix.cmd, mc_include.cmd(1281): [matchre RETURN ^[You may purchase items from the shopkeeper with ORDER] mc_mix.cmd, mc_include.cmd(1282): [if %need.coin = 1 then] mc_mix.cmd, mc_include.cmd(1287): [}] mc_mix.cmd, mc_include.cmd(1288): [if matchre("", "\d+") then] mc_mix.cmd, mc_include.cmd(1289): [if !matchre("", "\d+") then ] mc_mix.cmd, mc_include.cmd(1290): [{] mc_mix.cmd, mc_include.cmd(1291): [if matchre("", "\w+") then] mc_mix.cmd, mc_include.cmd(1292): [else] mc_mix.cmd, mc_include.cmd(1292): [send Order] mc_mix.cmd, mc_include.cmd(1293): [}] mc_mix.cmd, mc_include.cmd(1294): [matchwait 15] Order You see the following items for sale in the catalog:

mc_mix.cmd(35): [var water.order 1] 1). 10 splashes of water..................... 45 Dokoras

mc_mix.cmd(36): [var alcohol.order 2] 2). 10 splashes of grain alcohol............. 58 Dokoras

3). (25 pieces) dried nemoih................. 180 Dokoras

4). (25 pieces) dried plovik................. 225 Dokoras

5). (25 pieces) dried jadice................. 270 Dokoras

6). (25 pieces) dried nilos.................. 315 Dokoras

7). (25 pieces) dried georin................. 315 Dokoras

8). (25 pieces) crushed riolur............... 405 Dokoras

9). (25 pieces) crushed junliar.............. 383 Dokoras

10). (25 pieces) crushed aevaes.............. 387 Dokoras

11). (25 pieces) dried genich stem........... 469 Dokoras

12). (25 pieces) crushed ojhenik............. 721 Dokoras

13). (25 pieces) dried red flowers........... 248 Dokoras

14). (4 pieces) ithor root................... 72 Dokoras

15). (4 pieces) qun pollen................... 76 Dokoras

[You may purchase items from the shopkeeper with ORDER #]

mc_mix.cmd(242): [return:] mc_mix.cmd(243): [return] mc_mix.cmd, mc_include.cmd(1185): [action (order) off] mc_mix.cmd, mc_include.cmd(1186): [gosub ORDER $water.order] mc_mix.cmd, mc_include.cmd(1268): [var Order $water.order] mc_mix.cmd, mc_include.cmd(1269): [var LOCATION ORDER_1] mc_mix.cmd, mc_include.cmd(1270): [ORDER_1:] mc_mix.cmd, mc_include.cmd(1271): [pause 0.1] mc_mix.cmd, mc_include.cmd(1272): [matchre WAIT ^...wait|^Sorry\,] mc_mix.cmd, mc_include.cmd(1273): [matchre IMMOBILE ^You don't seem to be able to move to do that] mc_mix.cmd, mc_include.cmd(1274): [matchre WEBBED ^You can't do that while entangled in a web] mc_mix.cmd, mc_include.cmd(1275): [matchre STUNNED ^You are still stunned] mc_mix.cmd, mc_include.cmd(1276): [matchre ORDER_1 ^The attendant says\,\s\"You (can|may) purchase ..\sJust order it again and we'll see it done!\" ] mc_mix.cmd, mc_include.cmd(1277): [matchre fullhands ^You realize your hands are full, and stop.] mc_mix.cmd, mc_include.cmd(1278): [matchre lack.coin you don't have enough coins|you don't have that much] mc_mix.cmd, mc_include.cmd(1279): [matchre RETURN ^The attendant takes some coins from you and hands you ..] mc_mix.cmd, mc_include.cmd(1280): [matchre RETURN pay the sales clerk] mc_mix.cmd, mc_include.cmd(1281): [matchre RETURN ^[You may purchase items from the shopkeeper with ORDER] mc_mix.cmd, mc_include.cmd(1282): [if %need.coin = 1 then] mc_mix.cmd, mc_include.cmd(1287): [}] mc_mix.cmd, mc_include.cmd(1288): [if matchre("$water.order", "\d+") then] mc_mix.cmd, mc_include.cmd(1289): [if !matchre("$water.order", "\d+") then ] mc_mix.cmd, mc_include.cmd(1290): [{] mc_mix.cmd, mc_include.cmd(1291): [if matchre("$water.order", "\w+") then] mc_mix.cmd, mc_include.cmd(1291): [send buy $water.order] mc_mix.cmd, mc_include.cmd(1292): [else] mc_mix.cmd, mc_include.cmd(1293): [}] mc_mix.cmd, mc_include.cmd(1294): [matchwait 15] buy $water.order You can't order anything here.

dylb0t commented 4 years ago

If you go into mastercraft with no water, it appears to get ordered correctly. There appears to be a duplicate action, one in mc mix and one in mc include that both handle the setting of the water variable. I wonder if one is getting set out of scope. Further investigation to follow. I need to catch it when it runs out of water mid work.

dylb0t commented 4 years ago

Okay, so when it runs out of water mid work, and the script goes and reads the board, it sets the water variable:

mc_mix.cmd(35): [var water.order 1] 1). 10 splashes of water..................... 45 Dokoras But it then ends up in the mc_include.cmd "BUY" catchall buy $water.order You can't order anything here. Because $water.order isn't showing up as the number 1, but the name of the variable. I am going to run a debug with no water to start and see what that looks like, if it is handled completely by mastercraft and mc_include (before mc_mix happens).

dylb0t commented 4 years ago

It does appear to hit the action in mc_include when water is needed when first run, and not mc_mix mastercraft.cmd, mc_include.cmd(54): [action (order) put #tvar water.order when (\d+)\)\..*10 splashes of water.*(Lirums|Kronars|Dokoras)] Going to comment out the action in mc_mix and see if it still gets picked up when water runs out.

dylb0t commented 4 years ago

It seems to have fixed the issue mc_mix.cmd, mc_include.cmd(54): [put #tvar water.order 1] 1). 10 splashes of water..................... 45 Dokoras ` order 1 The attendant says, "You can purchase 10 splashes of water for 45 Dokoras. Just order it again and we'll see it done!"

mc_mix.cmd, mc_include.cmd(1272): [ORDER_1:] mc_mix.cmd, mc_include.cmd(1273): [pause 0.1] mc_mix.cmd, mc_include.cmd(1274): [matchre WAIT ^...wait|^Sorry\,] mc_mix.cmd, mc_include.cmd(1275): [matchre IMMOBILE ^You don't seem to be able to move to do that] mc_mix.cmd, mc_include.cmd(1276): [matchre WEBBED ^You can't do that while entangled in a web] mc_mix.cmd, mc_include.cmd(1277): [matchre STUNNED ^You are still stunned] mc_mix.cmd, mc_include.cmd(1278): [matchre ORDER_1 ^The attendant says\,\s\"You (can|may) purchase ..\sJust order it again and we'll see it done!\" ] mc_mix.cmd, mc_include.cmd(1279): [matchre fullhands ^You realize your hands are full, and stop.] mc_mix.cmd, mc_include.cmd(1280): [matchre lack.coin you don't have enough coins|you don't have that much] mc_mix.cmd, mc_include.cmd(1281): [matchre RETURN ^The attendant takes some coins from you and hands you ..] mc_mix.cmd, mc_include.cmd(1282): [matchre RETURN pay the sales clerk] mc_mix.cmd, mc_include.cmd(1283): [matchre RETURN ^[You may purchase items from the shopkeeper with ORDER] mc_mix.cmd, mc_include.cmd(1284): [if %need.coin = 1 then] mc_mix.cmd, mc_include.cmd(1289): [}] mc_mix.cmd, mc_include.cmd(1290): [if matchre("1", "\d+") then] mc_mix.cmd, mc_include.cmd(1290): [send order 1] mc_mix.cmd, mc_include.cmd(1291): [if !matchre("1", "\d+") then ] mc_mix.cmd, mc_include.cmd(1295): [}] mc_mix.cmd, mc_include.cmd(1296): [matchwait 15] order 1

The attendant takes some coins from you and hands you 10 splashes of water. ` I will need to figure out if there was a reason to have the actions in mc_mix from @Dasffion. Also, I did notice a bug in my testing with this as a fix, to do with the tied toolbelt items, but it could be more related to my pausing the script and dumping my water to force the error. I am going to run through full iterations of testing before submitting a fix.

Azothy commented 3 months ago

Fixed in latest