Alchey Factory (automated multiple Potion Keg Filler)

amonseti

Grandmaster
Hey all been meaning to add this macro to the public . thx gos out to @Infectious for reminding me or lighting a fire under my arse!

All you need to know is in the code comments

Edit: (01/05/16)> [ 3.5 ] Added some additional code comments regarding usage.
Edit: (01/25/16)> [ 3.6 ] Added house cleaning function to remove any pots in pack before starting production.

Code:
// $$$$$$$$ Alchey Factory $$$$$$$$
// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
// ?? By Amonseti
// ?? V3.6
// ???????????????????????????????????????
// ?? Ultimate Alchemy pot maker
// ?? keg fill and dye, Organzer.
// ??
// ?? REQUIRMENTS:
// ?? This macro will first ask you to
// ?? make the first pot, and then will
// ?? continue filling kegs of that pot
// ?? type until resource supply is used
// ?? up, or there are no more empty kegs.
// ??  - Your will need 5 unique containers
// ??    !Please insure you can put and pull
// ??    items from each container.!
// ??    > 1st container containing supply of
// ??      Regs to make the pots.
// ??    > 2nd container should be your main
// ??      back pack, and is used by the macro
// ??      to work in.
// ??    > 3rd container is where all the empty
// ??      kegs are stored. (TIP: if you want to
// ??      only make 10 full kegs then just put
// ??      10 empty kegs in this container)
// ??    > 4th container is where the filled kegs
// ??      will be stored.
// ??    > 5th containers is where your failz go.
// ??      dont ask i just always make a trash bag k.
// ?? - Morters, lots of them. This macro will not refill
// ??   or make new morters. if you run out of morters
// ??   the macro will stop production.
// ?? - You will need a Furnature dye tub to paint
// ??   the kegs. (yes the macro will set the color
// ??   and do this all automagically for you)
// ?? - and of course some dyes , to color the dye silly!
// ??
// ?? Simply run the macro and follow the prompts.
// ??
// ?? Warning: the macro will not automate until the first potion is
// ??          Made Succesfully. you will know this once you see the
// ??          message prompt "Potion is set, one moment". Once you
// ??          see that message sit back watch some porn enjoy life!
// ???????????????????????????????????????/##############################################################################
// Initial set up of vars
//
//
unsetalias 'targetDyes'
if @findtype 0xfa9 'any' 'backpack'
  setalias 'targetDyes' 'found'
  headmsg 'Have Dyes' '64'
else
  headmsg 'Please select Dyes' '49'
  promptalias 'targetDyes'
endif
pause 600
//--------- check for dye tub
unsetalias 'targetDyetub'
if @findtype 0xfab 'any' 'backpack'
  setalias 'targetDyetub' 'found'
  headmsg 'Have Furny tub' '64'
else
  headmsg 'Please select Furnature Dye Tub' '49'
  promptalias 'targetDyetub'
endif
pause 600
//
//
//
//
@clearjournal
unsetalias 'regBag'
if not @findobject 'regBag'
  headmsg 'Select the Reg Bag' '49'
  promptalias 'regBag'
endif
pause 100
//
unsetalias 'workingKegBag'
if not @findobject 'workingKegBag'
  headmsg 'Select the Working Keg Bag' '49'
  promptalias 'workingKegBag'
endif
pause 100
//
unsetalias 'emptyKegBag'
if not @findobject 'emptyKegBag'
  headmsg 'Select the Empty Keg Bag' '49'
  promptalias 'emptyKegBag'
endif
pause 100
//
unsetalias 'fullKegBag'
if not @findobject 'fullKegBag'
  headmsg 'Select the Full Keg Bag' '49'
  promptalias 'fullKegBag'
endif
pause 100
unsetalias 'trashBag'
if not @findobject 'trashBag'
  headmsg 'Select the trash Bag' '49'
  promptalias 'trashBag'
endif
pause 600
//------------------
//------------------
if not listexists 'PotionList'
  createlist 'PotionList'
endif
clearlist 'PotionList'
//...
@pushlist 'PotionList' 0xf07
@pushlist 'PotionList' 0xf0b
@pushlist 'PotionList' 0xf08
@pushlist 'PotionList' 0xf0c
@pushlist 'PotionList' 0xf09
@pushlist 'PotionList' 0xf0a
@pushlist 'PotionList' 0xf0d
//
for 0 to 'PotionList'
  while @findtype 'PotionList[]' 'any' 'backpack'
    headmsg '*sigh* doing some house cleaning first tsk tsk' '49'
    pause 1500
    moveitem found 'trashBag'
  endwhile
