Created: 05/18/2026
Last Updated: about 1 hour ago
Description from the author: This script fully automates Alchemy training from 50 up to your chosen target (maxAlchemy), using one resource container you select at startup.
On every loop, it does the following:
checks if you already reached your target skill (maxAlchemy) and stops automatically;
keeps Alchemy set to up;
restocks core reagents into your backpack when low (spiders silk, garlic, ginseng, mandrake root, bloodmoss, sulfurous ash, nightshade);
restocks empty bottles by ID (0x0F0E or 3854) in batches;
ensures a mortar and pestle is always in your backpack;
if the mortar breaks/runs out, it grabs a new one from the source container, closes/reopens the alchemy gump, and resets category tracking;
opens the alchemy gump only when needed;
auto-selects what potion to craft based on your current skill range:
50–70: Lesser Magic Resist
70–90: Greater Cure
90–100: Greater Explosion
100–115: Greater Magic Resist
115–120: Lethal Poison
optimizes gump navigation by only reselecting potion category when the potion type changes (LastPotionCode);
for Lesser Magic Resist, uses the hotkey to drink it (to recycle bottle flow);
after crafting, it attempts to move finished potions back to the same source container in stacks of 20, based on the current potion color/type.
In short, this macro handles the entire cycle: resource restock, smart crafting flow by skill bracket, mortar recovery, bottle management, and auto-stashing crafted potions with minimal manual input.
clearsysmsg
@setvar! maxAlchemy 120
if not varexist "LastPotionCode"
@setvar! LastPotionCode 0
endif
if not varexist "SourceContainer"
overhead "Selecione a BAG/CONTAINER de recursos" 65
setvar "SourceContainer"
wait 250
endif
if not varexist "SourceContainer"
overhead "SourceContainer nao definido" 38
stop
endif
if skill "Alchemy" >= maxAlchemy
overhead "Target Alchemy Level Reached!" 88
setskill "Alchemy" lock
wait 2000
stop
endif
setskill "Alchemy" up
## -----------------------------
## RESTOCK FROM SOURCE CONTAINER
## -----------------------------
if counttype 3981 backpack < 20
if findtype 3981 SourceContainer as reg
while queued
//donothing
endwhile
lift reg 100
wait 150
drop backpack
wait 150
endif
endif
if counttype 3972 backpack < 20
if findtype 3972 SourceContainer as reg
while queued
//donothing
endwhile
lift reg 100
wait 150
drop backpack
wait 150
endif
endif
if counttype 3973 backpack < 20
if findtype 3973 SourceContainer as reg
while queued
//donothing
endwhile
lift reg 100
wait 150
drop backpack
wait 150
endif
endif
if counttype 3974 backpack < 20
if findtype 3974 SourceContainer as reg
while queued
//donothing
endwhile
lift reg 100
wait 150
drop backpack
wait 150
endif
endif
if counttype 3963 backpack < 20
if findtype 3963 SourceContainer as reg
while queued
//donothing
endwhile
lift reg 100
wait 150
drop backpack
wait 150
endif
endif
if counttype 3980 backpack < 20
if findtype 3980 SourceContainer as reg
while queued
//donothing
endwhile
lift reg 100
wait 150
drop backpack
wait 150
endif
endif
if counttype 3976 backpack < 20
if findtype 3976 SourceContainer as reg
while queued
//donothing
endwhile
lift reg 100
wait 150
drop backpack
wait 150
endif
endif
## --------------------------------
## BOTTLE GUARD (0x0F0E / 3854)
## --------------------------------
while counttype 0x0F0E backpack < 20 and counttype 3854 backpack < 20
if findtype 0x0F0E SourceContainer as bottle
while queued
//donothing
endwhile
lift bottle 20
wait 150
drop backpack
wait 150
elseif findtype 3854 SourceContainer as bottle
while queued
//donothing
endwhile
lift bottle 20
wait 150
drop backpack
wait 150
else
break
endif
endwhile
## --------------------------------
## ENSURE MORTAR AND PESTLE
## --------------------------------
if findtype "mortar and pestle" backpack as item
// ok
else
if findtype "mortar and pestle" SourceContainer as item
while queued
//donothing
endwhile
lift item 1
wait 150
drop backpack
wait 150
## Mortar novo -> fecha gump antigo e abre novo
if gumpexists 949095101
gumpclose 949095101
wait 150
endif
if findtype "mortar and pestle" backpack as item
dclick item
waitforgump 949095101 5000
@setvar! LastPotionCode 0
else
overhead "Need Mortar and Pestle!" 34
wait 1000
loop
endif
else
overhead "Need Mortar and Pestle!" 34
wait 1000
loop
endif
endif
## Abre gump só se precisar
if not gumpexists 949095101
if findtype "mortar and pestle" backpack as item
dclick item
waitforgump 949095101 5000
@setvar! LastPotionCode 0
else
overhead "No Mortar and Pestle in backpack!" 34
wait 1000
loop
endif
endif
## Check extra de bottle antes do craft
if counttype 0x0F0E backpack < 1 and counttype 3854 backpack < 1
if findtype 0x0F0E SourceContainer as bottle
while queued
//donothing
endwhile
lift bottle 20
wait 150
drop backpack
wait 150
elseif findtype 3854 SourceContainer as bottle
while queued
//donothing
endwhile
lift bottle 20
wait 150
drop backpack
wait 150
endif
endif
if counttype 0x0F0E backpack < 1 and counttype 3854 backpack < 1
overhead "Need more Empty Bottles!" 34
wait 800
loop
endif
## -----------------------------
## CRAFT ORDER + SMART CATEGORY
## -----------------------------
## 50-70: Lesser Magic Resist
if skill "Alchemy" < 70
if counttype 3981 backpack < 6
overhead "Need more Spiders Silk!" 34
wait 500
loop
endif
overhead "50 - 70: Lesser Magic Resist" 65
if LastPotionCode = 1
// categoria já selecionada
else
gumpresponse 105 949095101
waitforgump 949095101 5000
@setvar! LastPotionCode 1
endif
gumpresponse 200 949095101
waitforgump 949095101 5000
wait 500
hotkey "Drink Magic Resist"
wait 800
endif
## 70-90: Greater Cure
if skill "Alchemy" >= 70 and skill "Alchemy" < 90
if counttype 3972 backpack < 6
overhead "Need more Garlic!" 34
wait 500
loop
endif
overhead "70 - 90: Greater Cure" 65
if LastPotionCode = 2
// categoria já selecionada
else
gumpresponse 101 949095101
waitforgump 949095101 5000
@setvar! LastPotionCode 2
endif
gumpresponse 204 949095101
waitforgump 949095101 5000
wait 800
endif
## 90-100: Greater Explosion
if skill "Alchemy" >= 90 and skill "Alchemy" < 100
if counttype 3980 backpack < 9
overhead "Need more Sulfurous Ash!" 34
wait 500
loop
endif
overhead "90 - 100: Greater Explosion" 65
if LastPotionCode = 3
// categoria já selecionada
else
gumpresponse 107 949095101
waitforgump 949095101 5000
@setvar! LastPotionCode 3
endif
gumpresponse 204 949095101
waitforgump 949095101 5000
wait 800
endif
## 100-115: Greater Magic Resist
if skill "Alchemy" >= 100 and skill "Alchemy" < 115
if counttype 3981 backpack < 9
overhead "Need more Spiders Silk!" 34
wait 500
loop
endif
overhead "100 - 115: Greater Magic Resist" 65
if LastPotionCode = 4
// categoria já selecionada
else
gumpresponse 105 949095101
waitforgump 949095101 5000
@setvar! LastPotionCode 4
endif
gumpresponse 204 949095101
waitforgump 949095101 5000
wait 800
endif
## 115-120: Lethal Poison
if skill "Alchemy" >= 115 and skill "Alchemy" < 120
if counttype 3976 backpack < 10
overhead "Need more Nightshade!" 34
wait 500
loop
endif
overhead "115 - 120: Lethal Poison" 65
if LastPotionCode = 5
// categoria já selecionada
else
gumpresponse 106 949095101
waitforgump 949095101 5000
@setvar! LastPotionCode 5
endif
gumpresponse 208 949095101
waitforgump 949095101 5000
wait 800
endif
## --------------------------------
## AUTO-DEPOSIT A CADA 20 (NO SourceContainer) - POR COR
## --------------------------------
## code 1 e 4 = resist (black)
if LastPotionCode = 1 or LastPotionCode = 4
while counttype "Black Potion" backpack >= 20
if findtype "Black Potion" backpack as madepot
while queued
//donothing
endwhile
lift madepot 20
wait 150
if findtype "Black Potion" SourceContainer as stashpot
drop stashpot
else
drop SourceContainer
endif
wait 150
else
break
endif
endwhile
endif
## code 2 = greater cure (orange)
if LastPotionCode = 2
while counttype "Orange Potion" backpack >= 20
if findtype "Orange Potion" backpack as madepot
while queued
//donothing
endwhile
lift madepot 20
wait 150
if findtype "Orange Potion" SourceContainer as stashpot
drop stashpot
else
drop SourceContainer
endif
wait 150
else
break
endif
endwhile
endif
## code 3 = greater explosion (purple)
if LastPotionCode = 3
while counttype "Purple Potion" backpack >= 20
if findtype "Purple Potion" backpack as madepot
while queued
//donothing
endwhile
lift madepot 20
wait 150
if findtype "Purple Potion" SourceContainer as stashpot
drop stashpot
else
drop SourceContainer
endif
wait 150
else
break
endif
endwhile
endif
## code 5 = lethal poison (green)
if LastPotionCode = 5
while counttype "Green Potion" backpack >= 20
if findtype "Green Potion" backpack as madepot
while queued
//donothing
endwhile
lift madepot 20
wait 150
if findtype "Green Potion" SourceContainer as stashpot
drop stashpot
else
drop SourceContainer
endif
wait 150
else
break
endif
endwhile
endif
wait 500
loop