ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: declo on March 10, 2016, 02:50:51 PM

Title: Forges - Tile versions
Post by: declo on March 10, 2016, 02:50:51 PM
Does anyone have a snippet or sub for using tiles forges (those without ids)?
Title: Re: Forges - Tile versions
Post by: TrailMyx on March 10, 2016, 08:40:25 PM
This is one I use in some scripts.  Works OK for most forges, but the IDs were pulled some time ago.

Code: [Select]
;-------------------------------------------------------------------------------
sub SmeltOre         ; JBG
  finditem SUJ_OUJ_KUJ_JBG_CUT_SOJ_HVJ_WUJ_CVJ_KUJ_GUJ G_2
  if #FINDCNT > 0
  {
    menu set EUOEdit_status Smelting ore....
    set %forge #FINDID
    repeat
      set %smelt_continue #FALSE
      findItem TVJ_GWJ_DWJ_EWJ C_ , #BACKPACKID
      if #FINDCNT > 0
      {
        if ( ( #FINDTYPE = TVJ ) && ( #FINDSTACK = 1 ) )
        {
          ignoreitem #FINDID test
          if #FINDCNT > 1
            set %smelt_continue #TRUE
        }
        else
        {
          set #LOBJECTID #FINDID
          set #LTARGETID %forge
          set #LTARGETKIND 1
          event macro 17 0
          target 5s
          event macro 22 0
          wait 15
          set %smelt_continue #TRUE
        }
      }
    until %smelt_continue = #FALSE
  }
  if %sound = #TRUE
    sound
  menu set EUOEdit_status Smelting complete!
  ignoreitem reset test
  finditem %shovel_types C_ , #BACKPACKID
  if #FINDCNT > 0
    set #LOBJECTID #FINDID ; set shovel back to last object.
return

There's extra code in there at the end just because this supported my miner so it just re-finds the shovel.
Title: Re: Forges - Tile versions
Post by: declo on March 11, 2016, 07:39:26 AM
Thanks!

What about those forges that do not have IDs?  Like those in dungeons.
Title: Re: Forges - Tile versions
Post by: TrailMyx on March 11, 2016, 08:27:40 AM
Thanks!

What about those forges that do not have IDs?  Like those in dungeons.

Those do likely pull up with an ID using finditem.  THis sub works well for forges found in town for example.