ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: Coragin on January 15, 2010, 07:55:41 AM

Title: Script request from C2, EN, Twinkle McNugget, EN someone please.
Post by: Coragin on January 15, 2010, 07:55:41 AM
Im not great with all parts of scripting and I need a simple script since hort isint doing it properly.

Find a plant on the ground, if "Decorative" is in the property, unlock it and move it to a secure.  Thats it.  Can you guys help me?  :)  I am assuming this is simple for you guys.

One thing is, I have more than 125 plants, so as soon as it says "that container cannot hold anymore items" have it either stop or request a new container.

Dont need to worry about plant id types, I can add those.

Code: [Select]
set %plant OLI_BCF_VWE_BWE_UAF_JWE_IWE_EXE_UWE_ICF_BXE_YVE_CCF_NWE_MWE_DXE_TCF_NXE_BKP_ZJP_MKP_AKP_CKP_OKP_NKP_LKP_TXE_ZBF_AIF_GWE_VWE_WTE_ZBF_BWE_BCF_CCF_SVE_IWE_MWE_YVE_REK_QVE_BFK_WTE_FWE_NXE_CYE_JDF_
Title: Re: Script request from C2, EN, Twinkle McNugget, EN someone please.
Post by: _C2_ on January 15, 2010, 08:02:59 AM
i fthe plants are one stone each the trash barrel with auto empty if they weigh more than one stone each, it never gets full enough to self empty and causes issues.

it is an easy snip it to write but I am maxed out at work, even on the weekends for the coming week and a half.
Title: Re: Script request from C2, EN, Twinkle McNugget, EN someone please.
Post by: Scrripty on January 15, 2010, 08:08:32 AM
Code: [Select]
FINDITEM %plant G_2
Then do a findindex/event property on them all to see which ones have "decorative" in the name?  I'm just guessing that's the way to go.  Assuming you're standing in the same spot doing all this... Are they on the ground?  In packs?  Locked down?  Not locked down?  I think more info is needed... :)  Within 2 tiles... farther than 2 tiles?  Do you need to do all the ones within 2 tiles then search for more and walk to them within say a 1-10 tile radius? :)
Title: Re: Script request from C2, EN, Twinkle McNugget, EN someone please.
Post by: Endless Night on January 15, 2010, 08:15:03 AM
Well it maybe easy but its still time consuming...  .. every thing is below except the container full message.

(the unlocking might not be the right event macro code if its not 22 0 then its 17 0 )

all code 100% untested off top of my head may contain minor syntax or other errors

Code: [Select]
set %MySecureID ABCXYZ   ; Setit

set %plantTypes OLI_BCF_VWE_BWE_UAF_JWE_IWE_EXE_UWE_ICF_BXE_YVE_CCF_NWE_MWE_DXE_TCF_NXE_BKP_ZJP_MKP_AKP_CKP_OKP_NKP_LKP_TXE_ZBF_AIF_GWE_VWE_WTE_ZBF_BWE_BCF_CCF_SVE_IWE_MWE_YVE_REK_QVE_BFK_WTE_FWE_NXE_CYE_JDF_

Finditem %Planttypes g_2
If #findcnt > 0
  {
  For #findindex 1 #findcnt
     {
      event property #findid
      wait 5   ; wiat for property to be set
      if  Decorative in #property
             {
              msg i wish to unlock this $
              wait 10
              set #ltargetid #findid
              event macro 22 0
              wait 5
             exevent drag #findid
             exevent drop %Mysecureid
             wait 20
              }
     }
  }

Note: only searches in a radius of 2 squares as thats all you can drag from i thinnk.. if you want a bigger radius set g_2 to g_?? whatevver
Title: Re: Script request from C2, EN, Twinkle McNugget, EN someone please.
Post by: Scrripty on January 15, 2010, 08:23:12 AM
Sheesh.  Leave it to that EN guy to oversimplify things.  :)
Title: Re: Script request from C2, EN, Twinkle McNugget, EN someone please.
Post by: Endless Night on January 15, 2010, 08:40:12 AM
Sheesh.  Leave it to that EN guy to oversimplify things.  :)

Lol .. just rember   Kiss kiss  (keep it simple stupid)
Title: Re: Script request from C2, EN, Twinkle McNugget, EN someone please.
Post by: Scrripty on January 15, 2010, 08:43:53 AM
Sheesh.  Leave it to that EN guy to oversimplify things.  :)

Lol .. just rember   Kiss kiss  (keep it simple stupid)

2 tiles is all you can move items from, but you could do ANOTHER search after that in say a 3 - 4 tile radius, and walk to it if anything was found, then do that all over again as a sub... then walk BACK to dropoff pack... :)
Title: Re: Script request from C2, EN, Twinkle McNugget, EN someone please.
Post by: Endless Night on January 15, 2010, 08:46:43 AM
Sheesh.  Leave it to that EN guy to oversimplify things.  :)

Lol .. just rember   Kiss kiss  (keep it simple stupid)

2 tiles is all you can move items from, but you could do ANOTHER search after that in say a 3 - 4 tile radius, and walk to it if anything was found, then do that all over again as a sub... then walk BACK to dropoff pack... :)

Yea you could do a search that filtered everything on the same z axes as you .. then a generic moveto sub and instruct it to move to each and every plant and back to secure.. but got to leave something for cor
Title: Re: Script request from C2, EN, Twinkle McNugget, EN someone please.
Post by: Scrripty on January 15, 2010, 08:51:50 AM
Or start it within reach of the pack, and have it go until it can't find anything else that matches your search criteria, THEN have it start moving in a generic fashion to each found item and moving back to pack.  So it's a little faster on the initial search and grab drop portion. :)  Then just make SURE you're within 2 tiles of the pack and as many plants as possible.  I like to flesh out ideas before I write them.  EN just starts shooting out script like a font designer. heh
Title: Re: Script request from C2, EN, Twinkle McNugget, EN someone please.
Post by: Endless Night on January 15, 2010, 08:58:54 AM
its like a carpenter friend of mine once said to me ...   when faced with a difficult angle you could get the protractor out and start caluclating all the exact angles to make each cut .. or you could just start cutting the wood... 9 times out of 10 by the time you or I actually calculate the precise angle of the cut hes already finished via trail and error.

So when faced with a simple coding task i just jump in with generic code and mod it via trail and error as i go.. 9x out of 10 for me its faster than thinking it though and planning it out.

Title: Re: Script request from C2, EN, Twinkle McNugget, EN someone please.
Post by: Coragin on January 15, 2010, 09:07:01 AM
thanks guys I wanted to be able to save them to turn them into plant clippings for dyes :)