Author Topic: Recycler  (Read 4228 times)

0 Members and 1 Guest are viewing this topic.

Offline SkoadTopic starter

  • Jr. Member
  • **
  • Posts: 33
  • Activity:
    0%
  • Reputation Power: 1
  • Skoad has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Recycler
« on: February 24, 2012, 10:37:30 PM »
0
So I cant seem to find a working Smelting/recycler anywhere. So I am trying to make one.

The thing is.. I dont want it to smelt EVERYTHING. I want it to smelt everything that isnt exceptional. It has been awhile since I have played UO(yearsss), so awhile since I have messed with scripts.

I dont even think I am going the right direction with it.. and if I am.. Im not sure how to set it to find the item, search the properties, then click it if properties do not include exceptional.

Any help would be greatly appreciated!

Code: [Select]
set %smeltingitems YVI_GZH_HZH_NJL_BWI_KWI_IWI_EWI_QJL_JWI_XVI_CZH_HWI_JJN_NZH_BZH_TDI_
+WVI_VVI_QSH_KZH_PZH_DZH_DSH_ASH_TSH_ESH_YPH_GSH_OSH_ZPH_ZRH_IWL_CSH_BSH_FSH_
+DPH_LKO_NWL_MKH_JKH_RJG_SJG_FJG_MWL_NSH_ALH_HKH_PKH_BQH_JSH_XLH_GLH_MSH_YLH_
+QPH_YKH_DLO_QKH_DLH_HSH_ULH_LLH_ZOH_IKH_VLH_KSH_WLH_WPH_PKO_PPH_RSK_ATK_ZSK_
+OSK_NSK_USK_SSK_MSK_TSK_LSK_KKH_SKH_WTO_VPH_ISH_AQH_BMH_USH_XKH_FLH_KMH_RKO_
+VKH_ELH_HMH_LSH_IMH_CQH_WSH_APH_MLH_RLH_NKH_XPH_NKO_QSK_YSK_PSK_OZH_VSH_
+FMH_GFF_EPH_LPH_BPH_CUO_TSF_LPO_JPH_ZTH_RMH_SOH_JOH_KSF_
+FUO_WSF_ATF_OMH_XPO_QPO_NMH_WOH_BNF_LTF_VPO_TOH_WTH_VRH_KTF_LMH_TLH_
+OLH_FFF_ZSF_YTH_BUO_ASF_ISF_BSF_QPF_KPH_CUH_NPO_MPH_UOH_TRH_XRH_CSF_
+KPO_POH_RRH_WPO_EMH_MSF_OPO_BUH_GUO_MMH_VTH_BFF_QMH_YSF_NSF_LSF_AQF_
+GMH_JTF_SRH_CNF_FBG_HNF_ZPF_GBG_OSF_INF_HSF_AUO_ZTO_FSF_WRH_MTF_JPO_
+RPF_HFF_XSF_YPO_JSF_DMH_XTH_PPO_QOH_URH_CQF_CFF_PMH_AUH_SPO_CPH_ZRF_
+MPO_YRH_USF_LIK_MIK_CLK_AIK_CIK_LYD_GIK_NIK_ZHK_HLK_BLK_FIK_BIK_OIK


event macro 8 7
wait 20
set %charpackid #contid
wait 15
finditem TBG
if #findkind = -1 

event sysmessage Need more tongs!
halt 
}
set #lobjectid #findid
event macro 17 0
gosub WaitForSmithGump
if ! #result 2
   display All out of tongs!
   halt
if #contkind = STM
{
ContPos 50 50
click 83 403
}

findItem %smeltingitems
event property %smeltingitems
if excep in #property
{
  ignoreitem #smeltingitems
}


sub WaitForSmithGump
   set %gumptimeout #scnt
   _WaitForSmithGump:
   if #contName <> generic_gump && #contsize <> 530_437
   {
      wait 1
      if %gumptimeout + 5 < #scnt
         return #false
      goto _WaitForSmithGump
   }
   
  return #true

Offline slyone

  • Full Member
  • ***
  • Posts: 135
  • Activity:
    0%
  • Reputation Power: 2
  • slyone has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 1
    • View Profile
Re: Recycler
« Reply #1 on: February 25, 2012, 05:57:01 PM »
0
.. Im not sure how to set it to find the item, search the properties, then click it if properties do not include exceptional.

