Lagging out while drag and dropping was always a big crash cause for me...
So I wrote this sub, which I'm now using in my private miner and my lumber 1.0, to move stuff...
;Usage: gosub neo_dragdrop %itemtomove %bagtomoveto %amount (ex: gosub neo_dragdrop #findid #backpackid #findstack -> will move the whole stack of #findid to your backpack)
;======= drag and drop sub =======
sub neo_dragdrop
namespace push
namespace local neodragdrop
set !item %1
set !bag %2
set !amount %3
set !timeout1 #scnt2 + 10
set !timeout2 #scnt + 6
repeat
event property !bag
until Stones in #property
set !initcnt #property
exevent drag !item !amount
exevent dropc !bag
repeat
repeat
event property !bag
until Stones in #property
set !newcnt #property
until !initcnt <> !newcnt || #scnt >= !timeout2
if !initcnt = !newcnt
{
event macro 9 7
wait 1
nextCPos 776 577 ; change this to where you want the backpack to open
event macro 8 7
gosub gumpwait container_gump N/A #backpackid ; -> change this to your gumpwait sub
wait 15
}
repeat
until #scnt2 >= !timeout1
namespace pop
return
;======= end sub =======
The idea here is using event property on the destination container, so that you can actually check for when the item is in fact moved to that container. If this happens before 1 second, it will wait until that second is up before moving on... If it takes more than 1 second, it will wait until the property changes on the destination container to move on... If this takes more than 6 seconds, it's probably some ghosting/lag issue, and it will reopen your backpack before moving on... This can also be changed to reopen some other container you're getting stuff from, if that's the case for you...
I found this pretty useful to avoid crashes while moving stuff due to lag issues...
Hope people can find this useful too...
cheers
neo