Need autoit v3, just follow the directions.
The script:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
Sleep(10000)
WinActivate("SwgClient")
Global $Paused
Global $timer1
Global $timer2
Global $timer3
Global $timer4
Global $fkey
Dim $CurrItem
Global $CraftToolArray[5]
Global $DraftSchematickey
Global $FinishCraftkey
Global $ingredArray[6][2]
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
If FileExists(@ScriptDir & "\craft.ini") then
$result = MsgBox(262436,"New craft.ini?","Do you want to create a new craft.ini file? Press NO if you just want to adjust timers or not change craft.ini at all!!!")
if $result = 6 then
CreateNewInI()
Exit
else
ReadFromIni()
$result = Msgbox(262436, "Timers", "Do you want to adjust the timer values?")
if $result = 6 then
SetNewTimers()
endif
EndIf
else
$result = Msgbox(262180,"No Craft.ini!","You have no craft.ini file. Do you want to try and generate one?")
if $result = 7 then
Msgbox(262060, "Sorry!","You need a craft.ini file. Since you elected not to create one I am exiting.")
Exit
else
CreateNewIni()
Exit
endif
endif
Sleep(1000)
$CurrItem = 1
$fkey = 0
While 1 ;infinite loop
If $Paused then
Sleep(1000)
Else
Craft()
Increment()
EndIf
Wend
Func Craft()
Send("{"&$CraftToolArray[$fkey]&"}")
Sleep($timer1)
Send("{"&$DraftSchematickey&"}")
Sleep($timer2)
While $ingredArray[$Curritem-1][0] <> ""
MouseClick("left",$ingredArray[$CurrItem -1][0],$ingredArray[$CurrItem -1][1],2)
MouseClick("left",$ingredArray[$CurrItem -1][0],$ingredArray[$CurrItem -1][1],2)
$CurrItem = $CurrItem +1
Wend
$CurrItem = 1
Sleep($timer3)
Send("{"&$FinishCraftkey&"}")
Sleep($timer4)
EndFunc
Func Increment()
$fkey = $fkey +1
If $CraftToolArray[$fkey] = "" then
$fkey = 0
endif
EndFunc
Func TogglePause()
$Paused = NOT $Paused
EndFunc
Func Terminate()
MsgBox(4096,"", "The End")
Exit
EndFunc
Func ReadFromIni()
$CraftToolArray[0] = IniRead(@ScriptDir & "\craft.ini", "fkeys", "CraftTool1key", "NotFound")
$CraftToolArray[1] = IniRead(@ScriptDir & "\craft.ini", "fkeys", "CraftTool2key", "NotFound")
$CraftToolArray[2] = IniRead(@ScriptDir & "\craft.ini", "fkeys", "CraftTool3key", "NotFound")
$CraftToolArray[3] = IniRead(@ScriptDir & "\craft.ini", "fkeys", "CraftTool4key", "NotFound")
$CraftToolArray[4] = IniRead(@ScriptDir & "\craft.ini", "fkeys", "CraftTool5key", "NotFound")
$DraftSchematickey = IniRead(@ScriptDir & "\craft.ini", "fkeys", "DraftSchematickey", "NotFound")
$FinishCraftkey = IniRead(@ScriptDir & "\craft.ini", "fkeys", "FinishCraftkey", "NotFound")
$ingredArray[0][0] = IniRead(@ScriptDir & "\craft.ini", "Coorids", "ingred1x", "NotFound")
$ingredArray[0][1] = IniRead(@ScriptDir & "\craft.ini", "Coorids", "ingred1y", "NotFound")
$ingredArray[1][0] = IniRead(@ScriptDir & "\craft.ini", "Coorids", "ingred2x", "NotFound")
$ingredArray[1][1] = IniRead(@ScriptDir & "\craft.ini", "Coorids", "ingred2y", "NotFound")
$ingredArray[2][0] = IniRead(@ScriptDir & "\craft.ini", "Coorids", "ingred3x", "NotFound")
$ingredArray[2][1] = IniRead(@ScriptDir & "\craft.ini", "Coorids", "ingred3y", "NotFound")
$ingredArray[3][0] = IniRead(@ScriptDir & "\craft.ini", "Coorids", "ingred4x", "NotFound")
$ingredArray[3][1] = IniRead(@ScriptDir & "\craft.ini", "Coorids", "ingred4y", "NotFound")
$ingredArray[4][0] = IniRead(@ScriptDir & "\craft.ini", "Coorids", "ingred5x", "NotFound")
$ingredArray[4][1] = IniRead(@ScriptDir & "\craft.ini", "Coorids", "ingred5y", "NotFound")
$timer1 = IniRead(@ScriptDir & "\craft.ini", "timers", "timer1", "NotFound")
$timer2 = IniRead(@ScriptDir & "\craft.ini", "timers", "timer2", "NotFound")
$timer3 = IniRead(@ScriptDir & "\craft.ini", "timers", "timer3", "NotFound")
$timer4 = IniRead(@ScriptDir & "\craft.ini", "timers", "timer4", "NotFound")
EndFunc
Func CreateNewIni()
$CraftToolArray[0] = InputBox("Craft Tool #1 Location", "Which F-key contains Craft Tool #1? Example, F1","")
IniWrite(@ScriptDir & "\craft.ini", "fkeys", "CraftTool1key", StringUpper($CraftToolArray[0]))
$result = MsgBox(262436,"Another?","Want to enter another Craft Tool?")
If $result = 7 then
IniWrite(@ScriptDir & "\craft.ini", "fkeys", "CraftTool2key", "")
IniWrite(@ScriptDir & "\craft.ini", "fkeys", "CraftTool3key", "")
IniWrite(@ScriptDir & "\craft.ini", "fkeys", "CraftTool4key", "")
IniWrite(@ScriptDir & "\craft.ini", "fkeys", "CraftTool5key", "")
else
$CraftToolArray[1] = InputBox("Craft Tool #2 Location", "Which F-key contains Craft Tool #2?","")
IniWrite(@ScriptDir & "\craft.ini", "fkeys", "CraftTool2key", StringUpper($CraftToolArray[1]))
$result = MsgBox(262436,"Another?","Want to enter another Craft Tool?")
If $result = 7 then
IniWrite(@ScriptDir & "\craft.ini", "fkeys", "CraftTool3key", "")
IniWrite(@ScriptDir & "\craft.ini", "fkeys", "CraftTool4key", "")
IniWrite(@ScriptDir & "\craft.ini", "fkeys", "CraftTool5key", "")
else
$CraftToolArray[2] = InputBox("Craft Tool #3 Location", "Which F-key contains Craft Tool #3?","")
IniWrite(@ScriptDir & "\craft.ini", "fkeys", "CraftTool3key", StringUpper($CraftToolArray[2]))
$result = MsgBox(262436,"Another?","Want to enter another Craft Tool?")
If $result = 7 then
IniWrite(@ScriptDir & "\craft.ini", "fkeys", "CraftTool4key", "")
IniWrite(@ScriptDir & "\craft.ini", "fkeys", "CraftTool5key", "")
else
$CraftToolArray[3] = InputBox("Craft Tool #4 Location", "Which F-key contains Craft Tool #4?","")
IniWrite(@ScriptDir & "\craft.ini", "fkeys", "CraftTool4key", StringUpper($CraftToolArray[3]))
$result = MsgBox(262436,"Another?","Want to enter another Craft Tool?")
If $result = 7 then
IniWrite(@ScriptDir & "\craft.ini", "fkeys", "CraftTool5key", "")
else
$CraftToolArray[4] = InputBox("Craft Tool #5 Location", "Which F-key contains Craft Tool #5?","")
IniWrite(@ScriptDir & "\craft.ini", "fkeys", "CraftTool5key", StringUpper($CraftToolArray[4]))
endif
endif
endif
endif
$DraftSchematickey = InputBox("DraftSchematic Key Location", "Which F-key contains the in-game /SelectDraftSchematic macro?","")
IniWrite(@ScriptDir & "\craft.ini", "fkeys", "DraftSchematickey", StringUpper($DraftSchematickey))
$FinishCraftkey = InputBox("FinishCraft Key Location", "Which F-key contains the in-game macro the completes the crafting process?","")
IniWrite(@ScriptDir & "\craft.ini", "fkeys", "FinishCraftkey", StringUpper($FinishCraftkey))
Msgbox(262160,"Ingredients","Now we will load the ingredient coords for up to five ingredients. BEFORE pressing the OK button ensure your SelectDraftSchematic macro is in the correct location and set to the desired schematic you want to craft.")
WinActivate("SwgClient")
Send("{"&$CraftToolArray[0]&"}")
sleep(2000)
Send("{"&$DraftSchematickey&"}")
Sleep(5000)
Msgbox(262160,"Ingred 1","Now you will SINGLE click on Ingredient #1 AFTER you click OK then just WAIT!")
Sleep(5000)
$CurrentMousePos = MouseGetPos()
IniWrite(@ScriptDir & "\craft.ini", "Coorids", "ingred1x", $CurrentMousePos[0])
$IngredArray[0][0] = $CurrentMousePos[0]
IniWrite(@ScriptDir & "\craft.ini", "Coorids", "ingred1y", $CurrentMousePos[1])
$IngredArray[0][1] = $CurrentMousePos[1]
$result = Msgbox(262180,"Another?","Coords of Ingredient #1 are stored! Enter coords for another ingredient?")
if $result = 6 then
Msgbox(262160,"Ingred 2","Now you will SINGLE click on Ingredient #2 AFTER you click OK then just WAIT!")
WinActivate("SwgClient")
Sleep(5000)
$CurrentMousePos = MouseGetPos()
IniWrite(@ScriptDir & "\craft.ini", "Coorids", "ingred2x", $CurrentMousePos[0])
$IngredArray[1][0] = $CurrentMousePos[0]
IniWrite(@ScriptDir & "\craft.ini", "Coorids", "ingred2y", $CurrentMousePos[1])
$IngredArray[1][1] = $CurrentMousePos[1]
$result = Msgbox(262180,"Another?","Coords of Ingredient #2 are stored! Enter coords for another ingredient?")
if $result = 6 then
Msgbox(262160,"Ingred 3","Now you will SINGLE click on Ingredient #3 AFTER you click OK then just WAIT!")
Sleep(5000)
$CurrentMousePos = MouseGetPos()
IniWrite(@ScriptDir & "\craft.ini", "Coorids", "ingred3x", $CurrentMousePos[0])
$IngredArray[2][0] = $CurrentMousePos[0]
IniWrite(@ScriptDir & "\craft.ini", "Coorids", "ingred3y", $CurrentMousePos[1])
$IngredArray[2][1] = $CurrentMousePos[1]
$result = Msgbox(262180,"Another?","Coords of Ingredient #3 are stored! Enter coords for another ingredient?")
if $result = 6 then
Msgbox(262160,"Ingred 4","Now you will SINGLE click on Ingredient #4 AFTER you click OK then just WAIT!")
Sleep(5000)
$CurrentMousePos = MouseGetPos()
IniWrite(@ScriptDir & "\craft.ini", "Coorids", "ingred4x", $CurrentMousePos[0])
$IngredArray[3][0] = $CurrentMousePos[0]
IniWrite(@ScriptDir & "\craft.ini", "Coorids", "ingred4y", $CurrentMousePos[1])
$IngredArray[3][1] = $CurrentMousePos[1]
$result = Msgbox(262180,"Another?","Coords of Ingredient #4 are stored! Enter coords for another ingredient?")
if $result = 6 then
Msgbox(262160,"Ingred 5","Now you will SINGLE click on Ingredient #5 AFTER you click OK then just WAIT!")
Sleep(5000)
$CurrentMousePos = MouseGetPos()
IniWrite(@ScriptDir & "\craft.ini", "Coorids", "ingred5x", $CurrentMousePos[0])
$IngredArray[5][0] = $CurrentMousePos[0]
IniWrite(@ScriptDir & "\craft.ini", "Coorids", "ingred5y", $CurrentMousePos[1])
$IngredArray[5][1] = $CurrentMousePos[1]
else
IniWrite(@ScriptDir & "\craft.ini", "coorids", "ingred5x", "")
IniWrite(@ScriptDir & "\craft.ini", "coorids", "ingred5y", "")
$IngredArray[5][0] = ""
$IngredArray[5][1] = ""
endif
else
IniWrite(@ScriptDir & "\craft.ini", "coorids", "ingred5x", "")
IniWrite(@ScriptDir & "\craft.ini", "coorids", "ingred5y", "")
$IngredArray[5][0] = ""
$IngredArray[5][1] = ""
IniWrite(@ScriptDir & "\craft.ini", "coorids", "ingred4x", "")
IniWrite(@ScriptDir & "\craft.ini", "coorids", "ingred4y", "")
$IngredArray[4][0] = ""
$IngredArray[4][1] = ""
endif
else
IniWrite(@ScriptDir & "\craft.ini", "coorids", "ingred5x", "")
IniWrite(@ScriptDir & "\craft.ini", "coorids", "ingred5y", "")
$IngredArray[5][0] = ""
$IngredArray[5][1] = ""
IniWrite(@ScriptDir & "\craft.ini", "coorids", "ingred4x", "")
IniWrite(@ScriptDir & "\craft.ini", "coorids", "ingred4y", "")
$IngredArray[4][0] = ""
$IngredArray[4][1] = ""
IniWrite(@ScriptDir & "\craft.ini", "coorids", "ingred3x", "")
IniWrite(@ScriptDir & "\craft.ini", "coorids", "ingred3y", "")
$IngredArray[3][0] = ""
$IngredArray[3][1] = ""
endif
else
IniWrite(@ScriptDir & "\craft.ini", "coorids", "ingred5x", "")
IniWrite(@ScriptDir & "\craft.ini", "coorids", "ingred5y", "")
$IngredArray[5][0] = ""
$IngredArray[5][1] = ""
IniWrite(@ScriptDir & "\craft.ini", "coorids", "ingred4x", "")
IniWrite(@ScriptDir & "\craft.ini", "coorids", "ingred4y", "")
$IngredArray[4][0] = ""
$IngredArray[4][1] = ""
IniWrite(@ScriptDir & "\craft.ini", "coorids", "ingred3x", "")
IniWrite(@ScriptDir & "\craft.ini", "coorids", "ingred3y", "")
$IngredArray[3][0] = ""
$IngredArray[3][1] = ""
IniWrite(@ScriptDir & "\craft.ini", "coorids", "ingred2x", "")
IniWrite(@ScriptDir & "\craft.ini", "coorids", "ingred2y", "")
$IngredArray[2][0] = ""
$IngredArray[2][1] = ""
endif
WinActivate("SwgClient")
MsgBox(262144,"Timers", "There are 4 timers which have beed set to a default value. Timer1 controls the delay to initialize a crafting tool. Timer2 controls the delay for a schematic to load. Timer3 delays until all ingredients have loaded. Timer4 is the delay for the craft process to complete. If you find you need to adjust these vaules you will be able to do so the next time you start this macro. Congratulations!! You have successfully created a craft.ini file for future use. This macro will now stop and you must restart to re-initialize.")
IniWrite(@ScriptDir & "\craft.ini", "timers", "timer1", "2000")
IniWrite(@ScriptDir & "\craft.ini", "timers", "timer2", "4000")
IniWrite(@ScriptDir & "\craft.ini", "timers", "timer3", "3000")
IniWrite(@ScriptDir & "\craft.ini", "timers", "timer4", "5000")
EndFunc
Func SetNewTimers()
WinActivate("SwgClient")
$result = Inputbox("Timer #1","Timer #1 which controls the delay for the craft tool to initialize is currently set to " & $timer1 & ". Enter new value below or press CANCEL to leave unchanged. Remember 1000 = 1 second.","")
if $result <> "" then
$timer1 = $result
IniWrite(@ScriptDir & "\craft.ini", "timers", "timer1", $timer1)
endif
$result = Inputbox("Timer #2","Timer #2 which controls the delay for the schematic to load is currently set to " & $timer2 & ". Enter new value below or press CANCEL to leave unchanged. Remember 1000 = 1 second.","")
if $result <> "" then
$timer2 = $result
IniWrite(@ScriptDir & "\craft.ini", "timers", "timer2", $timer2)
endif
$result = Inputbox("Timer #3","Timer #3 which controls the delay for the ingredients to finish loading is currently set to " & $timer3 & ". Enter new value below or press CANCEL to leave unchanged. Remember 1000 = 1 second.","")
if $result <> "" then
$timer3 = $result
IniWrite(@ScriptDir & "\craft.ini", "timers", "timer3", $timer3)
endif
$result = Inputbox("Timer #4","Timer #4 which controls the delay for the completion of the crafting cycle is currently set to " & $timer4 & ". Enter new value below or press CANCEL to leave unchanged. Remember 1000 = 1 second.","")
if $result <> "" then
$timer4 = $result
IniWrite(@ScriptDir & "\craft.ini", "timers", "timer4", $timer4)
endif
EndFunc