[EasyUO] Crafter Keys Sub

If you make a Client-side script you can publish it here for other players to use
Locked
User avatar
BlaZe
Legendary Scribe
Posts: 402
Joined: Thu Dec 25, 2008 12:54 am
Location: Ann Arbor, MI; USA

[EasyUO] Crafter Keys Sub

Post by BlaZe »

Ever since I discovered Excelsior and all of its glorious custom mods, I've been itching to make some EUO scripts that take advantage of them. EasyUO's more popular scripters play mainly on OSI so a lot (if not all) of the fun things we have won't be found in the Public Script Library.

So.. here's my first attempt at making life a little easier; a subscript that will add or remove any item(s) of your choosing to or from any Key set.


Examples are listed in the script, but here's a few:
gosub key tailor remove spined 4 (removes 400 spined leather)
gosub key wood add all (adds all wood)
gosub key caster remove daemon 3 (removes 300 daemon bones)

This is meant to be called from within a script, but if you would like to make it standalone put the 'gosub key' and 'halt' on the two lines before Start. It should look like:

gosub key bla bla bla
halt
;;;;; Start ;;;;;

Should I get enough support I may even include a GUI to make it completely standalone, but I have quite a few projects left to work on so it probably won't be soon.

Please please PLEASE post or PM any bugs or suggestions!



PS. Coli, be my valentine :P

