[UOSteam] Training Bowcraft
Posted: Fri Aug 03, 2018 10:51 pm
I've been playing UOEX for some time now, this is my first post here on the forums. I enjoy writing UOSteam macros and figured it was time to start sharing some of them. I wrote this one to automate the training of the Bowcraft/Fletching skill.
Feedback is appreciated.
Ghurdo
Feedback is appreciated.
Ghurdo
Code: Select all
// ********************************************************
// * Training Bowcraft (Excelsior Shard)
// *
// * Written by Ghurdo
// * Last Update: 3 August 2018
// *
// * SETUP: Start with a stack of boards and fletching tools. Preset
// * the fletching tools to the color of the boards being used.
// * High use fletching tools are recommended.
// *
// * NOTE: This macro may destroy your bow. Be sure to bank or otherwise
// * safely store any ranged weapons you don't want chopped up.
// *
// ********************************************************
//
if skill 'Bowcraft' < 30
headmsg 'buy skill from NPC'
sysmsg 'buy 30.0 Bowcraft skill from NPC.'
stop
endif
// Create an anti-spam message timer
if not timerexists 'timerMsg'
createtimer 'timerMsg'
endif
@settimer 'timerMsg' 9999
// set up the crafted item skill gain lists
@removelist 'bowcraftSkill'
@createlist 'bowcraftSkill'
@removelist 'bowcraftText'
@createlist 'bowcraftText'
@removelist 'bowcraftBtn'
@createlist 'bowcraftBtn'
@removelist 'bowcraftMats'
@createlist 'bowcraftMats'
@removelist 'bowcraftGrfx'
@createlist 'bowcraftGrfx'
// buy from NPC
@pushlist 'bowcraftSkill' 30
@pushlist 'bowcraftText' 'buy from NPC (0-30)'
@pushlist 'bowcraftBtn' 0
@pushlist 'bowcraftMats' 0
@pushlist 'bowcraftGrfx' 0
// Bow (30-60)
@pushlist 'bowcraftSkill' 60
@pushlist 'bowcraftText' 'Bow (30-60)'
@pushlist 'bowcraftBtn' 2
@pushlist 'bowcraftMats' 7
@pushlist 'bowcraftGrfx' 0x13b2
// Crossbow (60-70)
@pushlist 'bowcraftSkill' 70
@pushlist 'bowcraftText' 'Crossbow (60-70)'
@pushlist 'bowcraftBtn' 9
@pushlist 'bowcraftMats' 7
@pushlist 'bowcraftGrfx' 0xf50
// Composite Bow (70-80)
@pushlist 'bowcraftSkill' 80
@pushlist 'bowcraftText' 'Composite Bow (70-80)'
@pushlist 'bowcraftBtn' 23
@pushlist 'bowcraftMats' 10
@pushlist 'bowcraftGrfx' 0x26c2
// Heavy Crossbow (80-90)
@pushlist 'bowcraftSkill' 90
@pushlist 'bowcraftText' 'Heavy Crossbow (80-90)'
@pushlist 'bowcraftBtn' 16
@pushlist 'bowcraftMats' 10
@pushlist 'bowcraftGrfx' 0x13fd
// Repeating Crossbow (90-100)
@pushlist 'bowcraftSkill' 100
@pushlist 'bowcraftText' 'Repeating X-Bow (90-100)'
@pushlist 'bowcraftBtn' 30
@pushlist 'bowcraftMats' 10
@pushlist 'bowcraftGrfx' 0x26c3
// Yumi (100-120)
@pushlist 'bowcraftSkill' 120
@pushlist 'bowcraftText' 'Yumi (100-120)'
@pushlist 'bowcraftBtn' 37
@pushlist 'bowcraftMats' 10
@pushlist 'bowcraftGrfx' 0x27a5
//
// main loop: while fletching tools exist
while @findtype 0x1022 'any' 'backpack'
if skill 'Bowcraft' < bowcraftSkill[0]
// enough wood?
if @findtype 0x1bd7 'any' 'backpack' bowcraftMats[0]
// fletching tool?
if @findtype 0x1022 'any' 'backpack'
pause 250
@useobject 'found'
// slow the spam
if timer 'timerMsg' > 6000
headmsg bowcraftText[0]
settimer 'timerMsg' 0
endif
// make weapon
@replygump 0x38920abd 15
waitforgump 949095101 1500
@replygump 0x38920abd bowcraftBtn[0]
waitforgump 949095101 1500
pause 250
// still have fletching tools?
if not @findtype 0x1022 'any' 'backpack'
@replygump 0x38920abd 0
sysmsg 'fletching tools broke'
headmsg 'fletching tools broke'
stop
endif
// chop to recover boards
@clearjournal
while @findtype bowcraftGrfx[0] 'any' 'backpack'
@replygump 0x38920abd 14
waitfortarget 1500
@target! 'found'
waitforgump 949095101 1500
// ignore insured items
if @injournal 'an insured item' 'system'
headmsg 'insured item ignored' 48
sysmsg 'insured item ignored' 48
@ignoreobject 'found'
endif
// ignore blessed items
if @injournal 'blessed' 'system'
headmsg 'blessed item ignored' 48
sysmsg 'blessed item ignored' 48
@ignoreobject 'found'
endif
endwhile
endif // end fletching tools?
else // out of lumber
@replygump 0x38920abd 0
sysmsg 'not enough lumber'
headmsg 'not enough lumber'
stop
endif // end if enough wood?
else
// skip to next craft/skill list item
@poplist 'bowcraftSkill' 'front'
@poplist 'bowcraftText' 'front'
@poplist 'bowcraftBtn' 'front'
@poplist 'bowcraftMats' 'front'
@poplist 'bowcraftGrfx' 'front'
// out of skill gain options, i.e. maxed out
if list 'bowcraftGrfx' == 0
sysmsg 'Bowcraft/Fletching complete' 64
headmsg 'Bowcraft finished' 64
headmsg '(macro stopped)' 62
stop
endif
endif
endwhile // end main loop
//
// cleanup and stop
@removelist 'bowcraftSkill'
@removelist 'bowcraftText'
@removelist 'bowcraftBtn'
@removelist 'bowcraftMats'
@removelist 'bowcraftGrfx'
@removetimer 'timerMsg'
@replygump 0x38920abd 0
//
sysmsg 'no fletching tools'
headmsg 'no fletching tools'
stop