What's new

Question: script to split logs into groups of 50?

FadeXF

Neophyte
Hello all...

I have been trying to piece together someone's script surrounding splitting reagents and recall scrolls located here:


I am looking for the simplest way to split logs in to stacks of 50 any time the log count is greater than 100 - just to stack them back into my backpack.

This script above does work when I adjusted it however it seems to do about 4-5 different checks in it and really bogs it out.

In truth I don't quite understand the logic used and why I can't just simplify is like "If log count > 100 then split logs in to 50"

I know that the Razer ID for "logs" is 7133. Thanks in advance to anyone who can pitch their 2 cents. (This is just to deter at least SOME thieving attempts.)


@setvar! regsID 7133
@setvar! myCounter 0

while findtype regsID self as r
@setvar! myCounter index
@ignore r
endwhile
@clearignore

if counttype regsID self <= 100
@setvar! amount 50
overhead "OVER 100" 33
wait 500
endif

while findtype regsID self as regs
@setvar! moveRegs 0

if myCounter = 0
@setvar! moveRegs 1
elseif myCounter != 0 and not find regs myBag
@setvar! moveRegs 1
endif

if moveRegs = 1
if index = 0
lift regs amount
drop myBag 44 88 0
else
lift regs amount
drop myBag 142 88 0
endif
endif

@ignore regs

if moveRegs = 1
wait 500
endif

endwhile
 
**I was trying to locate if I can identify where the breaks are which is why I have the "OVER 100" in this version - am still working on this even right now - if I figure it out I'll also repost in this thread if it's helpful for others.
 
if findtype 7133 self as regs
while findtype 7133 backpack as regs
overhead "Moving logs" 88
lift regs 50
drop myBag 50 65 0
wait 200
endwhile
endif



**This does start by pulling 50 but then it endless loops
 
Ok I think there won't be a way for me to incorporate it into the main script I want to use. So I've settled on the first one as a second script on a different button which I'll just press every 200 or so.

I was hoping for a simplified version I can loop - but I think that is too complex because the problem is that it is always > 100 - so I think I'd have to figure out a way to use counters and complex logic like "> 100 AND > 200" sort of things as opposed to something simple like "every 100 logs, split them" - oh well!
 
Ok I think there won't be a way for me to incorporate it into the main script I want to use. So I've settled on the first one as a second script on a different button which I'll just press every 200 or so.

I was hoping for a simplified version I can loop - but I think that is too complex because the problem is that it is always > 100 - so I think I'd have to figure out a way to use counters and complex logic like "> 100 AND > 200" sort of things as opposed to something simple like "every 100 logs, split them" - oh well!
@setvar regsID 7133
@setvar amount 50
@setvar myBag #BACKPACKID ; Replace #BACKPACKID with your actual backpack ID if needed.

while counttype regsID self > 100
if findtype regsID self
lift regsID amount
drop myBag
wait 500
endif
endwhile

Try this