Code: Select all

    ; Crafter Key's Sub
    ; by BlaZe Budd of Excelsior's ßud ßrothers
    ; v0.8c completed 7/31/10 (fixes by ticketguru)
    ;
    ;
    ; USAGE:
    ;   gosub key %1 %2 %3 %4
    ;
    ;   %1 = metal, tailor, stone, wood, caster
    ;   %2 = add / remove
    ;   %3 = what to add / remove (you can use 'all' to ADD everything possible)
    ;   %4 = how many to REMOVE (times to click the button)
    ;
    ; EXAMPLES
    ;   gosub key wood remove board 10 (removes 1000 plain wood)
    ;   gosub key caster remove nightshade 3 (removes 300 nightshade)
    ;   gosub key metal add all (adds all ingots)
    ;
    ; ITEM LIST
    ; These are the recognized items used for %3:
    ;
    ; Metal/Stone:
    ;   iron, dull, shadow, copper, bronze, gold, agapite, verite,
    ;   valorite, blaze, ice, toxic, electrum, platinum
    ;
    ; Wood:
    ;   board, pine, ash, mohog, yew, oak, zircote, bamboo,
    ;   purple, redwood, petrified, arrow, bolt, feather, shaft
    ;
    ; Tailor:
    ;   leather, spined, horned, barbed, polar, synthetic, blaze, daemonic, shadow, frost, ethereal, cut, folded, bolt, spool,
    ;   red, yellow, black, green, white, blue, copper, silver, gold, yarn, wool, cotton
    ;
    ; Caster:
    ;   pearl, moss, garlic, ginseng, mandrake, nightshade, ash, silk, batwing, grave, blood, crystal, pig, dirt, fungus,
    ;   bone, daemon, keg, scroll, bottle, sand, ring, wax, water, wood, angel, powder
    ;
    ; Note that this script DOES NOT CHECK YOUR WEIGHT
    ; when using the 'remove' command. You have been warned!
    ;
    ;
    ; VARIABLES USED:
    ;   %1 %2 %3 %4
    ;   %tailorThings %woodThings %casterThings
    ;   %menu %done %click %row %button
    ;   %X %Y %clickX %clickY
    ;
    ;
    ; Comments/questions/concerns? [pm BlaZe or post in the forums
    ;
    ;;;;;;;;;;;;;;;;;


    ;;;;; Start ;;;;;
    sub key
    if %done = #true
    {
       set %done = #false
       return
    }
    set %tailorThings JJG_STO_BUI_CUI_OFF_ZZF_UAG_NFF_QEK_QLF
    set %woodThings TLK_RWF_LNK_SLK_VLK_ZLK
    set %casterThings IND_PLF_WLF_DPF_QMJ_GUF_OZF_NZF_TTO_ETH_WUF_YZF_UZF_TZF_DUF_IUF_JUF_RZF_KUF_SZF_WZF_KZF_MZF_JZF_TZF_NUI_KSG
    set %lTargetKind #lTargetKind
    set #lTargetKind 1

    ;;;;; Finding the specified key ;;;;;
    findKeyLoop:

    findItem NUI C_ , #backpackID
    if #findKind = -1
       gosub uhoh 1
    event property #findID
    if metal in %1 && Metal in #property
    {
       set %menu 505_270
       gosub metalKeys
    }
    if wood in %1 && Wood in #property
    {
       set %menu 505_295
       gosub woodKeys
    }
    if tailor in %1 && Tailor in #property
    {
       set %menu 505_440
       gosub tailorKeys
    }
    if stone in %1 && Stone in #property
    {
       set %menu 505_270
       gosub stoneKeys
    }
    if caster in %1 && Caster in #property
    {
       set %menu 505_455
       gosub casterKeys
    }
    if %1 = N/A
       gosub uhoh 2
    if %done = #true  ; added tg 30-jul-2009
    {
       set #lTargetKind %lTargetKind  ; restore lTargetKind
       return
    }
    ignoreitem #findID
    goto findKeyLoop

    ;;;;; Error messages ;;;;;
    sub uhoh
    if %1 = 1
      event exMsg #charID 3 0 + NO KEYS +
    if %1 = 2
      event exMsg #charID 3 0 + KEY NOT SPECIFIED +
    if %1 = 3
      event exMsg #charID 3 0 + ITEM NOT SPECIFIED +
    stop

    ;;;;; 'Waits' for key menu ;;;
    sub keyMenu
    keyLoop:
    wait 1
    if #contSize <> %menu
       goto keyLoop
    return

    ;;;;; Metal ;;;;;
    sub metalKeys
    set #lObjectID #findID
    event macro 17 0
    gosub keyMenu

    if iron in %3
       {
       set %row 1
       set %button 1
       }
    if dull in %3
       {
       set %row 1
       set %button 2
       }
    if shadow in %3
       {
       set %row 1
       set %button 3
       }
    if copper in %3
       {
       set %row 1
       set %button 4
       }
    if bronze in %3
       {
       set %row 1
       set %button 5
       }
    if gold in %3
       {
       set %row 1
       set %button 6
       }
    if agapite in %3
       {
       set %row 1
       set %button 7
       }
    if verite in %3
       {
       set %row 1
       set %button 8
       }
    if valorite in %3
       {
       set %row 2
       set %button 1
       }
    if blaze in %3
       {
       set %row 2
       set %button 2
       }
    if ice in %3
       {
       set %row 2
       set %button 3
       }
    if toxic in %3
       {
       set %row 2
       set %button 4
       }
    if electrum in %3
       {
       set %row 2
       set %button 5
       }
    if platinum in %3
       {
       set %row 2
       set %button 6
       }
    if add in %2
       {
       set %row 2
       set %button 8
       }
    gosub setXY
    if add in %2
       gosub metalAdd
    if remove in %2
       gosub remove
    else
       gosub uhoh 3
    click %clickX %clickY r  ; added tg 30-jul-2009
    set %done #true
    return

    sub metalAdd
    click %clickX %clickY
    target
    metalAddLoop:
    finditem ENK C_ , #backpackID
    if #findKind = -1
    {
       key ESC  ; added tg 30-jul-2009
       wait 1   ; to cancel targeting
      return
    }
    event property #findID
    if iron in %3 && shadow in #property
       {
       ignoreitem #findID
       goto metalAddLoop
       }
    if %3 in #property || all in %3
       {
       set #lTargetID #findID
       event macro 22 0
       target
       }
    else
       ignoreitem #findID
    goto metalAddLoop


    ;;;;; Stone ;;;;;
    sub stoneKeys
    set #lObjectID #findID
    event macro 17 0
    gosub keyMenu

    if iron in %3
       {
       set %row 1
       set %button 1
       }
    if dull in %3
       {
       set %row 1
       set %button 2
       }
    if shadow in %3
       {
       set %row 1
       set %button 3
       }
    if copper in %3
       {
       set %row 1
       set %button 4
       }
    if bronze in %3
       {
       set %row 1
       set %button 5
       }
    if gold in %3
       {
       set %row 1
       set %button 6
       }
    if agapite in %3
       {
       set %row 1
       set %button 7
       }
    if verite in %3
       {
       set %row 1
       set %button 8
       }
    if valorite in %3
       {
       set %row 2
       set %button 1
       }
    if blaze in %3
       {
       set %row 2
       set %button 2
       }
    if ice in %3
       {
       set %row 2
       set %button 3
       }
    if toxic in %3
       {
       set %row 2
       set %button 4
       }
    if electrum in %3
       {
       set %row 2
       set %button 5
       }
    if platinum in %3
       {
       set %row 2
       set %button 6
       }
    if add in %2
       {
       set %row 2
       set %button 8
       }
    gosub setXY
    if add in %2
       gosub stoneAdd
    if remove in %2
       gosub remove
    else
       gosub uhoh 3
    click %clickX %clickY r  ; added tg 30-jul-2009
    set %done #true
    return

    sub stoneAdd
    click %clickX %clickY
    target
    stoneAddLoop:
    finditem BVI C_ , #backpackID
    if #findKind = -1
    {
       key ESC  ; added tg 30-jul-2009
       wait 1   ; to cancel targeting
      return
    }
    event property #findID
    if %3 in #property || all in %3
       {
       set #lTargetID #findID
       event macro 22 0
       target
       }
    else
       ignoreitem #findID
    goto stoneAddLoop


    ;;;;; Wood ;;;;;
    sub woodKeys
    set #lObjectID #findID
    event macro 17 0
    gosub keyMenu

    if board in %3
       {
       set %row 1
       set %button 1
       }
    if pine in %3
       {
       set %row 1
       set %button 2
       }
    if ash in %3
       {
       set %row 1
       set %button 3
       }
    if mohog in %3
       {
       set %row 1
       set %button 4
       }
    if yew in %3
       {
       set %row 1
       set %button 5
       }
    if oak in %3
       {
       set %row 1
       set %button 6
       }
    if zircote in %3
       {
       set %row 1
       set %button 7
       }
    if ebony in %3
       {
       set %row 1
       set %button 8
       }
    if bamboo in %3
       {
       set %row 1
       set %button 9
       }
    if purple in %3
       {
       set %row 2
       set %button 1
       }
    if redwood in %3
       {
       set %row 2
       set %button 2
       }
    if petrified in %3
       {
       set %row 2
       set %button 3
       }
    if arrow in %3
       {
       set %row 2
       set %button 4
       }
    if bolt in %3
       {
       set %row 2
       set %button 5
       }
    if feather in %3
       {
       set %row 2
       set %button 6
       }
    if shaft in %3
       {
       set %row 2
       set %button 7
       }
    if add in %2
       {
       set %row 2
       set %button 9
       }
    gosub setXY
    if add in %2
       gosub woodAdd
    if remove in %2
       gosub remove
    else
       gosub uhoh 3
    click %clickX %clickY r  ; added tg 30-jul-2009
    set %done #true
    return

    sub woodAdd
    click %clickX %clickY
    target
    woodAddLoop:
    finditem %woodThings C_ , #backpackID
    if #findKind = -1
    {
       key ESC  ; added tg 30-jul-2009
       wait 1   ; to cancel targeting
      return
    }
    event property #findID
    if board in %3 && ( pine in #property || ash in #property || mohogany in #property || yew in #property || oak in #property || zircote in #property || ebony in #property || bamboo in #property || purple in #property || redwood in #property || petrified in #property )
       {
       ignoreitem #findID
       goto woodAddLoop
       }
    if %3 in #property || all in %3 || ( board in %3 && log in #property )
       {
       set #lTargetID #findID
       event macro 22 0
       target
       }
    else
       ignoreitem #findID
    goto woodAddLoop


    ;;;;; Tailor Keys ;;;;;
    sub tailorKeys
    set #lObjectID #findID
    event macro 17 0
    gosub keyMenu

    if leather in %3
       {
       set %row 1
       set %button 1
       }
    if spined in %3
       {
       set %row 1
       set %button 2
       }
    if horned in %3
       {
       set %row 1
       set %button 3
       }
    if barbed in %3
       {
       set %row 1
       set %button 4
       }
    if polar in %3
       {
       set %row 1
       set %button 5
       }
    if synthetic in %3
       {
       set %row 1
       set %button 6
       }
    if blaze in %3
       {
       set %row 1
       set %button 7
       }
    if daemonic in %3
       {
       set %row 1
       set %button 8
       }
    if shadow in %3
       {
       set %row 1
       set %button 9
       }
    if frost in %3
       {
       set %row 1
       set %button 10
       }
    if ethereal in %3
       {
       set %row 1
       set %button 11
       }
    if cut in %3
       {
       set %row 1
       set %button 12
       }
    if folded in %3
       {
       set %row 1
       set %button 13
       }
    if bolt in %3
       {
       set %row 1
       set %button 14
       }
    if spool in %3
       {
       set %row 1
       set %button 15
       }

    if red in %3
       {
       set %row 2
       set %button 1
       }
    if yellow in %3
       {
       set %row 2
       set %button 2
       }
    if black in %3
       {
       set %row 2
       set %button 3
       }
    if green in %3
       {
       set %row 2
       set %button 4
       }
    if white in %3
       {
       set %row 2
       set %button 5
       }
    if blue in %3
       {
       set %row 2
       set %button 6
       }
    if copper in %3
       {
       set %row 2
       set %button 7
       }
    if silver in %3
       {
       set %row 2
       set %button 8
       }
    if gold in %3
       {
       set %row 2
       set %button 9
       }
    if yarn in %3
       {
       set %row 2
       set %button 10
       }
    if wool in %3
       {
       set %row 2
       set %button 11
       }
    if cotton in %3
       {
       set %row 2
       set %button 12
       }
    if add in %2
       {
       set %row 2
       set %button 15
       }
    gosub setXY
    if add in %2
       gosub tailorAdd
    if remove in %2
       gosub remove
    else
       gosub uhoh 3
    click %clickX %clickY r  ; added tg 30-jul-2009
    set %done #true
    return

    sub tailorAdd
    click %clickX %clickY
    target
    tailorAddLoop:
    finditem %tailorThings C_ , #backpackID
    if #findKind = -1
    {
       key ESC  ; added tg 30-jul-2009
       wait 1   ; to cancel targeting
      return
    }
    event property #findID
    if leather in %3 && ( spined in #property || horned in #property || barbed in #property || polar in #property || synthetic in #property || blaze in #property || daemonic in #property || shadow in #property || frost in #property || ethereal in #property )
       {
       ignoreitem #findid
       goto tailorAddLoop
       }
    if %3 in #property || all in %3
       {
       set #lTargetID #findID
       event macro 22 0
       target
       }
    else
       ignoreitem #findID
    goto tailorAddLoop


    ;;;;; Caster Keys ;;;;;
    sub casterKeys
    set #lObjectID #findID
    event macro 17 0
    gosub keyMenu

    if pearl in %3
       {
       set %row 1
       set %button 1
       }
    if moss in %3
       {
       set %row 1
       set %button 2
       }
    if garlic in %3
       {
       set %row 1
       set %button 3
       }
    if ginseng in %3
       {
       set %row 1
       set %button 4
       }
    if mandrake in %3
       {
       set %row 1
       set %button 5
       }
    if nightshade in %3
       {
       set %row 1
       set %button 6
       }
    if ash in %3
       {
       set %row 1
       set %button 7
       }
    if silk in %3
       {
       set %row 1
       set %button 8
       }
    if batwing in %3
       {
       set %row 1
       set %button 9
       }
    if grave in %3
       {
       set %row 1
       set %button 10
       }
    if blood in %3
       {
       set %row 1
       set %button 11
       }
    if crystal in %3
       {
       set %row 1
       set %button 12
       }
    if pig in %3
       {
       set %row 1
       set %button 13
       }
    if dirt in %3
       {
       set %row 1
       set %button 14
       }
    if fungus in %3
       {
       set %row 1
       set %button 15
       }
    if bone in %3
       {
       set %row 2
       set %button 1
       }
    if daemon in %3
       {
       set %row 2
       set %button 2
       }
    if keg in %3
       {
       set %row 2
       set %button 3
       }
    if scroll in %3
       {
       set %row 2
       set %button 4
       }
    if bottle in %3
       {
       set %row 2
       set %button 5
       }
    if sand in %3
       {
       set %row 2
       set %button 6
       }
    if ring in %3
       {
       set %row 2
       set %button 7
       }
    if wax in %3
       {
       set %row 2
       set %button 8
       }
    if water in %3
       {
       set %row 2
       set %button 9
       }
    if wood in %3
       {
       set %row 2
       set %button 10
       }
    if angel in %3
       {
       set %row 2
       set %button 11
       }
    if powder in %3
       {
       set %row 2
       set %button 12
       }
    if add in %2
       {
       set %row 2
       set %button 15
       }
    gosub setXY
    if add in %2
       gosub casterAdd
    if remove in %2
       gosub remove
    else
       gosub uhoh 3
    click %clickX %clickY r  ; added tg 30-jul-2009
    set %done #true
    return

    sub casterAdd
    click %clickX %clickY
    target
    casterAddLoop:
    finditem %casterThings C_ , #backpackID
    if #findKind = -1
    {
       key ESC  ; added tg 30-jul-2009
       wait 1   ; to cancel targeting
      return
    }
    event property #findID
    if keys in #property || ( bones in %3 && daemon in #property ) || ( keg in %3 && empty notin #property ) || ( bottle in %3 && dirty in #property ) || ( dirt in %3 && fertile notin #property )
       {
       ignoreitem #findID
       goto casterAddLoop
       }
    if %3 in #property || all in %3
       {
       set #lTargetID #findID
       event macro 22 0
       target
       }
    else
       ignoreitem #findID
    goto casterAddLoop


    ;;;;; The remove sub... duh ;;;;;
    sub remove
    set %click 0
    while %click < %4
       {
       click %clickX %clickY
       gosub keyMenu
       set %click %click + 1
       }
    return


    ;;;;; Sets the X/Y position of the button we want to click ;;;;;
    sub setXY
    if %row = 1
       set %X 90
    if %row = 2
       set %X 290
    if %button = 1
       set %Y 60
    if %button = 2
       set %Y 85
    if %button = 3
       set %Y 110
    if %button = 4
       set %Y 135
    if %button = 5
       set %Y 160
    if %button = 6
       set %Y 185
    if %button = 7
       set %Y 210
    if %button = 8
       set %Y 235
    if %button = 9
       set %Y 260
    if %button = 10
       set %Y 285
    if %button = 11
       set %Y 310
    if %button = 12
       set %Y 335
    if %button = 13
       set %Y 360
    if %button = 14
       set %Y 385
    if %button = 15
       set %Y 415  ; <- Offset for Caster Keys
    set %clickX #contPosX + %X
    set %clickY #contPosY + %Y
    return
Last edited by BlaZe on Fri Sep 03, 2010 6:14 pm, edited 5 times in total.
Llexa
Legendary Scribe
Posts: 294
Joined: Mon May 08, 2006 3:42 pm

Re: [EasyUO] Crafter Keys Sub

Post by Llexa »

Im just in awe b/c i dont understand the scripting, hehe. Very nice contribution! Seacrest, OUT! *snaps in a z formation* (lol)

love,
Llexa

p.s. Happy Valentines day!
"We push and we push away,
For fear of facing our mistakes.
So we call it judgment,
And watch our friends, our world, ourselves... go comatose, inside."
rsherman
Novice Scribe
Posts: 7
Joined: Thu Oct 30, 2008 5:41 am

Re: [EasyUO] Crafter Keys Sub

Post by rsherman »

looks like a good script.

The scripts I've done are mostly miner/smithy related and are taking other peoples scripts and improving them. I have a smith bod filler for example that all I've done is adjust it to allow for some of the customs in the menus I've yet to add in the custom ores to it.
Mogster
Apprentice Scribe
Posts: 13
Joined: Sat Jan 17, 2009 7:44 pm

Re: [EasyUO] Crafter Keys Sub

Post by Mogster »

Ace work dude. still for some reason i can't get easyuo to work on my new computer.
Be great to get the bod filling script up here as well
ticketguru
Grandmaster Scribe
Posts: 99
Joined: Fri Jun 12, 2009 11:25 pm

Re: [EasyUO] Crafter Keys Sub

Post by ticketguru »

Blaze, I want to thank you for doing all this scripting work. I wanted to implement this but didn't want to take the time myself. However, with this one, I found some problems when I tried to implement it in my own scripts. Here is the updated code I came up with. It has not been fully tested, but the parts I have used in my script work now.

Basically three problems came up. The targeting was not closed after an add, the gump was not closed when finished, and the is no exit point in the actual key subroutine other than an error.

Code: Select all

    ; Crafter Key's Sub
    ; by BlaZe Budd of Excelsior's ßud ßrothers
    ; v0.8b completed 2/14/09
    ;
    ;
    ; USAGE:
    ;   gosub key %1 %2 %3 %4
    ;
    ;   %1 = metal, tailor, stone, wood, caster
    ;   %2 = add / remove
    ;   %3 = what to add / remove (you can use 'all' to ADD everything possible)
    ;   %4 = how many to REMOVE (times to click the button)
    ;
    ; EXAMPLES
    ;   gosub key wood remove board 10 (removes 1000 plain wood)
    ;   gosub key caster remove nightshade 3 (removes 300 nightshade)
    ;   gosub key metal add all (adds all ingots)
    ;
    ; ITEM LIST
    ; These are the recognized items used for %3:
    ;
    ; Metal/Stone:
    ;   iron, dull, shadow, copper, bronze, gold, agapite, verite,
    ;   valorite, blaze, ice, toxic, electrum, platinum
    ;
    ; Wood:
    ;   board, pine, ash, mohog, yew, oak, zircote, bamboo,
    ;   purple, redwood, petrified, arrow, bolt, feather, shaft
    ;
    ; Tailor:
    ;   leather, spined, horned, barbed, polar, synthetic, blaze, daemonic, shadow, frost, ethereal, cut, folded, bolt, spool,
    ;   red, yellow, black, green, white, blue, copper, silver, gold, yarn, wool, cotton
    ;
    ; Caster:
    ;   pearl, moss, garlic, ginseng, mandrake, nightshade, ash, silk, batwing, grave, blood, crystal, pig, dirt, fungus,
    ;   bone, daemon, keg, scroll, bottle, sand, ring, wax, water, wood, angel, powder
    ;
    ; Note that this script DOES NOT CHECK YOUR WEIGHT
    ; when using the 'remove' command. You have been warned!
    ;
    ;
    ; VARIABLES USED:
    ;   %1 %2 %3 %4
    ;   %tailorThings %woodThings %casterThings
    ;   %menu %done %click %row %button
    ;   %X %Y %clickX %clickY
    ;
    ;
    ; Comments/questions/concerns? [pm BlaZe or post in the forums
    ;
    ;;;;;;;;;;;;;;;;;


    ;;;;; Start ;;;;;
    sub key
    if %done = #true
    {
       set %done = #false
       return
    }
    set %tailorThings JJG_STO_BUI_CUI_OFF_ZZF_UAG_NFF_QEK_QLF
    set %woodThings TLK_RWF_LNK_SLK_VLK_ZLK
    set %casterThings IND_PLF_WLF_DPF_QMJ_GUF_OZF_NZF_TTO_ETH_WUF_YZF_UZF_TZF_DUF_IUF_JUF_RZF_KUF_SZF_WZF_KZF_MZF_JZF_TZF_NUI_KSG
    set %lTargetKind #lTargetKind
    set #lTargetKind 1

    ;;;;; Finding the specified key ;;;;;
    findKeyLoop:

    findItem NUI C_ , #backpackID
    if #findKind = -1
       gosub uhoh 1
    event property #findID
    if metal in %1 && Metal in #property
    {
       set %menu 505_270
       gosub metalKeys
    }
    if wood in %1 && Wood in #property
    {
       set %menu 505_295
       gosub woodKeys
    }
    if tailor in %1 && Tailor in #property
    {
       set %menu 505_440
       gosub tailorKeys
    }
    if stone in %1 && Stone in #property
    {
       set %menu 505_270
       gosub stoneKeys
    }
    if caster in %1 && Caster in #property
    {
       set %menu 505_455
       gosub casterKeys
    }
    if %1 = N/A
       gosub uhoh 2
    if %done = #true  ; added tg 30-jul-2009
    {
       set #lTargetKind %lTargetKind  ; restore lTargetKind
       return
    }
    ignoreitem #findID
    goto findKeyLoop

    ;;;;; Error messages ;;;;;
    sub uhoh
    if %1 = 1
      event exMsg #charID 3 0 + NO KEYS +
    if %1 = 2
      event exMsg #charID 3 0 + KEY NOT SPECIFIED +
    if %1 = 3
      event exMsg #charID 3 0 + ITEM NOT SPECIFIED +
    stop

    ;;;;; 'Waits' for key menu ;;;
    sub keyMenu
    keyLoop:
    wait 1
    if #contSize <> %menu
       goto keyLoop
    return

    ;;;;; Metal ;;;;;
    sub metalKeys
    set #lObjectID #findID
    event macro 17 0
    gosub keyMenu

    if iron in %3
       {
       set %row 1
       set %button 1
       }
    if dull in %3
       {
       set %row 1
       set %button 2
       }
    if shadow in %3
       {
       set %row 1
       set %button 3
       }
    if copper in %3
       {
       set %row 1
       set %button 4
       }
    if bronze in %3
       {
       set %row 1
       set %button 5
       }
    if gold in %3
       {
       set %row 1
       set %button 6
       }
    if agapite in %3
       {
       set %row 1
       set %button 7
       }
    if verite in %3
       {
       set %row 1
       set %button 8
       }
    if valorite in %3
       {
       set %row 2
       set %button 1
       }
    if blaze in %3
       {
       set %row 2
       set %button 2
       }
    if ice in %3
       {
       set %row 2
       set %button 3
       }
    if toxic in %3
       {
       set %row 2
       set %button 4
       }
    if electrum in %3
       {
       set %row 2
       set %button 5
       }
    if platinum in %3
       {
       set %row 2
       set %button 6
       }
    if add in %2
       {
       set %row 2
       set %button 8
       }
    gosub setXY
    if add in %2
       gosub metalAdd
    if remove in %2
       gosub remove
    else
       gosub uhoh 3
    click %clickX %clickY r  ; added tg 30-jul-2009
    set %done #true
    return

    sub metalAdd
    click %clickX %clickY
    target
    metalAddLoop:
    finditem ENK C_ , #backpackID
    if #findKind = -1
    {
       key ESC  ; added tg 30-jul-2009
       wait 1   ; to cancel targeting
      return
    }
    event property #findID
    if iron in %3 && shadow in #property
       {
       ignoreitem #findID
       goto metalAddLoop
       }
    if %3 in #property || all in %3
       {
       set #lTargetID #findID
       event macro 22 0
       target
       }
    else
       ignoreitem #findID
    goto metalAddLoop


    ;;;;; Stone ;;;;;
    sub stoneKeys
    set #lObjectID #findID
    event macro 17 0
    gosub keyMenu

    if iron in %3
       {
       set %row 1
       set %button 1
       }
    if dull in %3
       {
       set %row 1
       set %button 2
       }
    if shadow in %3
       {
       set %row 1
       set %button 3
       }
    if copper in %3
       {
       set %row 1
       set %button 4
       }
    if bronze in %3
       {
       set %row 1
       set %button 5
       }
    if gold in %3
       {
       set %row 1
       set %button 6
       }
    if agapite in %3
       {
       set %row 1
       set %button 7
       }
    if verite in %3
       {
       set %row 1
       set %button 8
       }
    if valorite in %3
       {
       set %row 2
       set %button 1
       }
    if blaze in %3
       {
       set %row 2
       set %button 2
       }
    if ice in %3
       {
       set %row 2
       set %button 3
       }
    if toxic in %3
       {
       set %row 2
       set %button 4
       }
    if electrum in %3
       {
       set %row 2
       set %button 5
       }
    if platinum in %3
       {
       set %row 2
       set %button 6
       }
    if add in %2
       {
       set %row 2
       set %button 8
       }
    gosub setXY
    if add in %2
       gosub stoneAdd
    if remove in %2
       gosub remove
    else
       gosub uhoh 3
    click %clickX %clickY r  ; added tg 30-jul-2009
    set %done #true
    return

    sub stoneAdd
    click %clickX %clickY
    target
    stoneAddLoop:
    finditem BVI C_ , #backpackID
    if #findKind = -1
    {
       key ESC  ; added tg 30-jul-2009
       wait 1   ; to cancel targeting
      return
    }
    event property #findID
    if %3 in #property || all in %3
       {
       set #lTargetID #findID
       event macro 22 0
       target
       }
    else
       ignoreitem #findID
    goto stoneAddLoop


    ;;;;; Wood ;;;;;
    sub woodKeys
    set #lObjectID #findID
    event macro 17 0
    gosub keyMenu

    if board in %3
       {
       set %row 1
       set %button 1
       }
    if pine in %3
       {
       set %row 1
       set %button 2
       }
    if ash in %3
       {
       set %row 1
       set %button 3
       }
    if mohog in %3
       {
       set %row 1
       set %button 4
       }
    if yew in %3
       {
       set %row 1
       set %button 5
       }
    if oak in %3
       {
       set %row 1
       set %button 6
       }
    if zircote in %3
       {
       set %row 1
       set %button 7
       }
    if ebony in %3
       {
       set %row 1
       set %button 8
       }
    if bamboo in %3
       {
       set %row 1
       set %button 9
       }
    if purple in %3
       {
       set %row 2
       set %button 1
       }
    if redwood in %3
       {
       set %row 2
       set %button 2
       }
    if petrified in %3
       {
       set %row 2
       set %button 3
       }
    if arrow in %3
       {
       set %row 2
       set %button 4
       }
    if bolt in %3
       {
       set %row 2
       set %button 5
       }
    if feather in %3
       {
       set %row 2
       set %button 6
       }
    if shaft in %3
       {
       set %row 2
       set %button 7
       }
    if add in %2
       {
       set %row 2
       set %button 9
       }
    gosub setXY
    if add in %2
       gosub woodAdd
    if remove in %2
       gosub remove
    else
       gosub uhoh 3
    click %clickX %clickY r  ; added tg 30-jul-2009
    set %done #true
    return

    sub woodAdd
    click %clickX %clickY
    target
    woodAddLoop:
    finditem %woodThings C_ , #backpackID
    if #findKind = -1
    {
       key ESC  ; added tg 30-jul-2009
       wait 1   ; to cancel targeting
      return
    }
    event property #findID
    if board in %3 && ( pine in #property || ash in #property || mohogany in #property || yew in #property || oak in #property || zircote in #property || ebony in #property || bamboo in #property || purple in #property || redwood in #property || petrified in #property )
       {
       ignoreitem #findID
       goto woodAddLoop
       }
    if %3 in #property || all in %3 || ( board in %3 && log in #property )
       {
       set #lTargetID #findID
       event macro 22 0
       target
       }
    else
       ignoreitem #findID
    goto woodAddLoop


    ;;;;; Tailor Keys ;;;;;
    sub tailorKeys
    set #lObjectID #findID
    event macro 17 0
    gosub keyMenu

    if leather in %3
       {
       set %row 1
       set %button 1
       }
    if spined in %3
       {
       set %row 1
       set %button 2
       }
    if horned in %3
       {
       set %row 1
       set %button 3
       }
    if barbed in %3
       {
       set %row 1
       set %button 4
       }
    if polar in %3
       {
       set %row 1
       set %button 5
       }
    if synthetic in %3
       {
       set %row 1
       set %button 6
       }
    if blaze in %3
       {
       set %row 1
       set %button 7
       }
    if daemonic in %3
       {
       set %row 1
       set %button 8
       }
    if shadow in %3
       {
       set %row 1
       set %button 9
       }
    if frost in %3
       {
       set %row 1
       set %button 10
       }
    if ethereal in %3
       {
       set %row 1
       set %button 11
       }
    if cut in %3
       {
       set %row 1
       set %button 12
       }
    if folded in %3
       {
       set %row 1
       set %button 13
       }
    if bolt in %3
       {
       set %row 1
       set %button 14
       }
    if spool in %3
       {
       set %row 1
       set %button 15
       }

    if red in %3
       {
       set %row 2
       set %button 1
       }
    if yellow in %3
       {
       set %row 2
       set %button 2
       }
    if black in %3
       {
       set %row 2
       set %button 3
       }
    if green in %3
       {
       set %row 2
       set %button 4
       }
    if white in %3
       {
       set %row 2
       set %button 5
       }
    if blue in %3
       {
       set %row 2
       set %button 6
       }
    if copper in %3
       {
       set %row 2
       set %button 7
       }
    if silver in %3
       {
       set %row 2
       set %button 8
       }
    if gold in %3
       {
       set %row 2
       set %button 9
       }
    if yarn in %3
       {
       set %row 2
       set %button 10
       }
    if wool in %3
       {
       set %row 2
       set %button 11
       }
    if cotton in %3
       {
       set %row 2
       set %button 12
       }
    if add in %2
       {
       set %row 2
       set %button 15
       }
    gosub setXY
    if add in %2
       gosub tailorAdd
    if remove in %2
       gosub remove
    else
       gosub uhoh 3
    click %clickX %clickY r  ; added tg 30-jul-2009
    set %done #true
    return

    sub tailorAdd
    click %clickX %clickY
    target
    tailorAddLoop:
    finditem %tailorThings C_ , #backpackID
    if #findKind = -1
    {
       key ESC  ; added tg 30-jul-2009
       wait 1   ; to cancel targeting
      return
    }
    event property #findID
    if leather in %3 && ( spined in #property || horned in #property || barbed in #property || polar in #property || synthetic in #property || blaze in #property || daemonic in #property || shadow in #property || frost in #property || ethereal in #property )
       {
       ignoreitem #findid
       goto tailorAddLoop
       }
    if %3 in #property || all in %3
       {
       set #lTargetID #findID
       event macro 22 0
       target
       }
    else
       ignoreitem #findID
    goto tailorAddLoop


    ;;;;; Caster Keys ;;;;;
    sub casterKeys
    set #lObjectID #findID
    event macro 17 0
    gosub keyMenu

    if pearl in %3
       {
       set %row 1
       set %button 1
       }
    if moss in %3
       {
       set %row 1
       set %button 2
       }
    if garlic in %3
       {
       set %row 1
       set %button 3
       }
    if ginseng in %3
       {
       set %row 1
       set %button 4
       }
    if mandrake in %3
       {
       set %row 1
       set %button 5
       }
    if nightshade in %3
       {
       set %row 1
       set %button 6
       }
    if ash in %3
       {
       set %row 1
       set %button 7
       }
    if silk in %3
       {
       set %row 1
       set %button 8
       }
    if batwing in %3
       {
       set %row 1
       set %button 9
       }
    if grave in %3
       {
       set %row 1
       set %button 10
       }
    if blood in %3
       {
       set %row 1
       set %button 11
       }
    if crystal in %3
       {
       set %row 1
       set %button 12
       }
    if pig in %3
       {
       set %row 1
       set %button 13
       }
    if dirt in %3
       {
       set %row 1
       set %button 14
       }
    if fungus in %3
       {
       set %row 1
       set %button 15
       }
    if bone in %3
       {
       set %row 2
       set %button 1
       }
    if daemon in %3
       {
       set %row 2
       set %button 2
       }
    if keg in %3
       {
       set %row 2
       set %button 3
       }
    if scroll in %3
       {
       set %row 2
       set %button 4
       }
    if bottle in %3
       {
       set %row 2
       set %button 5
       }
    if sand in %3
       {
       set %row 2
       set %button 6
       }
    if ring in %3
       {
       set %row 2
       set %button 7
       }
    if wax in %3
       {
       set %row 2
       set %button 8
       }
    if water in %3
       {
       set %row 2
       set %button 9
       }
    if wood in %3
       {
       set %row 2
       set %button 10
       }
    if angel in %3
       {
       set %row 2
       set %button 11
       }
    if powder in %3
       {
       set %row 2
       set %button 12
       }
    if add in %2
       {
       set %row 2
       set %button 15
       }
    gosub setXY
    if add in %2
       gosub casterAdd
    if remove in %2
       gosub remove
    else
       gosub uhoh 3
    click %clickX %clickY r  ; added tg 30-jul-2009
    set %done #true
    return

    sub casterAdd
    click %clickX %clickY
    target
    casterAddLoop:
    finditem %casterThings C_ , #backpackID
    if #findKind = -1
    {
       key ESC  ; added tg 30-jul-2009
       wait 1   ; to cancel targeting
      return
    }
    event property #findID
    if keys in #property || ( bones in %3 && daemon in #property ) || ( keg in %3 && empty notin #property ) || ( bottle in %3 && dirty in #property ) || ( dirt in %3 && fertile notin #property )
       {
       ignoreitem #findID
       goto casterAddLoop
       }
    if %3 in #property || all in %3
       {
       set #lTargetID #findID
       event macro 22 0
       target
       }
    else
       ignoreitem #findID
    goto casterAddLoop


    ;;;;; The remove sub... duh ;;;;;
    sub remove
    set %click 0
    while %click < %4
       {
       click %clickX %clickY
       gosub keyMenu
       set %click %click + 1
       }
    return


    ;;;;; Sets the X/Y position of the button we want to click ;;;;;
    sub setXY
    if %row = 1
       set %X 90
    if %row = 2
       set %X 290
    if %button = 1
       set %Y 60
    if %button = 2
       set %Y 85
    if %button = 3
       set %Y 110
    if %button = 4
       set %Y 135
    if %button = 5
       set %Y 160
    if %button = 6
       set %Y 185
    if %button = 7
       set %Y 210
    if %button = 8
       set %Y 235
    if %button = 9
       set %Y 260
    if %button = 10
       set %Y 285
    if %button = 11
       set %Y 310
    if %button = 12
       set %Y 335
    if %button = 13
       set %Y 360
    if %button = 14
       set %Y 385
    if %button = 15
       set %Y 415  ; <- Offset for Caster Keys
    set %clickX #contPosX + %X
    set %clickY #contPosY + %Y
    return
User avatar
BlaZe
Legendary Scribe
Posts: 402
Joined: Thu Dec 25, 2008 12:54 am
Location: Ann Arbor, MI; USA

Re: [EasyUO] Crafter Keys Sub

Post by BlaZe »

ticketguru wrote:I found some problems when I tried to implement it in my own scripts. Here is the updated code I came up with.
Thanks for the fixes, I re-posted your updated code in the original post.

I haven't even looked at this sub since the last update until a couple days ago when someone asked me for some help with it. I'll be moving into my new trailer in 10 days - I plan on revising/updating a few submissions, this one included, when I'm settled in.
EasyUO Devotee
Download
My Popular ScripZ
Pet FightR | Doorman | TrainR: Lockpicking | HealR
User avatar
Ilsanor
Legendary Scribe
Posts: 407
Joined: Tue Jun 07, 2011 5:47 am

Re: [EasyUO] Crafter Keys Sub

Post by Ilsanor »

Ok, I tried to use the wood keys part of this script to work with CP's LJ radar, and almost got it. The problem is that after adding all the logs to wood keys (via the "sub key wood add all" command)the script gives ITEM NOT SPECIFIED message and freezes. I didn't touch the item definitions on the original script (yet). Any ideas what did I do wrong?
DentonA
Passer by
Posts: 3
Joined: Sun Aug 14, 2011 7:06 pm

Re: [EasyUO] Crafter Keys Sub

Post by DentonA »

There is the fixed code:

Code: Select all

    ; Crafter Key's Sub
    ; by BlaZe Budd of Excelsior's ?ud ?rothers
    ; v0.8c completed 7/31/10 (fixes by ticketguru, DentonA)
    ;
    ;
    ; USAGE:
    ;   gosub key %1 %2 %3 %4
    ;
    ;   %1 = metal, tailor, stone, wood, caster
    ;   %2 = add / remove
    ;   %3 = what to add / remove (you can use 'all' to ADD everything possible)
    ;   %4 = how many to REMOVE (times to click the button)
    ;
    ; EXAMPLES
    ;   gosub key wood remove board 10 (removes 1000 plain wood)
    ;   gosub key caster remove nightshade 3 (removes 300 nightshade)
    ;   gosub key metal add all (adds all ingots)
    ;
    ; ITEM LIST
    ; These are the recognized items used for %3:
    ;
    ; Metal/Stone:
    ;   iron, dull, shadow, copper, bronze, gold, agapite, verite,
    ;   valorite, blaze, ice, toxic, electrum, platinum
    ;
    ; Wood:
    ;   board, pine, ash, mohog, yew, oak, zircote, bamboo,
    ;   purple, redwood, petrified, arrow, bolt, feather, shaft
    ;
    ; Tailor:
    ;   leather, spined, horned, barbed, polar, synthetic, blaze, daemonic, shadow, frost, ethereal, cut, folded, bolt, spool,
    ;   red, yellow, black, green, white, blue, copper, silver, gold, yarn, wool, cotton
    ;
    ; Caster:
    ;   pearl, moss, garlic, ginseng, mandrake, nightshade, ash, silk, batwing, grave, blood, crystal, pig, dirt, fungus,
    ;   bone, daemon, keg, scroll, bottle, sand, ring, wax, water, wood, angel, powder
    ;
    ; Note that this script DOES NOT CHECK YOUR WEIGHT
    ; when using the 'remove' command. You have been warned!
    ;
    ;
    ; VARIABLES USED:
    ;   %1 %2 %3 %4
    ;   %tailorThings %woodThings %casterThings
    ;   %menu %done %click %row %button
    ;   %X %Y %clickX %clickY
    ;
    ;
    ; Comments/questions/concerns? [pm BlaZe or post in the forums
    ;
    ;;;;;;;;;;;;;;;;;


    ;;;;; Start ;;;;;
    sub key
    if %done = #true
    {
       set %done = #false
       return
    }
    set %tailorThings JJG_STO_BUI_CUI_OFF_ZZF_UAG_NFF_QEK_QLF
    set %woodThings TLK_RWF_LNK_SLK_VLK_ZLK
    set %casterThings IND_PLF_WLF_DPF_QMJ_GUF_OZF_NZF_TTO_ETH_WUF_YZF_UZF_TZF_DUF_IUF_JUF_RZF_KUF_SZF_WZF_KZF_MZF_JZF_TZF_NUI_KSG
    set %lTargetKind #lTargetKind
    set #lTargetKind 1

    ;;;;; Finding the specified key ;;;;;
    findKeyLoop:

    findItem NUI C_ , #backpackID
    if #findKind = -1
       gosub uhoh 1
    event property #findID
    if metal in %1 && Metal in #property
    {
       set %menu 505_270
       gosub metalKeys
    }
    if wood in %1 && Wood in #property
    {
       set %menu 505_295
       gosub woodKeys
    }
    if tailor in %1 && Tailor in #property
    {
       set %menu 505_440
       gosub tailorKeys
    }
    if stone in %1 && Stone in #property
    {
       set %menu 505_270
       gosub stoneKeys
    }
    if caster in %1 && Caster in #property
    {
       set %menu 505_455
       gosub casterKeys
    }
    if %1 = N/A
       gosub uhoh 2
    if %done = #true  ; added tg 30-jul-2009
    {
       set #lTargetKind %lTargetKind  ; restore lTargetKind
       return
    }
    ignoreitem #findID
    goto findKeyLoop

    ;;;;; Error messages ;;;;;
    sub uhoh
    if %1 = 1
      event exMsg #charID 3 0 + NO KEYS +
    if %1 = 2
      event exMsg #charID 3 0 + KEY NOT SPECIFIED +
    if %1 = 3
      event exMsg #charID 3 0 + ITEM NOT SPECIFIED +
    stop

    ;;;;; 'Waits' for key menu ;;;
    sub keyMenu
    keyLoop:
    wait 1
    if #contSize <> %menu
       goto keyLoop
    return

    ;;;;; Metal ;;;;;
    sub metalKeys
    set #lObjectID #findID
    event macro 17 0
    gosub keyMenu

    if iron in %3
       {
       set %row 1
       set %button 1
       }
    if dull in %3
       {
       set %row 1
       set %button 2
       }
    if shadow in %3
       {
       set %row 1
       set %button 3
       }
    if copper in %3
       {
       set %row 1
       set %button 4
       }
    if bronze in %3
       {
       set %row 1
       set %button 5
       }
    if gold in %3
       {
       set %row 1
       set %button 6
       }
    if agapite in %3
       {
       set %row 1
       set %button 7
       }
    if verite in %3
       {
       set %row 1
       set %button 8
       }
    if valorite in %3
       {
       set %row 2
       set %button 1
       }
    if blaze in %3
       {
       set %row 2
       set %button 2
       }
    if ice in %3
       {
       set %row 2
       set %button 3
       }
    if toxic in %3
       {
       set %row 2
       set %button 4
       }
    if electrum in %3
       {
       set %row 2
       set %button 5
       }
    if platinum in %3
       {
       set %row 2
       set %button 6
       }
    if add in %2
       {
       set %row 2
       set %button 8
       }
    gosub setXY
    if add in %2
       gosub metalAdd
    if remove in %2
       gosub remove
    if ! remove in %2 && ! add in %2
       gosub uhoh 3
    click %clickX %clickY r  ; added tg 30-jul-2009
    set %done #true
    return

    sub metalAdd
    click %clickX %clickY
    target
    metalAddLoop:
    finditem ENK C_ , #backpackID
    if #findKind = -1
    {
       key ESC  ; added tg 30-jul-2009
       wait 1   ; to cancel targeting
      return
    }
    event property #findID
    if iron in %3 && shadow in #property
       {
       ignoreitem #findID
       goto metalAddLoop
       }
    if %3 in #property || all in %3
       {
       set #lTargetID #findID
       event macro 22 0
       target
       }
    else
       ignoreitem #findID
    goto metalAddLoop


    ;;;;; Stone ;;;;;
    sub stoneKeys
    set #lObjectID #findID
    event macro 17 0
    gosub keyMenu

    if iron in %3
       {
       set %row 1
       set %button 1
       }
    if dull in %3
       {
       set %row 1
       set %button 2
       }
    if shadow in %3
       {
       set %row 1
       set %button 3
       }
    if copper in %3
       {
       set %row 1
       set %button 4
       }
    if bronze in %3
       {
       set %row 1
       set %button 5
       }
    if gold in %3
       {
       set %row 1
       set %button 6
       }
    if agapite in %3
       {
       set %row 1
       set %button 7
       }
    if verite in %3
       {
       set %row 1
       set %button 8
       }
    if valorite in %3
       {
       set %row 2
       set %button 1
       }
    if blaze in %3
       {
       set %row 2
       set %button 2
       }
    if ice in %3
       {
       set %row 2
       set %button 3
       }
    if toxic in %3
       {
       set %row 2
       set %button 4
       }
    if electrum in %3
       {
       set %row 2
       set %button 5
       }
    if platinum in %3
       {
       set %row 2
       set %button 6
       }
    if add in %2
       {
       set %row 2
       set %button 8
       }
    gosub setXY
    if add in %2
       gosub stoneAdd
    if remove in %2
       gosub remove
    if ! remove in %2 && ! add in %2
       gosub uhoh 3
    click %clickX %clickY r  ; added tg 30-jul-2009
    set %done #true
    return

    sub stoneAdd
    click %clickX %clickY
    target
    stoneAddLoop:
    finditem BVI C_ , #backpackID
    if #findKind = -1
    {
       key ESC  ; added tg 30-jul-2009
       wait 1   ; to cancel targeting
      return
    }
    event property #findID
    if %3 in #property || all in %3
       {
       set #lTargetID #findID
       event macro 22 0
       target
       }
    else
       ignoreitem #findID
    goto stoneAddLoop


    ;;;;; Wood ;;;;;
    sub woodKeys
    set #lObjectID #findID
    event macro 17 0
    gosub keyMenu

    if board in %3
       {
       set %row 1
       set %button 1
       }
    if pine in %3
       {
       set %row 1
       set %button 2
       }
    if ash in %3
       {
       set %row 1
       set %button 3
       }
    if mohog in %3
       {
       set %row 1
       set %button 4
       }
    if yew in %3
       {
       set %row 1
       set %button 5
       }
    if oak in %3
       {
       set %row 1
       set %button 6
       }
    if zircote in %3
       {
       set %row 1
       set %button 7
       }
    if ebony in %3
       {
       set %row 1
       set %button 8
       }
    if bamboo in %3
       {
       set %row 1
       set %button 9
       }
    if purple in %3
       {
       set %row 2
       set %button 1
       }
    if redwood in %3
       {
       set %row 2
       set %button 2
       }
    if petrified in %3
       {
       set %row 2
       set %button 3
       }
    if arrow in %3
       {
       set %row 2
       set %button 4
       }
    if bolt in %3
       {
       set %row 2
       set %button 5
       }
    if feather in %3
       {
       set %row 2
       set %button 6
       }
    if shaft in %3
       {
       set %row 2
       set %button 7
       }
    if add in %2
       {
       set %row 2
       set %button 9
       }
    gosub setXY
    if add in %2
       gosub woodAdd
    if remove in %2
       gosub remove
    if ! remove in %2 && ! add in %2
       gosub uhoh 3
    click %clickX %clickY r  ; added tg 30-jul-2009
    set %done #true
    return

    sub woodAdd
    click %clickX %clickY
    target
    woodAddLoop:
    finditem %woodThings C_ , #backpackID
    if #findKind = -1
    {
       key ESC  ; added tg 30-jul-2009
       wait 1   ; to cancel targeting
      return
    }
    event property #findID
    if board in %3 && ( pine in #property || ash in #property || mohogany in #property || yew in #property || oak in #property || zircote in #property || ebony in #property || bamboo in #property || purple in #property || redwood in #property || petrified in #property )
       {
       ignoreitem #findID
       goto woodAddLoop
       }
    if %3 in #property || all in %3 || ( board in %3 && log in #property )
       {
       set #lTargetID #findID
       event macro 22 0
       target
       }
    else
       ignoreitem #findID
    goto woodAddLoop


    ;;;;; Tailor Keys ;;;;;
    sub tailorKeys
    set #lObjectID #findID
    event macro 17 0
    gosub keyMenu

    if leather in %3
       {
       set %row 1
       set %button 1
       }
    if spined in %3
       {
       set %row 1
       set %button 2
       }
    if horned in %3
       {
       set %row 1
       set %button 3
       }
    if barbed in %3
       {
       set %row 1
       set %button 4
       }
    if polar in %3
       {
       set %row 1
       set %button 5
       }
    if synthetic in %3
       {
       set %row 1
       set %button 6
       }
    if blaze in %3
       {
       set %row 1
       set %button 7
       }
    if daemonic in %3
       {
       set %row 1
       set %button 8
       }
    if shadow in %3
       {
       set %row 1
       set %button 9
       }
    if frost in %3
       {
       set %row 1
       set %button 10
       }
    if ethereal in %3
       {
       set %row 1
       set %button 11
       }
    if cut in %3
       {
       set %row 1
       set %button 12
       }
    if folded in %3
       {
       set %row 1
       set %button 13
       }
    if bolt in %3
       {
       set %row 1
       set %button 14
       }
    if spool in %3
       {
       set %row 1
       set %button 15
       }

    if red in %3
       {
       set %row 2
       set %button 1
       }
    if yellow in %3
       {
       set %row 2
       set %button 2
       }
    if black in %3
       {
       set %row 2
       set %button 3
       }
    if green in %3
       {
       set %row 2
       set %button 4
       }
    if white in %3
       {
       set %row 2
       set %button 5
       }
    if blue in %3
       {
       set %row 2
       set %button 6
       }
    if copper in %3
       {
       set %row 2
       set %button 7
       }
    if silver in %3
       {
       set %row 2
       set %button 8
       }
    if gold in %3
       {
       set %row 2
       set %button 9
       }
    if yarn in %3
       {
       set %row 2
       set %button 10
       }
    if wool in %3
       {
       set %row 2
       set %button 11
       }
    if cotton in %3
       {
       set %row 2
       set %button 12
       }
    if add in %2
       {
       set %row 2
       set %button 15
       }
    gosub setXY
    if add in %2
       gosub tailorAdd
    if remove in %2
       gosub remove
    if ! remove in %2 && ! add in %2
       gosub uhoh 3
    click %clickX %clickY r  ; added tg 30-jul-2009
    set %done #true
    return

    sub tailorAdd
    click %clickX %clickY
    target
    tailorAddLoop:
    finditem %tailorThings C_ , #backpackID
    if #findKind = -1
    {
       key ESC  ; added tg 30-jul-2009
       wait 1   ; to cancel targeting
      return
    }
    event property #findID
    if leather in %3 && ( spined in #property || horned in #property || barbed in #property || polar in #property || synthetic in #property || blaze in #property || daemonic in #property || shadow in #property || frost in #property || ethereal in #property )
       {
       ignoreitem #findid
       goto tailorAddLoop
       }
    if %3 in #property || all in %3
       {
       set #lTargetID #findID
       event macro 22 0
       target
       }
    else
       ignoreitem #findID
    goto tailorAddLoop


    ;;;;; Caster Keys ;;;;;
    sub casterKeys
    set #lObjectID #findID
    event macro 17 0
    gosub keyMenu

    if pearl in %3
       {
       set %row 1
       set %button 1
       }
    if moss in %3
       {
       set %row 1
       set %button 2
       }
    if garlic in %3
       {
       set %row 1
       set %button 3
       }
    if ginseng in %3
       {
       set %row 1
       set %button 4
       }
    if mandrake in %3
       {
       set %row 1
       set %button 5
       }
    if nightshade in %3
       {
       set %row 1
       set %button 6
       }
    if ash in %3
       {
       set %row 1
       set %button 7
       }
    if silk in %3
       {
       set %row 1
       set %button 8
       }
    if batwing in %3
       {
       set %row 1
       set %button 9
       }
    if grave in %3
       {
       set %row 1
       set %button 10
       }
    if blood in %3
       {
       set %row 1
       set %button 11
       }
    if crystal in %3
       {
       set %row 1
       set %button 12
       }
    if pig in %3
       {
       set %row 1
       set %button 13
       }
    if dirt in %3
       {
       set %row 1
       set %button 14
       }
    if fungus in %3
       {
       set %row 1
       set %button 15
       }
    if bone in %3
       {
       set %row 2
       set %button 1
       }
    if daemon in %3
       {
       set %row 2
       set %button 2
       }
    if keg in %3
       {
       set %row 2
       set %button 3
       }
    if scroll in %3
       {
       set %row 2
       set %button 4
       }
    if bottle in %3
       {
       set %row 2
       set %button 5
       }
    if sand in %3
       {
       set %row 2
       set %button 6
       }
    if ring in %3
       {
       set %row 2
       set %button 7
       }
    if wax in %3
       {
       set %row 2
       set %button 8
       }
    if water in %3
       {
       set %row 2
       set %button 9
       }
    if wood in %3
       {
       set %row 2
       set %button 10
       }
    if angel in %3
       {
       set %row 2
       set %button 11
       }
    if powder in %3
       {
       set %row 2
       set %button 12
       }
    if add in %2
       {
       set %row 2
       set %button 15
       }
    gosub setXY
    if add in %2
       gosub casterAdd
    if remove in %2
       gosub remove
    if ! remove in %2 && ! add in %2
       gosub uhoh 3
    click %clickX %clickY r  ; added tg 30-jul-2009
    set %done #true
    return

    sub casterAdd
    click %clickX %clickY
    target
    casterAddLoop:
    finditem %casterThings C_ , #backpackID
    if #findKind = -1
    {
       key ESC  ; added tg 30-jul-2009
       wait 1   ; to cancel targeting
      return
    }
    event property #findID
    if keys in #property || ( bones in %3 && daemon in #property ) || ( keg in %3 && empty notin #property ) || ( bottle in %3 && dirty in #property ) || ( dirt in %3 && fertile notin #property )
       {
       ignoreitem #findID
       goto casterAddLoop
       }
    if %3 in #property || all in %3
       {
       set #lTargetID #findID
       event macro 22 0
       target
       }
    else
       ignoreitem #findID
    goto casterAddLoop


    ;;;;; The remove sub... duh ;;;;;
    sub remove
    set %click 0
    while %click < %4
       {
       click %clickX %clickY
       gosub keyMenu
       set %click %click + 1
       }
    return


    ;;;;; Sets the X/Y position of the button we want to click ;;;;;
    sub setXY
    if %row = 1
       set %X 90
    if %row = 2
       set %X 290
    if %button = 1
       set %Y 60
    if %button = 2
       set %Y 85
    if %button = 3
       set %Y 110
    if %button = 4
       set %Y 135
    if %button = 5
       set %Y 160
    if %button = 6
       set %Y 185
    if %button = 7
       set %Y 210
    if %button = 8
       set %Y 235
    if %button = 9
       set %Y 260
    if %button = 10
       set %Y 285
    if %button = 11
       set %Y 310
    if %button = 12
       set %Y 335
    if %button = 13
       set %Y 360
    if %button = 14
       set %Y 385
    if %button = 15
       set %Y 415  ; <- Offset for Caster Keys
    set %clickX #contPosX + %X
    set %clickY #contPosY + %Y
    return
Locked