Bee harvester to Alamiester
Bee harvester to Alamiester
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
}
- Alamiester
- Legendary Scribe
- Posts: 279
- Joined: Wed Jan 04, 2017 8:49 pm
Re: Bee harvester to Alamiester
someone correct me if im wrong but i believe if you changed this line to:
set %dropBag KHB ;put a bag's ID here where stuff will be dropped, or X to select at start
set %dropBag KHB ;put a bag's ID here where stuff will be dropped, or X to select at start
Re: Bee harvester to Alamiester
I didn't look at the whole code but one thing I think I see is no wait between the drag and the drop. Which could be messing it up.
Code: Select all
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
wait %waitTime ; needs a wait from the drag im pretty sure.
exevent Dropc %dropBag
wait %waitTime
goto droploop
}
if #WEIGHT < %weight
return #true
else
return #false
}
Re: Bee harvester to Alamiester
Alamiester wrote:someone correct me if im wrong but i believe if you changed this line to:
set %dropBag KHB ;put a bag's ID here where stuff will be dropped, or X to select at start
Code: Select all
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
}
Re: Bee harvester to Alamiester
Code: Select all
if room_in_your_backpack in #journal
{
gosub DropStuff
if #result = #false
{
event SysMessage You need space in your backpack. Halting Script.
halt
}
- Alamiester
- Legendary Scribe
- Posts: 279
- Joined: Wed Jan 04, 2017 8:49 pm
Re: Bee harvester to Alamiester
so the missing pause was the reason it wouldnt drop stuff into X bag. iven if the item id was added it wont work? i currently dont have my hives setup so i cant test this. i probly wont restart them for a few months. i will def be trying this out when i get them up. so this would be the code after the wait time is added.
Code: Select all
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
wait %waitTime ; needs a wait from the drag im pretty sure.
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
}
- Alamiester
- Legendary Scribe
- Posts: 279
- Joined: Wed Jan 04, 2017 8:49 pm
Re: Bee harvester to Alamiester
so what are these find items its moving, honey, and wax? KRD_ETH C_ or is one of these bottles too, if weight is an issue shouldnt the bottles be moved to the hboh also?Stephen wrote:I didn't look at the whole code but one thing I think I see is no wait between the drag and the drop. Which could be messing it up.
Code: Select all
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 wait %waitTime ; needs a wait from the drag im pretty sure. exevent Dropc %dropBag wait %waitTime goto droploop } if #WEIGHT < %weight return #true else return #false }
Re: Bee harvester to Alamiester
I tested the routine though so it should work even without the save. I think its how and when it is checking it, It doesn't move it every time, it only does it at certain points and uses journal scan to check. I guess maybe adding a sub in another place to check to do it more often would help.
Add: 100 Bottles should only cost 100 weight since they are 1 stone per. And you need bottles to transfer for the honey. So that would not be useful at all to remove bottles when u need them.
Add: 100 Bottles should only cost 100 weight since they are 1 stone per. And you need bottles to transfer for the honey. So that would not be useful at all to remove bottles when u need them.
Re: Bee harvester to Alamiester
0.2, not 1.100 Bottles should only cost 100 weight since they are 1 stone per.
Re: Bee harvester to Alamiester
Good to note. I only tested with 1 bottle in a bag lol but that makes even less to move em.
Re: Bee harvester to Alamiester
I can't test since i don't have bees to use to test it on.
Can you try this and see if it works? I think it just only tries to move stuff if u are done harvesting, or if u cannot hold anymore items and the journal scan catches it.
Try adding this
after the
and before the
on line 118 so hit enter after %waitTime and then add that code in.
Just to test if maybe that is why its not moving it.
Can you try this and see if it works? I think it just only tries to move stuff if u are done harvesting, or if u cannot hold anymore items and the journal scan catches it.
Try adding this
Code: Select all
gosub DropStuff
if #result = #false
{
event SysMessage You need space in your backpack. Halting Script.
halt
}
Code: Select all
wait %waitTime
Code: Select all
repeat
Just to test if maybe that is why its not moving it.
Re: Bee harvester to Alamiester
here i added it in so you can test. just make a new script with this and see if it works. It should as it looks like it's never using a journal scan for overweight just over items.
Code: Select all
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
if #WEIGHT > 350
{
gosub DropStuff
}
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
if #WEIGHT > 350
{
gosub DropStuff
}
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
}
- Alamiester
- Legendary Scribe
- Posts: 279
- Joined: Wed Jan 04, 2017 8:49 pm
Re: Bee harvester to Alamiester
maybe wildlucy can can test it. i try it but mine are empty and it just stops and says use an axe on that beehive to redeed it.
Re: Bee harvester to Alamiester
I already got her working for what she needed via pms.
- Alamiester
- Legendary Scribe
- Posts: 279
- Joined: Wed Jan 04, 2017 8:49 pm
Re: Bee harvester to Alamiester
nice, so if you put in the item id for bag of holding would it still ask you for it everytime? i need to start dabling in easyuo. it all looks so unorganized to me though. is there a way to make it look pretty like uosteam macros, lol