endfor
//------------------
headmsg 'Please create the first potion manually' '1272'
//while not @ingump 0x38920abd 'You create'
while not @ingump 0x38920abd 'You pour'
  //
  if @findtype 0xe9b 'any' 'backpack'
    useobject 'found'
  else
    msg '[e groan'
    headmsg 'You need Morters in your main pack.' '37'
    stop
  endif
  //
  waitforgump 0x38920abd 15000
  pause 1000
  //
  if @ingump 0x38920abd 'You do not have'
    msg '[e groan'
    headmsg 'You will need the proper regs to make the potion' '49'
    //stop
  endif
  //
  if @ingump 0x38920abd 'You create'
    break
  endif
  //
endwhile
//
//-----
//
headmsg 'Potion is set, one moment' '1272'
pause 3000
// !! init data
if not listexists 'PotionType'
  createlist 'PotionType'
endif
clearlist 'PotionType'
/// !! Find potion type being made and set
//
if @findtype 0xf07 'any' 'backpack'
  // set to cure
  @pushlist 'PotionType' 0xf07 //cure potions
  @pushlist 'PotionType' 0xf84 //Garlic
  @pushlist 'PotionType' '43' //color
  headmsg 'Making Cure Pots' '43'
elseif @findtype 0xf0b 'any' 'backpack'
  // set to refresh
  @pushlist 'PotionType' 0xf0b //refresh potions
  @pushlist 'PotionType' 0xf7a //black peril
  @pushlist 'PotionType' '133' //color
  headmsg 'Making Refresh Pots' '133'
elseif @findtype 0xf08 'any' 'backpack'
  // set to agility
  @pushlist 'PotionType' 0xf08 //agility potions
  @pushlist 'PotionType' 0xf7b //bloodmoss
  @pushlist 'PotionType' '298' //color
  headmsg 'Making Agility Pots' '298'
elseif @findtype 0xf0c 'any' 'backpack'
  // set to Heal
  @pushlist 'PotionType' 0xf0c //heal potions
  @pushlist 'PotionType' 0xf85 //ginsing
  @pushlist 'PotionType' '53' //color
  headmsg 'Making Heal Pots' '53'
elseif @findtype 0xf09 'any' 'backpack'
  // set to Strength
  @pushlist 'PotionType' 0xf09 //strength potions
  @pushlist 'PotionType' 0xf86 //mandrake
  @pushlist 'PotionType' '991' //color
  headmsg 'Making Strength Pots' '991'
elseif @findtype 0xf0a 'any' 'backpack'
  // set to Poison
  @pushlist 'PotionType' 0xf0a //poison potions
  @pushlist 'PotionType' 0xf88 //nightshade
  @pushlist 'PotionType' '64' //color
  headmsg 'Making Poison Pots' '64'
elseif @findtype 0xf0d 'any' 'backpack'
  // set to Explo
  @pushlist 'PotionType' 0xf0d //Explo potions
  @pushlist 'PotionType' 0xf8c //ash
  @pushlist 'PotionType' '18' //color
  headmsg 'Making OP Bombs' '18'
endif
//???????????????????????????????????
// Select first Keg:
// finds keg placed into pack from agent and
// moves it to the workingKegBag
//--------------------------------------------
if @findtype 0x1940 'any' 'emptyKegBag'
  setalias 'targetKeg' 'found'
  pause 600
  moveitem 'targetKeg' 'workingKegBag'
else
  if @findtype 0x1940 'any' 'backpack'
    setalias 'targetKeg' 'found'
  else
    msg '[e groan'
    headmsg 'There are no Kegs avalible.' '37'
    stop
  endif
