ScriptUO

Official ScriptUO EasyUO Scripts => Site Scripter Libraries => Endless Nights' Script Library => Topic started by: Endless Night on May 01, 2009, 06:12:32 PM

Title: ENs - Rose Of Trinsic Petal Picker
Post by: Endless Night on May 01, 2009, 06:12:32 PM
Rose Of Trinsic Petal Picker
Picks ALL Rose of Trinisc Petals for plants within 3 tiles of yourself.
Warning: No Error checking for lack of permission to pick in others houses.


With all these heritage tokens floating around these days I find myself with a whole bunch of Rose Of Trinsic Plants.  Picking those petals is a real pain.  So even thow this script is very short others might find it helpfull.

Code: [Select]
;===========================================
; Script Name: Rose Of Trinsic Petal Picker
; Author: JosephAJ
; Version: V1.0
; Client Tested with: 5.0.??
; EUO version tested with: 1.5 (TV102)
; Shard OSI / FS: OSI
; Revision Date: 1.17.07
; Public Release: 1/17/07
; Purpose: Picks ALL Rose Of Trinsic Petals
;          within 3 tiles of character.
; Requirments: None
;===========================================
; (C) 2007 All Rights Reserved JosephAJ
;===========================================

FindItem FHN G_3
set %Petals 0
If #findCnt > 0
  {
  set #findindex 0
  Repeat
     Set #Findindex #Findindex + 1
     Gosub PickPetal #Findid
  Until #Findindex = #Findcnt
  }
Display ok Collected %Petals Petals
Halt

Sub PickPetal %1
 set #lObjectID %1
 Event Property %1
 str Right #Property 3
 str left #strres 2
 If #Strres < 0
   Set #Strres 0
 event ExMsg #charID 3 0 #findindex , /
    + #findcnt , : #Strres Petals
 Set %Petals %Petals + #Strres
 If #Strres > 0
   For %count 1 #Strres
     {
      event Macro 17 0  ; 5
      wait 20
     }
Return

For a version that moves to the next closest petal see heree http://www.scriptuo.com/index.php?topic=1511.msg85615#msg85615
To mod to work with containors see http://www.scriptuo.com/index.php?topic=1511.msg80164#msg80164

Usage:
  You are free to use this script for not for profit personal UO gameplay.
You are *not* free to modify and repost or post on other places
or post as part of a script or work you yourself have created
or otherwise distribute without written permision from the author.
This license to use can be changed at any time for any reason.
If in doubt dont do it contact the author.

(C) 2007 All Rights Reserved JosephAJ
Commercial usage requires written permission from the author


NOTE: My scripts or any derivative of them are *not* for use in other players script/s!  
Title: Re: ENs - Rose Of Trinsic Petal Picker
Post by: Wilk on September 29, 2009, 04:42:30 PM
Still works with SA.

Because I "know" you really wanted to know!
Title: Re: ENs - Rose Of Trinsic Petal Picker
Post by: Endless Night on September 29, 2009, 06:42:20 PM
Boy this script is as old as the hills .. glad it still works thow.
Title: Re: ENs - Rose Of Trinsic Petal Picker
Post by: TrailMyx on September 29, 2009, 06:42:56 PM
Isn't this one your EUO reject?  lol
Title: Re: ENs - Rose Of Trinsic Petal Picker
Post by: Endless Night on December 05, 2009, 05:54:30 PM
Isn't this one your EUO reject?  lol

Yea Tm it was lol....   dam how did you know that.
Title: Re: ENs - Rose Of Trinsic Petal Picker
Post by: rana70 on December 05, 2009, 06:55:30 PM
Isn't this one your EUO reject?  lol

I had the same problem with my HHT Home Harvester Script,
it was too buggy  ;) because I did not use {} within a Repeat / Until Loop.

I guess they just don't like Harvester scripts :-)
cu
Title: Re: ENs - Rose Of Trinsic Petal Picker
Post by: Cerveza on September 13, 2010, 09:22:18 AM
Wonder if this would work for doing Enhanced Bandages from a Fountain of Life? Just put a drag/drop after opening the fountain...
Title: Re: ENs - Rose Of Trinsic Petal Picker
Post by: Endless Night on September 13, 2010, 09:47:17 AM
Wonder if this would work for doing Enhanced Bandages from a Fountain of Life? Just put a drag/drop after opening the fountain...

I dont see why it couldnt... this was one of my original starting scripts... look how simple it was...   Do what you want with it Cerveza
Title: Re: ENs - Rose Of Trinsic Petal Picker
Post by: Cerveza on September 13, 2010, 09:50:28 AM
Cool, I'll play a bit. I was trying to make a script to find fountains, open them, drag/drop enhanced bandages to a secure, then ignore the fountain and try again.

For some reason it just kept opening the secure instead of the fountains. Even after I removed any reference to it LOL.
Title: Re: ENs - Rose Of Trinsic Petal Picker
Post by: Tommy Boy on February 03, 2012, 12:32:58 PM
This still works.  Is it ok if I try to make it work to pick petals from a container?
Title: Re: ENs - Rose Of Trinsic Petal Picker
Post by: Endless Night on February 04, 2012, 07:52:13 PM
This still works.  Is it ok if I try to make it work to pick petals from a container?

just change this line

Code: [Select]
FindItem FHN G_3
for

