*EDIT* most problems resolved, see debug request threadOkay, got most of my subs working for this. Object is to drop leather in a single stack on ground. If no current stack on ground, create new stack. At 58 K (15 in script for testing), it will cut leather and drop in pack. Once I get that smooth, will put in a BOS sub to send to bank.
Problem right now, the last sub cut_hides wont stop running. I have been putting in some if #finditem < 0 checks, but it is not helping. Could I get some guidance please?
A semi- problem is that it is grabbing leather from corpses and putting it on ground. I like this, but I think it might interefer with looters.
*script inspired by tm_logstoboards and S7's cut large leather stack (
http://www.easyuo.com/forum/viewtopic.php?p=148691#148691)
main code source is EUO wiki.
mainloop
finditem EEG_ C_
{
if #FindKind > 0
gosub scan_hides_onground
if #FindKind < 0
goto mainloop
}
;start subs
;-------------------------------
Sub scan_hides_onground
finditem EEG_ G_
{
if #findstack > 14
gosub cut_hides
if #findkind > 0
gosub Drop_hides_in_stack
if #findkind < 0
gosub Drop_hides_new_pile
}
;-------------------------------
Sub Drop_hides_in_stack
findid EEG_ G_
if #findkind < 0
gosub Drop_hides_new_pile
wait 5
ExEvent Drag #findid #findstack
wait 10
ExEvent Dropc !Hides_on_ground !number_on_ground
;-------------------------------
Sub Drop_hides_new_pile
Set %Xpos ( #CharposX - 1 )
Set %Ypos ( #CharPosY - 1 )
finditem EEG_ C_
if #FINDkind > 0
wait3
ExEvent Drag #findid #findstack
wait 10
ExEvent Dropg %Xpos %Ypos
wait 10
;-------------------------------
Sub cut_hides
Finditem KAG_
if #findkind < 0
halt
Set %scissors #FINDID
finditem EEG_ G_
if #findkind < 0
go mainloop
set !Hides_on_ground #findID
set !number_on_ground #findstack
Set #lobjectID %scissors
Set #ltargetID !Hides_on_ground
event macro 17 0
target 5s
wait 15
exevent drag !Hides_on_ground !number_on_ground
wait 15
event macro 22 0
wait 15
exevent dropc #BACKPACKID
wait 10
go mainloop