Any help would be greatly appreciated!

Your code seems to do the job up until you do the finditem on the smelting items.

Code: [Select]
findItem %smeltingitems
event property %smeltingitems
if excep in #property
{
  ignoreitem #smeltingitems
}

finditem %smeltingitems returns the item id you searched for in the variable #FINDID

You want to do the event property on that #FINDID and you also want to ignore that #FINDID if it enters your if statement above. 

You could add an else statement to this and then target the item to smelt if you want.

The new code might look like:

Code: [Select]
findItem %smeltingitems
event property #FINDID ; <----- Changed %smeltingitems to #FINDID
if excep in #property
{
  ignoreitem #FINDID    ; <----- Changed #smeltingitems to #FINDID
}
else
{
  set #LTARGETID #FINDID
  event macro 22 0 ; last target
}

Additionally, if you are searching a bunch of items in your bag then you could do a loop after the finditem %smeltingitems.  Check out the easyuo wiki entry for #FINDINDEX , http://wiki.easyuo.com/index.php?title=FindIndex.

Adding the loop would look like this:
Code: [Select]
findItem %smeltingitems
for #FINDINDEX 1 #FINDCNT
{
  event property #FINDID
  if excep in #property 
  {
    ignoreitem #FINDID
  }
  else
  {
    set #LTARGETID #FINDID
    event macro 22 0 ; last target
   
    ; put the code to click the smelt button again here 
    gosub WaitForSmithGump
    if #contkind = STM
    {
    ContPos 50 50
    click 83 403
    }
  }
}

Good luck with your recycling.
Started playing back at the Second Age

Offline SkoadTopic starter

  • Jr. Member
  • **
  • Posts: 33
  • Activity:
    0%
  • Reputation Power: 1
  • Skoad has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Recycler
« Reply #2 on: February 25, 2012, 11:28:37 PM »
0
Thanks a lot for the help.

I have done as you said but still not having any luck. With what you mentioned added into my script, It attempts to click "something" but always says "that is too far away". There are none of the "smeltingitems" anywhere on my screen.

I was able to get it to smelt items by adding

Code: [Select]
  set #lTargetKind 1
right in between the

Code: [Select]
    set #LTARGETID #FINDID
    set #lTargetKind 1
    event macro 22 0

but with this, it smelts everything in the pack, even the exceptional. =/

Offline slyone

  • Full Member
  • ***
  • Posts: 135
  • Activity:
    0%
  • Reputation Power: 2
  • slyone has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 1
    • View Profile
Re: Recycler
« Reply #3 on: February 26, 2012, 09:20:45 AM »
0

I have done as you said but still not having any luck. With what you mentioned added into my script, It attempts to click "something" but always says "that is too far away". There are none of the "smeltingitems" anywhere on my screen.


I didn't put it in my example above, but I think it is recommended that you do a check on #FINDCNT after you do a finditem call.  Then you only do something if #FINDCNT is greater than 0.  If there aren't any of the smeltingitems on your screen and you ran the code without check #FINDCNT, then you may have targeted a different #FINDID than you were expecting.

Code: [Select]
;snipped code above this

findItem %smeltingitems C_ , %charpackid
if #FINDCNT > 0
{
  for #FINDINDEX 1 #FINDCNT
  {
    event property #FINDID
    if excep in #property
    {
      ignoreitem #FINDID
    }
    else
    {
      set #LTARGETID #FINDID
      event macro 22 0
      gosub WaitForSmithGump
      if #contkind = STM
      {
      ContPos 50 50
      click 83 403
      }
    }
  }
}
halt


The finditem call below should only return items found with in the container %charpackid.
Code: [Select]
finditem %smeltingitems C_ , %charpackid
Hopefully this helps to debug the "that is too far away" message.


Started playing back at the Second Age

Offline SkoadTopic starter

  • Jr. Member
  • **
  • Posts: 33
  • Activity:
    0%
  • Reputation Power: 1
  • Skoad has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Recycler
« Reply #4 on: February 26, 2012, 09:58:40 AM »
0
Have you tested it at all so far? I know I have this set up right but it will not work.

Even with the new code you added.

Now it just simply clicks the smelt button, then doesnt target anything.. I cant figure out the code that calls on it. Once again if I enter

