First off congratulations on a great script. Here are some improvements i would like to see in order to get this lovely peice of work into the official script library. Please dont take any offense by below rather take it as a learning experience.
(1) you have subs without returns subs setup, bookscan <-- not sure why no returns on these sub perhaps an oversight
(2) A clean exit from the script. Your script halts in the middle of the sub GetBODScore. I would recommend you create a Var for example called %ExitScript, set it to false... and instead of halting in the middle of the sub have the code return to the main loop and exit thier. Such modifications as below would achieve this.
if #scnt > %findtimeout
{
set %exitscript #true ; display No more BODs to sort
return ; halt
}
and modify you base repeat loop to exit
set %exitscript #false
repeat
gosub DropBod
gosub GetBodScore
if ! %exitscript
{
gosub EvalDrop
gosub DropToBook
}
until %Exitscript = #true
halt
(3) Property Scan: your property sometimes fails I would recommend you take the finditem out of the property loop. As and add a secondary loop that waits such as below...
finditem EYM c_ , #backpackid
set %findtimeout #scnt + 10
repeat
event property #findid
set %Proptimeout #scnt + 2
repeat
wait 1
until weight in #property || #scnt > %proptimeout
until weight in #property || #scnt > %findtimeout
(4) Code Indentation: You may wish to consider Indenting your code; it makes it far easier to read and maintian and catch errors such as missing returns... standardly you indent x spaces for every block (for me x=2), ie this is easier to read than that
thjis
sub justdoit
while w > p
{
repeat
if x =a
for y = 1 20
set z z + 20
until q < r
}
return
that
sub justdoit
while w > p
{
repeat
if x =a
for y = 1 20
set z z + 20
until q < r
}
return
(5) CLoth Bods : i did a simple mod to make it support cloth bods, you might wish to consider something like this as well... as its not appropriate my odd cloth bods end up in never fill (each 2 line bit goes into diff section)
if Cloth in #property
set %Cloth #findid
if cloth in #property
set %score %score + 1000000
if %score >= 1000000
set %DropBook %Cloth
Once again congratualtions on the script submission
