We used your code to delete artifacts from equipped slots. I used my script for deleting all artifacts from hero x backpack and transfer them all to hero y. As it worked okay, we didn't check if your function is necessary also for backpack, but after testing several games, I get sometimes message "backpack full" (only when trying to discard an equipped artifact) while is not. But I don't know what causes it and can't reproduce the error.
Last part of the script (deleting adding artis):
!?FU338340;
;left-->right
!!SN:W^RightHeroGlobalStorage^/?y1;
!!IF&y1=64:M^%Z3'backpack is full!^;
!!VRx16&y1=64:S999; [end loop if backpack full]
!!FU&y1=64:E;
!!HEx1:A1/?y2/x16;
!!FU&y2<0:E; [exit if no artifact]
!!VRy1:+1; [increment backpack storage]
!!HEx1:A3/y2/1/0; [remove artifact from backpack]
!!HEx2:Ay2; [give to the other hero]
!!SN:W^RightHeroGlobalStorage^/y1; [set new storage for right hero]
!?FU338341;
;right-->left
!!SN:W^LeftHeroGlobalStorage^/?y1;
!!IF&y1=64:M^%Z2'backpack is full!^;
!!VRx16&y1=64:S999; [end loop if backpack full]
!!FU&y1=64:E;
!!HEx1:A1/?y2/x16;
!!FU&y2<0:E; [exit if no artifact]
!!VRy1:+1; [increment backpack storage]
!!HEx1:A3/y2/1/0; [remove artifact from backpack]
!!HEx2:Ay2; [give to the other hero]
!!SN:W^LeftHeroGlobalStorage^/y1; [set new storage for left hero]
(This post was last modified: 31.03.2015 00:56 by Valery.)