endif
pause 600
//
autocolorpick 'PotionType[2]'
useobject! 'targetDyes'
waitfortarget 1000
target! 'targetDyetub'
pause 600
//
useobject! 'targetDyetub'
waitfortarget 1500
target! 'targetKeg'
pause 600
//##############################################################################
//##############################################################################
//
//!! <make potion code loop start >
while @findtype 0xe9b 'any' 'backpack'
  @clearjournal
  useobject 'found'
  waitforgump 0x38920abd 15000
  replygump 0x38920abd 21
  pause 2000
  if @ingump 0x38920abd 'You do not have'
    headmsg 'Getting more Regs' '2708'
    //&&&&
    if @findtype 'PotionType[1]' 'any' 'regBag'
      if @counttype 'PotionType[1]' 'any' 'regBag' < 300
        moveitem 'found' 'backpack' 0 0 0
        pause 600
      else
        moveitem 'found' 'backpack' 0 0 0 300
        pause 600
      endif
    else
      headmsg 'OUT OF REGS!'
      stop
    endif
    //&&&&
  endif
  //
  //
  // Move newly created potion into targetKeg
  //--------------------------------------------
  while @findtype 'PotionType[0]' 'any' 'backpack'
    @clearjournal
    moveitem 'found' 'targetKeg'
    pause 1500
    if @injournal 'You decide that' 'system'
      headmsg 'Wrong keg type for this potion. replacing'
      // Replace wrong keg type with a new empty keg
      moveitem 'targetKeg' 'trashBag'
      pause 2500
      if @findtype 0x1940 'any' 'emptyKegBag'
        setalias 'targetKeg' 'found'
        pause 600
        moveitem 'targetKeg' 'workingKegBag'
        pause 600
        useobject! 'targetDyetub'
        waitfortarget 1500
        target! 'targetKeg'
        pause 600
      else
        headmsg 'There are no more empty kegs'
        stop
      endif
    elseif @injournal 'The keg will not' 'system'
      headmsg 'Keg is full replacing with new keg'
      // Replace full keg with a new empty keg
      moveitem 'targetKeg' 'fullKegBag'
      pause 2500
      if @findtype 0x1940 'any' 'emptyKegBag'
        setalias 'targetKeg' 'found'
        pause 600
        moveitem 'targetKeg' 'workingKegBag'
        pause 600
        useobject! 'targetDyetub'
        waitfortarget 1500
        target! 'targetKeg'
        pause 600
      else
        headmsg 'There are no more empty kegs'
        stop
      endif
    endif
  endwhile
  //!! <make potion code loop end here>
endwhile
//
headmsg 'ALL DONE!!'
 
Last edited by a moderator:

Jongi09

Master
Hi there. This is an awesome macro. Got it working a treat for everything but explosion pots for some reason. Any idea what I must be doing wrong?

Sent from my SM-G925F using Tapatalk
 

amonseti

Grandmaster
Hi there. This is an awesome macro. Got it working a treat for everything but explosion pots for some reason. Any idea what I must be doing wrong?

Sent from my SM-G925F using Tapatalk
humm not sure i will test the macro tonight to see if I have a bug .
 

amonseti

Grandmaster
Thanks!

Sent from my SM-G925F using Tapatalk

So I tested this out tonight and did not run into any issues ... however I am going to modify the original code with a house cleaning feature that could cause problems , if you have any type of potions in your pack already when you run the macro..
 

Jongi09

Master
So tested it out. It works an absolute treat now! Not sure why it wasn't before! Thanks a lot.

Now I just need to work out how to farm regs! Keg profit isn't great if you have to buy them!

Sent from my SM-G925F using Tapatalk
 

Trammel Toe

Apprentice
I'm horrible with steam honestly ive only ever used sallos or razor and its been like 7 years since I used razor. I cant seem to get the macro to pull regs from the bag much less have I made it far enough to know if it will pull my mortars.
 

amonseti

Grandmaster
I'm horrible with steam honestly ive only ever used sallos or razor and its been like 7 years since I used razor. I cant seem to get the macro to pull regs from the bag much less have I made it far enough to know if it will pull my mortars.
Need more info ..
Have you followed all the steps in the macro comments ?
 
Need more info ..
Have you followed all the steps in the macro comments ?

I'm having the same issue.

I have plenty of regs in my "reg bag", followed the setup to a T. It says:

[core] Getting more Regs
[cord] OUT OF REGS!

Don't think it would be because i have my regs in a wooden box, but thought i'd add that...
 
I'm having the same issue.

I have plenty of regs in my "reg bag", followed the setup to a T. It says:

[core] Getting more Regs
[cord] OUT OF REGS!

Don't think it would be because i have my regs in a wooden box, but thought i'd add that...

It just started working? I think the only thing i did differently was made sure all kegs/pots were out of my bag except for 1 empty bottle and enough regs to make the first few pots manually.

It seems if a keg with 1 potion in it is in your bag, or you have pre-existing pots, it'll get stuck.

Love it though now that it's running. Thank you sir!
 

HowitzerUO

Neophyte
Is there anyway to get an update to this script? It wont run for me. Will not attempt to pull regs just loops out of resources.
 

Young Star

Grandmaster
Is there anyway to get an update to this script? It wont run for me. Will not attempt to pull regs just loops out of resources.
For some reason this macro works great for a while but sometimes something goes wrong and it cant grab anything from the needed containers. If I log completely out of UO and steam and back in again it will work.
 
Top