Code: [Select]
FindItem FHN C
and open all your contains before starting.
Title: Re: ENs - Rose Of Trinsic Petal Picker
Post by: Tommy Boy on February 04, 2012, 08:13:04 PM
Right on.  Thanks.
Title: Re: ENs - Rose Of Trinsic Petal Picker
Post by: Endless Night on August 15, 2012, 07:04:36 PM
The long awaited update 5 or so years in the making...

It now moves to the next nearest petal.... yeeeeee haaaaa.

Code: [Select]
;===========================================
; Script Name: Rose Of Trinsic Petal Picker
; Author: JosephAJ
; Version: V1.0
; Client Tested with: 5.0.??
; EUO version tested with: 1.5 (TV102)
; Shard OSI / FS: OSI
; Revision Date: 8/15/2012
; Public Release: 1/17/07 , 8/15/2012
; Purpose: Picks ALL Rose Of Trinsic Petals
;          within 3 tiles of character.
; Requirments: None
;===========================================
; (C) 2007 All Rights Reserved JosephAJ
;===========================================

ignoreitem reset
set %Petals 0

repeat
  FindItem FHN G_2
  If #findCnt > 0
    {
    set #findindex 0
    repeat
      Set #Findindex #Findindex + 1
      Gosub PickPetal #Findid
      ignoreitem #findid ; dont pick it again
    Until #Findindex = #Findcnt
    }
 FindItem FHN G
 gosub movetoclosest
until #findcnt = 0
Display ok Collected %Petals Petals
Halt

Sub PickPetal %1
 set #lObjectID %1
 Event Property %1
 str Right #Property 3
 str left #strres 2
 If #Strres < 0
   Set #Strres 0
 event ExMsg #charID 3 0 #findindex , /
    + #findcnt , : #Strres Petals
 Set %Petals %Petals + #Strres
 If #Strres > 0
   For %count 1 #Strres
     {
      event Macro 17 0  ; 5
      wait 20
     }
Return

sub movetoclosest
  set #lpc 9000
  set !x N/A
  set !dist 100000
  for #findindex 1 #findcnt
    {
    if #finddist < !dist
      {
      set !dist #finddist
      set !x #findindex
      }
    }
  if !x <> N/A
   {
   set #findindex !x
   goSub ENs_MoveTo #findx #findy #findz 1 4
   wait 10
   }
   set #lpc 10
return

Sub ENs_MoveTo ; x y z Tolerance Timeout
  set !MoveTox %1
  set !MoveToy %2
  set !MoveToz %3
  set !Tolerance %4
  if %0 < 4
    set !Tolerance 1
  set %timeout #scnt + 15
  if %0 >= 5
    set %timeout #Scnt + %5
  if !MoveToz >= #charposz - 30 && !MoveToz <= #Charposz + 30
    {
    repeat
      set !MovetoStartJournal #jindex
      event pathfind !MoveTox !MoveToy !MoveToz
      wait 5
      Gosub CheckJournalfor !MovetoStartJournal get_there  ; can't_get_there
    until ( abs ( #charposx - !MoveTox ) <= !Tolerance && abs ( #charposy - !MoveToy ) <= !Tolerance ) ||  #scnt >= %timeout || #Result
    If ( abs ( #charposx - !MoveTox ) > !Tolerance || abs ( #charposy - !MoveToy ) > !Tolerance ) ; && #Result = #false
       move !MoveTox !MoveToy 0 5s
    }
return ( abs ( #charposx - !MoveTox ) <= !Tolerance && abs ( #charposy - !MoveToy ) <= !Tolerance )


sub checkjournalfor ; StartJournal
  set !StartJournal %1
  set !Filters %0
  set !EndJournal #Jindex
  set !ThisResult #False
  If !EndJournal > !StartJournal
    {
    for !CJFCount !StartJournal !EndJournal
      {
       scanJournal !CJFCount
       For !CJFx 2 !Filters
         {
         If % . !CJFx In #Journal
            Set !ThisResult #True
         }
      }
    }
return !ThisResult
Title: Re: ENs - Rose Of Trinsic Petal Picker
Post by: TrailMyx on August 15, 2012, 09:09:18 PM
The mother of all updates! Heh.
Title: Re: ENs - Rose Of Trinsic Petal Picker
Post by: papa daemon on February 03, 2016, 11:33:37 AM
Boy am I glad I scrolled thru this one!! I was actually going to skip it but at the last second I saw the "mother lode" update, and now, as you know, this is a must have!!!

Thanks for coding this EN, picking petals used to suck.....
Title: Re: ENs - Rose Of Trinsic Petal Picker
Post by: Endless Night on February 04, 2016, 09:50:43 AM
Boy am I glad I scrolled thru this one!! I was actually going to skip it but at the last second I saw the "mother lode" update, and now, as you know, this is a must have!!!

Thanks for coding this EN, picking petals used to suck.....

LOL good luck  ;D
Title: Re: ENs - Rose Of Trinsic Petal Picker
Post by: TrailMyx on July 26, 2017, 07:42:38 PM
Lol, they finally added this script to the PSL over at EasyUO!  hahaha.  Finally!
Title: Re: ENs - Rose Of Trinsic Petal Picker
Post by: Endless Night on July 27, 2017, 06:03:22 AM
Lol, they finally added this script to the PSL over at EasyUO!  hahaha.  Finally!

LOL  really !!! ...  I might have to update it now...  :laugh:
Title: Re: ENs - Rose Of Trinsic Petal Picker
Post by: Oracle on July 28, 2017, 09:08:31 AM
Yes, more people are loving the fact that they can pick more things...   :o