Code: [Select]
set #lTargetKind 1
in middle

Code: [Select]
    set #LTARGETID #FINDID
    set #lTargetKind 1
    event macro 22 0

It targets items, but doesnt do the except check.

Offline slyone

  • Full Member
  • ***
  • Posts: 135
  • Activity:
    0%
  • Reputation Power: 2
  • slyone has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 1
    • View Profile
Re: Recycler
« Reply #5 on: February 26, 2012, 11:03:51 AM »
0
I did test the code and it worked for me,  I made some iron plate chest pieces and had a mix of exp and non-exp items.  Only the non-exp were smelted.

A couple things you can do to debug is insert displays and pause in various places in the script and check the VARDUMP in the EUO menu.

Here is an example:
Code: [Select]
finditem %smeltingitems
if #FINDCNT > 0
{
event property #FINDID
display #PROPERTY
}
halt

You could also step through using the F keys, something like this:

Code: [Select]
pause
finditem %smeltingitems ; use F7 to step line by line through the code
if #FINDCNT > 0
{
  event property #FINDID
;etc...


Tools > Vardump gives you a listing of all the variables and their values.  It lists user defined variables also.

If you are still getting the "that is too far away message" you might look at the values of the #FINDX #FINDY #FINDZ to see what item #FINDID is actually referencing.
Started playing back at the Second Age

Offline SkoadTopic starter

  • Jr. Member
  • **
  • Posts: 33
  • Activity:
    0%
  • Reputation Power: 1
  • Skoad has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Recycler
« Reply #6 on: February 26, 2012, 08:27:26 PM »
0
Mhmm strange. It isnt actually targeting anything.

The Findx/y/z after I get the msg "cannot be seen" and pause it is leading to a compeltely empty spot in my backpack. Every time I run it, it leads to a different x/y/z but always same general area and empty.

When I add the

Code: [Select]
finditem %smeltingitems
if #FINDCNT > 0
{
event property #FINDID
display #PROPERTY
}
halt

It comes up with Platemail gorget. I ran it twice. Once with a GM gorget in my pack, once without. Both time sin the Property field it just said "#PROPERTY: Platemail Gorget$"
Without that code to search for anything.. I continue to get the cannot be seen error.


It is also pretty slow. Seems to take a couple seconds to target the empty spot after it clicks the "smelt item" button.

Here is the entire code I have right now.

Code: [Select]
set %smeltingitems YVI_GZH_HZH_NJL_BWI_KWI_IWI_EWI_QJL_JWI_XVI_CZH_HWI_JJN_NZH_BZH_TDI_
+WVI_VVI_QSH_KZH_PZH_DZH_DSH_ASH_TSH_ESH_YPH_GSH_OSH_ZPH_ZRH_IWL_CSH_BSH_FSH_
+DPH_LKO_NWL_MKH_JKH_RJG_SJG_FJG_MWL_NSH_ALH_HKH_PKH_BQH_JSH_XLH_GLH_MSH_YLH_
+QPH_YKH_DLO_QKH_DLH_HSH_ULH_LLH_ZOH_IKH_VLH_KSH_WLH_WPH_PKO_PPH_RSK_ATK_ZSK_
+OSK_NSK_USK_SSK_MSK_TSK_LSK_KKH_SKH_WTO_VPH_ISH_AQH_BMH_USH_XKH_FLH_KMH_RKO_
+VKH_ELH_HMH_LSH_IMH_CQH_WSH_APH_MLH_RLH_NKH_XPH_NKO_QSK_YSK_PSK_OZH_VSH_
+FMH_GFF_EPH_LPH_BPH_CUO_TSF_LPO_JPH_ZTH_RMH_SOH_JOH_KSF_
+FUO_WSF_ATF_OMH_XPO_QPO_NMH_WOH_BNF_LTF_VPO_TOH_WTH_VRH_KTF_LMH_TLH_
+OLH_FFF_ZSF_YTH_BUO_ASF_ISF_BSF_QPF_KPH_CUH_NPO_MPH_UOH_TRH_XRH_CSF_
+KPO_POH_RRH_WPO_EMH_MSF_OPO_BUH_GUO_MMH_VTH_BFF_QMH_YSF_NSF_LSF_AQF_
+GMH_JTF_SRH_CNF_FBG_HNF_ZPF_GBG_OSF_INF_HSF_AUO_ZTO_FSF_WRH_MTF_JPO_
+RPF_HFF_XSF_YPO_JSF_DMH_XTH_PPO_QOH_URH_CQF_CFF_PMH_AUH_SPO_CPH_ZRF_
+MPO_YRH_USF_LIK_MIK_CLK_AIK_CIK_LYD_GIK_NIK_ZHK_HLK_BLK_FIK_BIK_OIK


event macro 8 7
wait 15
if #contkind = OHF
{
ContPos 570 12
}
wait 50
set %charpackid #contid
wait 15
finditem TBG
if #findkind = -1
{
event sysmessage Need more tongs!
halt
}
set #lobjectid #findid
event macro 17 0
gosub WaitForSmithGump
if ! #result 2
   display All out of tongs!
   halt
if #contkind = STM
{
ContPos 50 50
click 83 403
}



findItem %smeltingitems C_ , %charpackid
   for #FINDINDEX 1 #FINDCNT
{
  event property #FINDID
  if excep in #property
{
  ignoreitem #FINDID
}
   else
{
  set #LTARGETID #FINDID
  event macro 22 0
  gosub WaitForSmithGump
  if #contkind = STM
{
  ContPos 50 50
  click 83 403
   }
  }
 }


sub WaitForSmithGump
   set %gumptimeout #scnt
   _WaitForSmithGump:
   if #contName <> generic_gump && #contsize <> 530_437
   {
      wait 1
      if %gumptimeout + 5 < #scnt
         return #false
      goto _WaitForSmithGump
   }

  return #true
« Last Edit: February 26, 2012, 08:46:49 PM by Skoad »

Offline slyone

  • Full Member
  • ***
  • Posts: 135
  • Activity:
    0%
  • Reputation Power: 2
  • slyone has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 1
    • View Profile
Re: Recycler
« Reply #7 on: February 27, 2012, 05:46:52 PM »
0
I just ran the code below and it works for me with my platemail tunics.  Not sure what to say if it doesn't work for you.  You might try recycling via a salvage bag??  Something like move all non-exp items to the salvage bag and select salvage all. 


Try out the code below, I commented what I changed:

Code: [Select]
set %smeltingitems YVI_GZH_HZH_NJL_BWI_KWI_IWI_EWI_QJL_JWI_XVI_CZH_HWI_JJN_NZH_BZH_TDI_
+WVI_VVI_QSH_KZH_PZH_DZH_DSH_ASH_TSH_ESH_YPH_GSH_OSH_ZPH_ZRH_IWL_CSH_BSH_FSH_
+DPH_LKO_NWL_MKH_JKH_RJG_SJG_FJG_MWL_NSH_ALH_HKH_PKH_BQH_JSH_XLH_GLH_MSH_YLH_
+QPH_YKH_DLO_QKH_DLH_HSH_ULH_LLH_ZOH_IKH_VLH_KSH_WLH_WPH_PKO_PPH_RSK_ATK_ZSK_
+OSK_NSK_USK_SSK_MSK_TSK_LSK_KKH_SKH_WTO_VPH_ISH_AQH_BMH_USH_XKH_FLH_KMH_RKO_
+VKH_ELH_HMH_LSH_IMH_CQH_WSH_APH_MLH_RLH_NKH_XPH_NKO_QSK_YSK_PSK_OZH_VSH_
+FMH_GFF_EPH_LPH_BPH_CUO_TSF_LPO_JPH_ZTH_RMH_SOH_JOH_KSF_
+FUO_WSF_ATF_OMH_XPO_QPO_NMH_WOH_BNF_LTF_VPO_TOH_WTH_VRH_KTF_LMH_TLH_
+OLH_FFF_ZSF_YTH_BUO_ASF_ISF_BSF_QPF_KPH_CUH_NPO_MPH_UOH_TRH_XRH_CSF_
+KPO_POH_RRH_WPO_EMH_MSF_OPO_BUH_GUO_MMH_VTH_BFF_QMH_YSF_NSF_LSF_AQF_
+GMH_JTF_SRH_CNF_FBG_HNF_ZPF_GBG_OSF_INF_HSF_AUO_ZTO_FSF_WRH_MTF_JPO_
+RPF_HFF_XSF_YPO_JSF_DMH_XTH_PPO_QOH_URH_CQF_CFF_PMH_AUH_SPO_CPH_ZRF_
+MPO_YRH_USF_LIK_MIK_CLK_AIK_CIK_LYD_GIK_NIK_ZHK_HLK_BLK_FIK_BIK_OIK


event macro 8 7
wait 15
if #contkind = OHF
{
  ContPos 570 12
}
wait 50
set %charpackid #contid
wait 15
finditem TBG C_ , #BACKPACKID ; <---- Added to look just in backpack  #BACKPACKID should be the same as #CONTID
if #findkind = -1
{
  event sysmessage Need more tongs!
  halt
}
set #lobjectid #findid
event macro 17 0
gosub WaitForSmithGump
if ! #result 2
   display All out of tongs!
   halt
if #contkind = STM
{
  ContPos 50 50
  click 83 403
}

findItem %smeltingitems C_ , #BACKPACKID
if #FINDCNT < 0       ; <------------  Changed the if statement expression slightly
{
  Display Can't find anything to smelt, halting...
  halt
}
for #FINDINDEX 1 #FINDCNT
{
  event property #FINDID
  if excep in #property
  {
  ignoreitem #FINDID
  }
  else
  {
    set #LTARGETID #FINDID
    event macro 22 0
    gosub WaitForSmithGump
    if #contkind = STM
    {
  ContPos 50 50
  click 83 403
    }
  }
}
Display All Non-exceptional Items were smelted, halting...
halt

sub WaitForSmithGump
   set %gumptimeout #scnt
   _WaitForSmithGump:
   if #contName <> generic_gump && #contsize <> 530_437
   {
      wait 1
      if %gumptimeout + 5 < #scnt
         return #false
      goto _WaitForSmithGump
   }

  return #true

Started playing back at the Second Age

Offline SkoadTopic starter

  • Jr. Member
  • **
  • Posts: 33
  • Activity:
    0%
  • Reputation Power: 1
  • Skoad has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Recycler
« Reply #8 on: February 27, 2012, 08:56:04 PM »
0
I must be having some sort of freeshard issue then.

Even your edited copy just smelts down everything. =/


-edit-

Turns out the reason I cannot get this to work is that the freeshard does not seem to read the #Property correctly. It only displays "Platemail Gorget$" and does not display "exceptional" at all.
« Last Edit: February 28, 2012, 08:36:39 AM by Skoad »

Offline camotbik

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Re: Recycler
« Reply #9 on: February 29, 2012, 06:24:34 PM »
0
On what shard are you playing and what is your current client version + euo version ?

Could you run this script and make a screenshot of the popup window?
Code: [Select]
display Target the exceptional item
set #targcurs 1
while #targcurs = 1
  wait 1
event property #ltargetid
display #property
stop
What you witness -- is whatver..
uogamers hybrid.

Offline SkoadTopic starter

  • Jr. Member
  • **
  • Posts: 33
  • Activity:
    0%
  • Reputation Power: 1
  • Skoad has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Recycler
« Reply #10 on: March 01, 2012, 04:48:59 AM »
0
Its an issue with Pre-AoS servers. They dont read item #Property correctly.

Running the script and clicking on an exceptional crafted spear.. the popup just shows "Spear".

Playing on the shard Perilous, which runs the latest client version.

Offline camotbik

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Re: Recycler
« Reply #11 on: March 01, 2012, 06:49:49 AM »
0
then the only option is to use stealth client.
What you witness -- is whatver..
uogamers hybrid.

Offline SkoadTopic starter

  • Jr. Member
  • **
  • Posts: 33
  • Activity:
    0%
  • Reputation Power: 1
  • Skoad has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Recycler
« Reply #12 on: March 01, 2012, 04:22:37 PM »
0
Not sure what you mean by stealth client, unless you are referring to PlayUO/Krrios.

I was hoping I could just smelt as I make them, but there is no sort of journal entry created when crafting exceptional, so that wouldnt work either.

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: Recycler
« Reply #13 on: March 01, 2012, 05:33:09 PM »
0
check out what Stealth is all about in the section here:

http://www.scriptuo.com/index.php?board=145.0
Please read the ScriptUO site RULES
Come play RIFT with me!

Tags: