Author Topic: Dropping items on the ground  (Read 4684 times)

0 Members and 1 Guest are viewing this topic.

Offline NObamaTopic starter

  • Everything I need to know, I learned from Miffy's Item Finder.
  • Elite
  • *
  • *
  • Posts: 3454
  • Activity:
    0%
  • Reputation Power: 43
  • NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.
  • Respect: +161
  • Referrals: 2
    • View Profile
Dropping items on the ground
« on: January 13, 2010, 08:12:50 PM »
0
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.

Code: [Select]
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.

 :)

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13304
  • Activity:
    0.6%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Dropping items on the ground
« Reply #1 on: January 13, 2010, 08:23:04 PM »
0
There's a problem dropping items at your feet on OSI.  Works fine on RunUO.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline UOMaddog

  • Maddog
  • Elite
  • *
  • *
  • Posts: 1625
  • Activity:
    0%
  • Reputation Power: 22
  • UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...
  • Gender: Male
  • Biggest B@D@$$ of the Universe
  • Respect: +165
  • Referrals: 8
    • View Profile
    • Insane UO
Re: Dropping items on the ground
« Reply #2 on: January 13, 2010, 09:23:38 PM »
0
Yea, just offset x or y by 1 and you'll be fine! (as long as you're not standing in a corner!  :P )
There are 10 kinds of people in this world: those that understand binary and those that don't!

Windows:  A 64-bit tweak of a 32-bit extension to a 16-bit user interface for an 8-bit operating system based on a 4-bit architecture from a 2-bit company that can't stand 1 bit of competition!

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Dropping items on the ground
« Reply #3 on: January 15, 2010, 08:55:08 AM »
0
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


Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline _C2_

  • AFK FtW
  • Global Moderator
  • *
  • *
  • Posts: 4077
  • Activity:
    0%
  • Reputation Power: 48
  • _C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!
  • RIP Pen Trick
  • Respect: +254
  • Referrals: 4
    • View Profile
Re: Dropping items on the ground
« Reply #4 on: January 15, 2010, 09:43:52 AM »
0
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.

Offline NObamaTopic starter

  • Everything I need to know, I learned from Miffy's Item Finder.
  • Elite
  • *
  • *
  • Posts: 3454
  • Activity:
    0%
  • Reputation Power: 43
  • NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.
  • Respect: +161
  • Referrals: 2
    • View Profile
Re: Dropping items on the ground
« Reply #5 on: January 15, 2010, 03:45:58 PM »
0
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. 

 :)

Offline _C2_

  • AFK FtW
  • Global Moderator
  • *
  • *
  • Posts: 4077
  • Activity:
    0%
  • Reputation Power: 48
  • _C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!
  • RIP Pen Trick
  • Respect: +254
  • Referrals: 4
    • View Profile
Re: Dropping items on the ground
« Reply #6 on: January 15, 2010, 04:06:19 PM »
0
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

Code: [Select]
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


Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Dropping items on the ground
« Reply #7 on: January 15, 2010, 07:43:01 PM »
0
Totally forgot i gave you that code c2 lol.. nice
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline Khameleon

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: Dropping items on the ground
« Reply #8 on: January 15, 2010, 08:28:45 PM »
0
I had a sub that used to drop crap off the side of your boat... I dunno where it is anymore.

Offline NObamaTopic starter

  • Everything I need to know, I learned from Miffy's Item Finder.
  • Elite
  • *
  • *
  • Posts: 3454
  • Activity:
    0%
  • Reputation Power: 43
  • NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.
  • Respect: +161
  • Referrals: 2
    • View Profile
Re: Dropping items on the ground
« Reply #9 on: January 16, 2010, 02:58:47 AM »
0
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
« Last Edit: January 16, 2010, 03:30:09 AM by NObama »

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Dropping items on the ground
« Reply #10 on: January 16, 2010, 06:36:40 AM »
0
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
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline NObamaTopic starter

  • Everything I need to know, I learned from Miffy's Item Finder.
  • Elite
  • *
  • *
  • Posts: 3454
  • Activity:
    0%
  • Reputation Power: 43
  • NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.
  • Respect: +161
  • Referrals: 2
    • View Profile
Re: Dropping items on the ground
« Reply #11 on: January 16, 2010, 11:21:37 AM »
0
Thanks EN!  I'll review that to improve my own code.  I went with:

Code: [Select]
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...

 :)

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Dropping items on the ground
« Reply #12 on: January 16, 2010, 01:02:13 PM »
0
yup .. that looks like a jacked version of my stlye.. lol :)
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Tags: