Post by Experience on Nov 15, 2016 0:17:51 GMT
//The Keg Factory
//Author: Experience
//
//Create an organizer named "Regs" set to stock 50 of each reg
//Have 2 empty bottles in your pack
//Drop 1 Potion of the type you want the keg to be filled with
//IE: If you want 10 GRefresh. Put 1 GRefresh into 10 of the kegs.
//The macro will detect each keg and fill them with designated potion
//
//Setup
@clearjournal
if not @findobject 'EKegs'
headmsg 'Selet a Bag with Empty Kegs'
promptalias 'EKegs'
endif
if not @findobject 'FKegs'
headmsg 'Select a Bag to store Full Kegs'
promptalias 'FKegs'
endif
if not @findobject 'Resource'
headmsg 'Select the bag with your Reg/Mortar supply'
promptalias 'Resource'
endif
//Check for Mortars
if not @findtype '0xe9b' '0' 'backpack' 'any' '3'
@useobject 'Resource'
pause 600
if @findtype '0xe9b' '0' 'Resource' 'any' '3'
pause 600
moveitem 'found' 'backpack'
else
headmsg 'No mortars found'
stop
endif
endif
//Check for Bottles
if not @findtype '0xf0e' '0' 'backpack' 'any' '3'
headmsg 'Get a couple empty bottles and resume'
stop
endif
//Check for Keg in pack
if @findtype '0x1940' 'any' 'backpack' 'any' '3'
headmsg 'Keg found'
@setalias 'KTU' 'found'
else
headmsg 'No keg in pack'
@useobject 'Resource'
pause 600
@findtype '0x1940' 'any' 'Resource' 'any' '3'
pause 600
@moveitem 'found' 'backpack'
pause 600
@setalias 'KTU' 'found'
endif
//Set Potion type
@clickobject 'KTU'
pause 600
if @injournal 'A keg of Greater Refreshment' 'system'
headmsg 'Setting to Refresh...'
@usetype '0xe9b' '0' 'backpack' '3'
waitforgump 0x38920abd 15000
replygump 0x38920abd 1
waitforgump 0x38920abd 15000
elseif @injournal 'A keg of Greater Agility' 'system'
headmsg 'Setting to Agility...'
@usetype '0xe9b' '0' 'backpack' '3'
waitforgump 0x38920abd 15000
replygump 0x38920abd 8
waitforgump 0x38920abd 15000
elseif @injournal 'A keg of Greater Strength' 'system'
headmsg 'Setting to Strength...'
@usetype '0xe9b' '0' 'backpack' '3'
waitforgump 0x38920abd 15000
replygump 0x38920abd 29
waitforgump 0x38920abd 15000
elseif @injournal 'A Keg of Greater Cure' 'system'
headmsg 'Setting to Cure...'
@usetype '0xe9b' '0' 'backpack' '3'
waitforgump 0x38920abd 15000
replygump 0x38920abd 43
waitforgump 0x38920abd 15000
elseif @injournal 'A Keg of Greater Heal' 'system'
headmsg 'Setting to Heal...'
@usetype '0xe9b' '0' 'backpack' '3'
waitforgump 0x38920abd 15000
replygump 0x38920abd 22
waitforgump 0x38920abd 15000
elseif @injournal 'A Keg of Greater Explosion' 'system'
headmsg 'Setting to Explosion...'
@usetype '0xe9b' '0' 'backpack' '3'
waitforgump 0x38920abd 15000
replygump 0x38920abd 50
waitforgump 0x38920abd 15000
elseif @injournal 'A Keg of Deadly Poison' 'system'
headmsg 'Setting to Poison...'
@usetype '0xe9b' '0' 'backpack' '3'
waitforgump 0x38920abd 15000
replygump 0x38920abd 36
waitforgump 0x38920abd 15000
elseif @injournal 'The keg is empty.' 'system'
headmsg 'Keg is empty...'
moveitem 'KTU' 'FKegs'
pause 800
@unsetalias 'KTU'
replay
elseif @injournal 'The keg is competely full' 'system'
headmsg 'Keg is already full...'
moveitem 'KTU' 'FKegs'
pause 800
@unsetalias 'KTU'
replay
else
headmsg 'Type was not identified. Please be sure you are making Greater Kegs or Deadly Poison...'
stop
endif
//Beginning of Keg Filling
while @findalias 'KTU'
//
//Making sure regs are stocked
//
//Black Pearl
if counttype '0xf7a' '0' 'backpack' < 10
@useobject 'Resource'
pause 600
organizer 'Regs' 'Resource' 'backpack'
while organizing
pause 600
endwhile
endif
//Blood Moss
if counttype '0xf7b' '0' 'backpack' < 10
@useobject 'Resource'
pause 600
organizer 'Regs' 'Resource' 'backpack'
while organizing
pause 600
endwhile
endif
//Ginseng
if counttype '0xf85' '0' 'backpack' < 10
@useobject 'Resource'
pause 600
organizer 'Regs' 'Resource' 'backpack'
while organizing
pause 600
endwhile
endif
//Mandrake
if counttype '0xf86' '0' 'backpack' < 10
@useobject 'Resource'
pause 600
organizer 'Regs' 'Resource' 'backpack'
while organizing
pause 600
endwhile
endif
//Nightshade
if counttype '0xf88' '0' 'backpack' < 10
@useobject 'Resource'
pause 600
organizer 'Regs' 'Resource' 'backpack'
while organizing
pause 600
endwhile
endif
//Garlic
if counttype '0xf84' '0' 'backpack' < 10
@useobject 'Resource'
pause 600
organizer 'Regs' 'Resource' 'backpack'
while organizing
pause 600
endwhile
endif
//Sulfurous Ash
if counttype '0xf8c' '0' 'backpack' < 10
@useobject 'Resource'
pause 600
organizer 'Regs' 'Resource' 'backpack'
while organizing
pause 600
endwhile
endif
if @injournal 'A keg of Greater Refresh' 'system'
if not @gumpexists '0x38920abd'
@usetype '0xe9b' '0' 'backpack' '3'
waitforgump 0x38920abd 15000
endif
replygump 0x38920abd 9
waitforgump 0x38920abd 15000
endif
if @injournal 'A keg of Greater Agility' 'system'
if not @gumpexists '0x38920abd'
@usetype '0xe9b' '0' 'backpack' '3'
waitforgump 0x38920abd 15000
endif
replygump 0x38920abd 9
waitforgump 0x38920abd 15000
endif
if @injournal 'A keg of Greater Heal' 'system'
if not @gumpexists '0x38920abd'
@usetype '0xe9b' '0' 'backpack' '3'
waitforgump 0x38920abd 15000
endif
replygump 0x38920abd 16
waitforgump 0x38920abd 15000
endif
if @injournal 'A keg of Greater Strength' 'system'
if not @gumpexists '0x38920abd'
@usetype '0xe9b' '0' 'backpack' '3'
waitforgump 0x38920abd 15000
endif
replygump 0x38920abd 9
waitforgump 0x38920abd 15000
endif
if @injournal 'A keg of Deadly Poison' 'system'
if not @gumpexists '0x38920abd'
@usetype '0xe9b' '0' 'backpack' '3'
waitforgump 0x38920abd 15000
endif
replygump 0x38920abd 23
waitforgump 0x38920abd 15000
endif
if @injournal 'A keg of Greater Cure' 'system'
if not @gumpexists '0x38920abd'
@usetype '0xe9b' '0' 'backpack' '3'
waitforgump 0x38920abd 15000
endif
replygump 0x38920abd 16
waitforgump 0x38920abd 15000
endif
if @injournal 'A keg of Greater Explosion' 'system'
if not @gumpexists '0x38920abd'
@usetype '0xe9b' '0' 'backpack' '3'
waitforgump 0x38920abd 15000
endif
replygump 0x38920abd 16
waitforgump 0x38920abd 15000
endif
//Check Keg Level
@clickobject 'KTU'
pause 800
///Full Keg move/Get next keg
if @injournal 'The keg is completely full' 'system'
@moveitem 'KTU' 'FKegs'
pause 600
@unsetalias 'KTU'
@clearjournal
else
headmsg 'Keg is not full yet...'
endif
endwhile