By using two variables and three loops we can make it run any number of racks / fires / kettles that can be fit on a screen. It also makes for shorter macros too.
For Example:
Constants
Rows = 2
Columns = 2
End
Loop 1000 //However many cycles we want to run - See point 2.
Loop $Rows
loop $Columns MousePos someX, someY delay SomeTime Click delay SomeTime compute someX = $someX + $someXMod end compute someY = someY + someYMod set someX = initialXend
The Outermost loop determines how many complete cycles we run through
The Middle loop runs through each row.
The Inner loop runs though each Column in the current row.
So the order of the panes for a 3 by 3 grid would be as so:
1 2 3
4 5 6
7 8 9
In the case of my bonfire macro, it can handle up to 7 columns and 4 rows. It can thus be used with ($Rows * $Columns) bonfires where Rows is an integer between 1 and 4 and Columns is an integer between 1 and 7. This method allows for any number of panes between 1 and Max Rows * Max Columns, excluding prime numbers greater than the larger of the two max values.
As far as making for shorter macros, the entirety of most bonfire macros can be contained within the above code, with the exception of the lighting of the fires. If I wasn't so lazy and encapsulated some of it into procedures the entire macro could be only about twice the size as the above.
I only just discovered this function in ACTool but it should make requiring the user to make any sort of calculation relating to the number of cycles obsolete.
For Example:
Constants
Columns = 2 //This and the Rows Constant are related to point #1
Rows = 2 //In the spirit of allowing the user some flexibility
Wood = 3001 //How much wood do you have in inventory? We'll figure out how many loops we can do with this much wood
Loops = 0
End
Compute Loops = ($Wood / ($columns * $rows))
FormatNumber Loops = $feedloops,####.;;Zero
Loop $Loops
//Do our thing
End
This function is horribly documented. Wait, all of ACTool is horribly documented. Sad really. Basically, the compute function in this example would return 750.25, the loop procedure requires an integer which our value is not. The FormatNumber truncates the digits to the right of the decimal place effectively making it into an integer. You could presumably still break it by making wood a negative number or greater than 9999 with rows and cols = 1... But there's a limit to what I'm willing to plan for.
One of the reasons I started writing my own macros was to make a 10 bonfire macro that didn't take an hour to set up and often wrongly at that. Don't get me wrong, running 28 bonfires is great! But it was taking me too long, so I started working on a way to position the panes prior to running the macro. It seems that Anka has beaten me to it, and one upped me! In any case, this may still yet serve some purpose in allowing people to adjust their personal macros to auto position.
The procedure rests on the dragto X,Y function in ACTool. Pretty self explanatory, position the mouse over the pane to be dragged and call the DragTo with the X and Y values of the desired location as it's arguments.
MousePos 843, 601
delay 150
dragto 200, 200
So that's that. I have of course the ubiquitos Flax processing and mining macros that are easier to write than to download. Though I've had a lot of in game questions regarding the most basic of macro writing so I may put up a tutorial on writing your own macros, course I still have a great deal to learn myself. Draeton's (We will miss you) Barley macro is a testamet to what can be done with ACTool and as of yet remains undone.
If anyone has experience with Wiki formatting and can possibly make this look prettier, please do :). Thanks.
Name | Creator | Date | Size | Description |
---|---|---|---|---|
BricksDoneBetter | Synthetic-Angel | April 6, 2005 8:31 am | 3382 | A better brick macro, about 10K per hour |
CharcoalPart1 | Synthetic-Angel | April 23, 2005 4:00 am | 525 | The initial positioning portion of the Charcoal macro |
CharcoalPart2 | Synthetic-Angel | April 8, 2005 1:34 am | 3128 | The Business portion of the Charcoal macro |