Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

[EUO] Carpentry
#1

Razor kept crashing my client so I made EUO macro for carpentry. It restocks 50 boards and SS at a time and makes scrolls. Just modify the container IDs for boards, SS and where blank scrolls should be placed, grab materials for 1 scroll and craft it then run the macro. Only works with saw as a tool and using boards, not logs. Just add IDs of other tools into %tools variable if you need to.

Code:
; OzCarpentry (Blank scrolls)
;
; Setup:
; 1) Set the container variables
; 2) Grab 1 SS and 1 board
; 3) Craft one scroll
; 4) Run the macro

; Variables
set #LPC 1000
set %tools EGG
set %boards TLK
set %scrolls DPF
set %SS RZF
; Modify the 3 variables below
set %containerBoards OTNQNMD    ; Container where boards are
set %containerSS VYEHKMD        ; Container where Spider silk is
set %containerScrolls OTNQNMD   ; Container where blank scrolls should be put

; Finds a tool to be used
finditem %tools C_ , #BACKPACKID   ; Carpentry tools
if #FINDCNT > 0
  set %tool #FINDID
else
{
  event sysmessage ++ No carpentry tool found! Halting...
  halt
}

while ( #TRUE )
{
  chooseSkill Carp
  if ( #skill > 999 )
  {
    event sysmessage ++ You have GMed Carpentry! Congratulations! Halting macro.
    halt
  }

  ; Checks for materials
  finditem %boards C_ , #BACKPACKID   ; Boards
  if #FINDCNT > 0
  {
    finditem %SS C_ , #BACKPACKID   ; Spider Silk
    if #FINDCNT > 0
    {
      gosub Craft
    }
    else
      gosub RestockSS
  }
  else
    gosub RestockBoards
}
halt

sub Craft
  set #LOBJECTID %tool
  event macro 17 0
  while ! ( #CONTKIND = IOIB && #CONTSIZE = 530_437 )
  {
  }
  set %clickX 285 + #CONTPOSX
  set %clickY 410 + #CONTPOSY
  click %clickX %clickY dmc
  set %wtfTimer #SYSTIME
  while ! ( #CONTKIND = IOIB && #CONTSIZE = 530_437 )
  {
    finditem %scrolls C_ , #BACKPACKID
    if ( #FINDCNT > 0 && #FINDSTACK > 49 )
      gosub Unload
    if ( #SYSTIME - %wtfTimer > 10000 )
      break
  }
return

sub RestockSS
  finditem %SS C_ , #BACKPACKID
  if ( #FINDCNT < 1 )
  {
    finditem %SS C_ , %containerSS
    if ( #FINDCNT > 0 )
    {
      Exevent Drag #FINDID 50
      Exevent Dropc #BACKPACKID
    }
    else
    {
      event sysmessage ++ No more Spider Silk to restock from! Stopping macro...
      halt
    }
  }
  wait 10
return

sub RestockBoards
  finditem %boards C_ , #BACKPACKID
  if ( #FINDCNT < 1 )
  {
    finditem %boards C_ , %containerBoards
    if ( #FINDCNT > 0 )
    {
      Exevent Drag #FINDID 50
      Exevent Dropc #BACKPACKID
    }
    else
    {
      event sysmessage ++ No more boards to restock from! Stopping macro...
      halt
    }
  }
  wait 10
return

sub Unload
MoveMoreScrolls:
  finditem %scrolls C_ , #BACKPACKID
  if ( #FINDCNT > 0 )
  {
    Exevent Drag #FINDID #FINDSTACK
    Exevent Dropc %containerScrolls
  }
  finditem %bolts C_ , #BACKPACKID
  if ( #FINDCNT > 0 )
    goto MoveMoreScrolls
return


Forum Jump:


Users browsing this thread: 1 Guest(s)