ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: crameep on March 28, 2009, 02:08:35 PM
-
Hey, cant seem to find it need new eyes. Thanks in advance.
sub findcorpse
finditem YFM G_15
if #findkind = -1
{
move %startposx %startposy 0 5s
goto mainloop
}
set %body #findid
if #findx > %startposx + 15 || #findy > %startposy + 15
{
goto mainloop
}
set wait 10 + %lags Looting
gosub updatestatus
move #findX #findy 0 10s
set #lobjectid %body
nextCPos 10 10
wait 10 + %lag
event macro 17 0
wait 1s
set %nt2 #scnt2 + 10
set %bod #contID
_OQ:
finditem %loot C_ . #contID
if #findkind = -1 && %nt2 < #scnt2
goto _OQ
wait 13
set %bod #contid
_findloot:
finditem %loot C_ . %bod
if #findkind = -1 || #findbagid = #charid || #findbagid = #backpackid
{
event SysMessage finished Corpse.
ignoreitem %body
wait 15
move %startposx %startposy 0 5s
goto mainloop
}
if #weight > #maxweight - 100
{
set !amount ( #maxweight - #weight ) * 50
if !amount > #findstack
set !amount #findstack
}
else
set !amount #findstack
exevent drag #findid !amount
exevent dropc #charid
wait 1s
gosub sendgold
goto _findloot
return
-
Can't tell from this snippet, not enough code. Looks fine from the syntax editor. But do you notice that you are "goto"ing out of your subroutine? That's bad medicine.
-
Ya, thats a big no, no.. I believe its sucks your resources also.
-
Better to handle the Goto's with Return's. I'm unclear as to what you are trying to accomplish here though with your point in the thread title, are trying to NOT use return for some reason?
XII
-
Just a quick question what is the max number of tiles you can scan? I see the G_15 so I guess that means 15 tiles what is the practical limit 20 25?
-
In practice, the longest distance I've gotten to is 18.
-
I think I was 'cuttin bones' around 15 reliably. Maybe it was 12, don't remember.
-
Replace all
goto mainloop
With
RETURN
As far reliable tile scanning 18 is my vote.. but i belive the amount of tile radius loaded is a setting someplace in UO isnt it ?
-
Yeah, I guess I wasn't thinking about goto & returns. No particular reason for it just .. too much time in the code I guess. Woops.
-
(http://img29.exs.cx/img29/7232/stallowned5mg.jpg)
-
Oh man, that's a hideous picture....
-
Yeah, i'll second that one, horrible picture.