Help - Search - Members - Calendar
Full Version: Crafting Macro
AC Tools Everything Macro > AC Tool Macros > Asheron's Call Macros
Ahk
Requires at least beta 5

This macro is cable of crafting anything that you give it info on how to craft. Originally named 'Personal Fletcher' because that's what I intended it for, but due to it's expandability I deemed the name-change necesssary. This is also an update to it:

QUOTE
//V1.08 - Fixed bug that would cause it to not craft anymore after any one thing was crafted with it
//   - Changed DSLocate to DSFindKey, which will increase the speed of crawling the dataset


It features modifyable methods of regeneration of health/stamina/mana and a turbo-mode that doesn't wait on the cursor, but rather tries to keep making as fast as possible--again with a modifyable delay.

Ahk

ahkMake (Crafting macro) is now located on the

AC Tool Macro Vault.
Vengor
mmmmm now to test this with the new dispell potions
Ahk
New dispell potions? Are they different than the old chorizite ones for level V's?
Triane
Hey Ahk, check out this macro I wrote to make arrowheads. It uses what looks to be a similiar technique as far as recipe work in a dataset, but it's Make routine is very efficient:
CODE
// ================================================================
// WARNING: This is a recursive procedure! If you don't understand recursion, and
// how it can break your macro, I would advise leaving this alone.
Procedure Make using What
 DSRecNo Items, Temp1
 ListAdd Recursion1, $What
 ListAdd Recursion2, $Temp1
 ListCount Recursion1, CurrentEvent
 
 Call Have Recursion1[$CurrentEvent]                // If we have it, we're good...
 If $ReturnResult <> OK or $CurrentEvent = 1        // or if we don't...
   DSLocate Items, Name, Recursion1[$CurrentEvent]  // see if we know what to do about it...
   If Items[Name] = Recursion1[$CurrentEvent]       // apparently we do...
     If Items[Req1] = END      
       Call CantMakeIt              
     Else
       Call Make Items[Req1]                    
       Call Make Items[Req2]
     End
     UseItem Items[Req1], Items[Req2]               // put it together...
     ProcessMessages
     Call WaitItem
   Else
     SendText $BrightRed, ERROR: I can't make Items[Name] : I don't have a recipe for it. { $CurrentEvent }
     Stop // This shouldn't happen, so if it does, we gotta shutdown!
   End
 End

 SetConst What = Recursion1[$CurrentEvent]
 DSGotoRec Items, Recursion2[$CurrentEvent]
 ListDelete Recursion1, $CurrentEvent
 ListDelete Recursion2, $CurrentEvent
 ListCount Recursion1, CurrentEvent
End


-Triane
Ahk
Nice. Much easier to read than my code which hops all around the place heh.
Triane
Hehe -- aye, it's pretty slick. By making it completely recursive in a controlled manner (possible by the use of lists to create an artificial variable stack) I was able to really tighten up the algorithm. It simply looks up the item you want to make, if it doesn't have one, it looks up the two components required to make that item, and calls itself for making each of them. This process repeats for as far down however many branches of the tree there are until all prerequisite items have been combined to create the initially crafted item. It works very well biggrin.gif

-Triane
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.