Bee harvester to Alamiester
Posted: Thu May 31, 2018 1:36 pm
Hi Alamiester,
I was wondering if you can take a look at my bee harvester macro. It does everything great except one thing. It supposed to put the honey and bee wax in my big bag of holding but will not. it goes into my main backpack which goes over weight. I have attached the script. It used in easyuo
Thx Wildlucy
set %mageKeys X ;put your mage keys ID here, or X to auto-detect at start
set %dropBag X ;put a bag's ID here where stuff will be dropped, or X to select at start
set %waitTime 10 ;default is usually fine on Ex, you can try faster if you want but it might glitch
if %mageKeys = X
{
set %mageKeys N/A
finditem NUI C_ , #BACKPACKID
repeat
{
if #FINDKIND <> -1
{
event property #FINDID
if Spell , #spc , Caster in #property && Keys in #property
set %mageKeys #FINDID
else
{
ignoreitem #FINDID 3
finditem NUI C_ , #BACKPACKID
}
}
}
until %mageKeys <> N/A || #FINDKIND = -1
;keys found or all keys checked and none found
ignoreitem reset 3
if %mageKeys <> N/A
display ok Spell Caster's Keys Found!
else
{
display ok No Spell Caster's Keys Detected.$$You need Spell Caster's Keys in your main pack(for bottles) to use this script. Halting script.
halt
}
}
if %dropBag = X
{
display ok Please target the bag to drop harvested resources into.$$Holding bags work best, but you can also use a regular container on the ground and move it with you as you harvest.
event macro 8 7 ;open backpack
set #TARGCURS 1
set #LTARGETID X
repeat
{
sleep 1
}
until #LTARGETID <> X
set %dropBag #LTARGETID
}
set %targetID X
set %targetType X
set %keysSize 505_475
set %savedPosX 0
set %savedPosY 0
event Macro 8 2 ;open status
display ok Please keep your status window open while running this script (to track weight).
set %lastFound #SCNT
loop1:
gosub CheckStatus
if #result <> #true
{
wait %waitTime
goto loop1
}
gosub LocateHive
if #result <> #true
{
if #SCNT - %lastFound > 10
{
display yesno Are you done harvesting?
if #dispres = yes
{
gosub DropStuff
event SysMessage Halting script.
halt
}
set %lastFound #SCNT
}
goto loop1
}
loop2:
gosub TakeStuff
if #result <> #true
goto loop2
ignoreitem %targetID
goto loop1
sub LocateHive
{
findItem OOD G_2
if #FINDCNT > 0
{
;hive found
set %targetID #FINDID
set %targetType #FINDTYPE
set %lastFound #SCNT
gosub OpenHive
return #true
}
else
return #false
}
sub TakeStuff
{
set %clickLocX #CONTPOSX + 70
set %clickLocY #CONTPOSY + 160
beeswaxloop:
set %jrnl #jindex
scanjournal %jrnl
click %clickLocX %clickLocY DMC
wait %waitTime
repeat
{
if #jindex > %jrnl
{
set %jrnl %jrnl + 1
scanjournal %jrnl
}
else
sleep 1
}
until collect_the_excess_beeswax_and_place_it_in_your_pack in #journal
+ || enough_excess_wax_in_the_hive in #journal
+ || room_in_your_backpack in #journal
+ || need_a_hive_tool_to_scrape in #journal
if need_a_hive_tool_to_scrape in #journal
{
event SysMessage You need more hive tools. Halting Script.
halt
}
if room_in_your_backpack in #journal
{
gosub DropStuff
if #result = #false
{
event SysMessage You need space in your backpack. Halting Script.
halt
}
goto beeswaxloop
}
if enough_excess_wax_in_the_hive in #journal
{
gosub OpenHive
}
honeyloop:
set %clickLocX #CONTPOSX + 215
set %clickLocY #CONTPOSY + 160
set %jrnl #jindex
scanjournal %jrnl
click %clickLocX %clickLocY DMC
wait 5
repeat
{
if #jindex > %jrnl
{
set %jrnl %jrnl + 1
scanjournal %jrnl
}
else
sleep 1
}
until need_a_bottle in #journal || fill_a_bottle_with_golden_honey_and_place_it in #journal || enough_honey_in_the_hive in #journal || need_a_hive_tool_to_extract in #journal
if need_a_hive_tool_to_extract in #journal
{
event SysMessage You need more hive tools. Halting Script.
halt
}
if need_a_bottle in #journal
{
gosub GetBottles
goto honeyloop
}
if enough_honey_in_the_hive in #journal
{
goto endhoneypoint
}
repeat
{
sleep 1
}
until #CONTSIZE = 250_219
goto honeyloop
endhoneypoint:
gosub WaitForGump 250_219 3
click %clickLocX %clickLocY R DMC
set %lastFound #SCNT
return #true
}
sub GetBottles
{
set %weight #WEIGHT
if ( #WEIGHT + 100 ) > #MAXWEIGHT
{
event sysMessage You cannot hold 100 bottles.
gosub DropStuff
set %weight #WEIGHT
if #result = #true && ( #WEIGHT + 100 ) < #MAXWEIGHT
{
;move on
}
else
{
event SysMessage You cannot hold more bottles and have nothing collected to drop. Reduce your pack weight. Script Halted.
halt
}
}
set #LOBJECTID %mageKeys
set #LOBJECTTYPE NUI
event macro 17 0
wait %waitTime
repeat
{
sleep 1
}
until #CONTSIZE = %keysSize
set %clickLocX #CONTPOSX + 290
set %clickLocY #CONTPOSY + 160
set %jrnl #jindex
scanjournal %jrnl
click %clickLocX %clickLocY DMC
repeat
{
if #jindex > %jrnl
{
set %jrnl %jrnl + 1
scanjournal %jrnl
}
else
sleep 1
}
until ( #WEIGHT > %weight && #CONTSIZE = %keysSize ) || do_not_have_any_of_that_resource in #journal
if do_not_have_any_of_that_resource in #journal
{
event SysMessage You need more bottles in your Spellcaster's Keys. Script halted.
halt
}
wait 10
click %clickLocX %clickLocY R DMC
return
}
sub DropStuff
{
event SysMessage Attempting to drop collected stuff...
set %weight #WEIGHT
droploop:
finditem KRD_ETH C_ , #BACKPACKID
if #FINDCNT > 0
{
exevent Drag #FINDID #FINDSTACK
exevent Dropc %dropBag
wait %waitTime
goto droploop
}
if #WEIGHT < %weight
return #true
else
return #false
}
sub OpenHive
{
set #LOBJECTID %targetID
set #LOBJECTTYPE %targetType
event macro 17 0 ;open hive
wait %waitTime
;gosub WaitForGump 258_219 5
;if #result <> #true
repeat
{
sleep 1
}
until #CONTSIZE = 258_219
reopensecond:
set %clickLocX #CONTPOSX + 70
set %clickLocY #CONTPOSY + 60
click %clickLocX %clickLocY DMC
gosub WaitForGump 250_219 4
if #result <> #true
goto reopensecond
return
}
sub WaitForGump ;%1 = contsize to wait for, %2 = waittime(seconds)
{
set %gumpWaiting #SCNT
repeat
{
sleep 1
}
until #CONTSIZE = %1 || #SCNT - %gumpWaiting > %2
if #CONTSIZE = %1
return #true ;gump has appeared
else
return #false ;hasn't shown up in allotted time
}
sub CheckStatus
{
if #CHARPOSX <> %savedPosX || #CHARPOSY <> %savedPosY
{
set %savedPosX #CHARPOSX
set %savedPosY #CHARPOSY
return #false
}
else
return #true
}
I was wondering if you can take a look at my bee harvester macro. It does everything great except one thing. It supposed to put the honey and bee wax in my big bag of holding but will not. it goes into my main backpack which goes over weight. I have attached the script. It used in easyuo
Thx Wildlucy
set %mageKeys X ;put your mage keys ID here, or X to auto-detect at start
set %dropBag X ;put a bag's ID here where stuff will be dropped, or X to select at start
set %waitTime 10 ;default is usually fine on Ex, you can try faster if you want but it might glitch
if %mageKeys = X
{
set %mageKeys N/A
finditem NUI C_ , #BACKPACKID
repeat
{
if #FINDKIND <> -1
{
event property #FINDID
if Spell , #spc , Caster in #property && Keys in #property
set %mageKeys #FINDID
else
{
ignoreitem #FINDID 3
finditem NUI C_ , #BACKPACKID
}
}
}
until %mageKeys <> N/A || #FINDKIND = -1
;keys found or all keys checked and none found
ignoreitem reset 3
if %mageKeys <> N/A
display ok Spell Caster's Keys Found!
else
{
display ok No Spell Caster's Keys Detected.$$You need Spell Caster's Keys in your main pack(for bottles) to use this script. Halting script.
halt
}
}
if %dropBag = X
{
display ok Please target the bag to drop harvested resources into.$$Holding bags work best, but you can also use a regular container on the ground and move it with you as you harvest.
event macro 8 7 ;open backpack
set #TARGCURS 1
set #LTARGETID X
repeat
{
sleep 1
}
until #LTARGETID <> X
set %dropBag #LTARGETID
}
set %targetID X
set %targetType X
set %keysSize 505_475
set %savedPosX 0
set %savedPosY 0
event Macro 8 2 ;open status
display ok Please keep your status window open while running this script (to track weight).
set %lastFound #SCNT
loop1:
gosub CheckStatus
if #result <> #true
{
wait %waitTime
goto loop1
}
gosub LocateHive
if #result <> #true
{
if #SCNT - %lastFound > 10
{
display yesno Are you done harvesting?
if #dispres = yes
{
gosub DropStuff
event SysMessage Halting script.
halt
}
set %lastFound #SCNT
}
goto loop1
}
loop2:
gosub TakeStuff
if #result <> #true
goto loop2
ignoreitem %targetID
goto loop1
sub LocateHive
{
findItem OOD G_2
if #FINDCNT > 0
{
;hive found
set %targetID #FINDID
set %targetType #FINDTYPE
set %lastFound #SCNT
gosub OpenHive
return #true
}
else
return #false
}
sub TakeStuff
{
set %clickLocX #CONTPOSX + 70
set %clickLocY #CONTPOSY + 160
beeswaxloop:
set %jrnl #jindex
scanjournal %jrnl
click %clickLocX %clickLocY DMC
wait %waitTime
repeat
{
if #jindex > %jrnl
{
set %jrnl %jrnl + 1
scanjournal %jrnl
}
else
sleep 1
}
until collect_the_excess_beeswax_and_place_it_in_your_pack in #journal
+ || enough_excess_wax_in_the_hive in #journal
+ || room_in_your_backpack in #journal
+ || need_a_hive_tool_to_scrape in #journal
if need_a_hive_tool_to_scrape in #journal
{
event SysMessage You need more hive tools. Halting Script.
halt
}
if room_in_your_backpack in #journal
{
gosub DropStuff
if #result = #false
{
event SysMessage You need space in your backpack. Halting Script.
halt
}
goto beeswaxloop
}
if enough_excess_wax_in_the_hive in #journal
{
gosub OpenHive
}
honeyloop:
set %clickLocX #CONTPOSX + 215
set %clickLocY #CONTPOSY + 160
set %jrnl #jindex
scanjournal %jrnl
click %clickLocX %clickLocY DMC
wait 5
repeat
{
if #jindex > %jrnl
{
set %jrnl %jrnl + 1
scanjournal %jrnl
}
else
sleep 1
}
until need_a_bottle in #journal || fill_a_bottle_with_golden_honey_and_place_it in #journal || enough_honey_in_the_hive in #journal || need_a_hive_tool_to_extract in #journal
if need_a_hive_tool_to_extract in #journal
{
event SysMessage You need more hive tools. Halting Script.
halt
}
if need_a_bottle in #journal
{
gosub GetBottles
goto honeyloop
}
if enough_honey_in_the_hive in #journal
{
goto endhoneypoint
}
repeat
{
sleep 1
}
until #CONTSIZE = 250_219
goto honeyloop
endhoneypoint:
gosub WaitForGump 250_219 3
click %clickLocX %clickLocY R DMC
set %lastFound #SCNT
return #true
}
sub GetBottles
{
set %weight #WEIGHT
if ( #WEIGHT + 100 ) > #MAXWEIGHT
{
event sysMessage You cannot hold 100 bottles.
gosub DropStuff
set %weight #WEIGHT
if #result = #true && ( #WEIGHT + 100 ) < #MAXWEIGHT
{
;move on
}
else
{
event SysMessage You cannot hold more bottles and have nothing collected to drop. Reduce your pack weight. Script Halted.
halt
}
}
set #LOBJECTID %mageKeys
set #LOBJECTTYPE NUI
event macro 17 0
wait %waitTime
repeat
{
sleep 1
}
until #CONTSIZE = %keysSize
set %clickLocX #CONTPOSX + 290
set %clickLocY #CONTPOSY + 160
set %jrnl #jindex
scanjournal %jrnl
click %clickLocX %clickLocY DMC
repeat
{
if #jindex > %jrnl
{
set %jrnl %jrnl + 1
scanjournal %jrnl
}
else
sleep 1
}
until ( #WEIGHT > %weight && #CONTSIZE = %keysSize ) || do_not_have_any_of_that_resource in #journal
if do_not_have_any_of_that_resource in #journal
{
event SysMessage You need more bottles in your Spellcaster's Keys. Script halted.
halt
}
wait 10
click %clickLocX %clickLocY R DMC
return
}
sub DropStuff
{
event SysMessage Attempting to drop collected stuff...
set %weight #WEIGHT
droploop:
finditem KRD_ETH C_ , #BACKPACKID
if #FINDCNT > 0
{
exevent Drag #FINDID #FINDSTACK
exevent Dropc %dropBag
wait %waitTime
goto droploop
}
if #WEIGHT < %weight
return #true
else
return #false
}
sub OpenHive
{
set #LOBJECTID %targetID
set #LOBJECTTYPE %targetType
event macro 17 0 ;open hive
wait %waitTime
;gosub WaitForGump 258_219 5
;if #result <> #true
repeat
{
sleep 1
}
until #CONTSIZE = 258_219
reopensecond:
set %clickLocX #CONTPOSX + 70
set %clickLocY #CONTPOSY + 60
click %clickLocX %clickLocY DMC
gosub WaitForGump 250_219 4
if #result <> #true
goto reopensecond
return
}
sub WaitForGump ;%1 = contsize to wait for, %2 = waittime(seconds)
{
set %gumpWaiting #SCNT
repeat
{
sleep 1
}
until #CONTSIZE = %1 || #SCNT - %gumpWaiting > %2
if #CONTSIZE = %1
return #true ;gump has appeared
else
return #false ;hasn't shown up in allotted time
}
sub CheckStatus
{
if #CHARPOSX <> %savedPosX || #CHARPOSY <> %savedPosY
{
set %savedPosX #CHARPOSX
set %savedPosY #CHARPOSY
return #false
}
else
return #true
}