[EasyUO] Crafter Keys Sub
Posted: Sat Feb 14, 2009 9:08 am
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
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

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