ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: NObama on January 13, 2010, 08:12:50 PM
-
Okay - this should be much simpler than I'm making it.
Essentially, I am crafting a snippet that, when called, will scan my pack for items and drop them next to me.
sub drop_stuff
set !dropitems POF_
finditem !dropitems C_
if #findkind <> -1
{
exevent drag #findid #findstack
wait 13
exevent dropg #CHARPOSX #CHARPOSY #CHARPOSZ
wait 13
}
That look right to you? I can't field test, as I'm not in a place where I can access UO. Can I drop stuff on the ground underneath my char, or do I need to offset the x y z coords a tad?
Thoughts? Usually, I'm putting stuff *in* my back, not chucking it on the ground...so I'm new to dropg.
:)
-
There's a problem dropping items at your feet on OSI. Works fine on RunUO.
-
Yea, just offset x or y by 1 and you'll be fine! (as long as you're not standing in a corner! :P )
-
I wrote a sub someplace that wraps the drop routine in a loop that increments where the item is dropped .. bascially it iterates through the 8 tiles around you attempting to drop item.
If i rember right you might want to leave the z option off as you dont know what the z axis is for the tile -1 -1 or +1 +1 from your location
-
I wrote a sub someplace that wraps the drop routine in a loop that increments where the item is dropped .. bascially it iterates through the 8 tiles around you attempting to drop item.
If i rember right you might want to leave the z option off as you dont know what the z axis is for the tile -1 -1 or +1 +1 from your location
I have that sub in my farming script. I can dig it out and post it here later.
-
Awesome - thanks, C2! Since I didn't see any "umm - you screwed up in line X" I presume I'm at least close to viable code.
:)
-
here is endless fine piece of work that continues to find diff spots until gets a viable drop spot. It is for initial droppping not stacking onto existing piles.
You need to fill these in or assign them values when u do the gosub:
%itemid %BagFrom %DropRadius
Sub DropOnGround ; %itemid %BagFrom %DropRadius
set %Item %1
IF %0 <= 1
set %2
set %BagFrom %2
IF %0 <= 2
set %3 2
set %DropRadius %3
Set %XPos ( #CharPosX - %DropRadius )
Set %YPos ( #CharPosY - %DropRadius )
Set %DropExit #False
Repeat
wait 10
FindItem %item C_ , %BagFrom
wait 3
If #FindKind = -1
Set %DropExit #True
IF %DropExit = #False
{
;event ExMsg #charID 3 0 trying %xpos %ypos
ExEvent Drag #findid #Findstack
Wait 12
ExEvent DropG %Xpos %YPos
; Increment Position
Set %XPos ( %XPos + 1 )
If %Xpos > ( #CharPosX + %DropRadius )
{
Set %YPos ( %YPos + 1 )
Set %XPos ( #CharPosX - %DropRadius )
}
}
Until %DropExit || %YPos > ( #CharPosY + %DropRadius )
Return %DropExit
-
Totally forgot i gave you that code c2 lol.. nice
-
I had a sub that used to drop crap off the side of your boat... I dunno where it is anymore.
-
ENs code is perfect for my needs (isn't it always?). Fantastic fellows, thanks!
:)
Next step...a sub to find it and pick it back up again....muahahahaha
-
ENs code is perfect for my needs (isn't it always?). Fantastic fellows, thanks!
:)
Next step...a sub to find it and pick it back up again....muahahahaha
see...
http://www.scriptuo.com/index.php?topic=2454.msg33512#msg33512
-
Thanks EN! I'll review that to improve my own code. I went with:
sub FindStuff
set #result #false
finditem POF_JJG_ G_7
If #Findcnt > 0
{
set !exit 15
Repeat
finditem POF_JJG_ G_7
Event Pathfind #findx #findy #findz ; the stuff
wait 1s
set !exit !exit -1
finditem POF_JJG_ G_2
if #findstack > 0
{
exevent drag #findid #findstack
wait 13
exevent dropc #backpackid
wait 13
return
}
Until !exit < 1 || #findcnt > 0
set #result #findcnt > 0
}
Return #Result
You'll probably recognize it as a derivation of some code you helped me write for Ant Farm. It's very kludgey the way I've used it here, because if there is more than one pile of something, it only grabs the first one...
:)
-
yup .. that looks like a jacked version of my stlye.. lol :)