If you make a Client-side script you can publish it here for other players to use
Ghurdo
Apprentice Scribe
Posts: 10 Joined: Fri Aug 03, 2018 10:36 pm
Post
by Ghurdo » 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
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
Alamiester
Legendary Scribe
Posts: 279 Joined: Wed Jan 04, 2017 8:49 pm
Post
by Alamiester » Wed Aug 22, 2018 12:52 am
this is interesting how these are written. i havnt seen alot of uosteam macros written with these unexplained commands the way your using them. do you know the secrets of uosteam, lol
Apothem
Passer by
Posts: 2 Joined: Mon Sep 17, 2018 1:04 am
Post
by Apothem » Mon Sep 17, 2018 1:06 am
I literally registered an account here just to compliment you on your use of lists as a queue to push through the progression of the skill. This is an excellent example, and I learned a lot from this. Thank you!
Apothem
Passer by
Posts: 2 Joined: Mon Sep 17, 2018 1:04 am
Post
by Apothem » Mon Sep 17, 2018 3:36 pm
Sorry for the double post, but I wanted to update this. Please let me know if I should add this in as an edit to my previous post instead.
I have patched this script. This version runs a lot faster and also can use your woodworker's keys if you have them. It will take you all the way to 120 now in a couple of hours on the server. I was thinking about adding support to use tinkering to make new fletcher's tools, but it seems kinda unneeded since we can stack uses of tools via [exex
Let me know what you think!
Code: Select all
// ********************************************************
// * Training Bowcraft (Excelsior Shard)
// *
// * Written by Ghurdo
// * Last Update: 17 September 2018
// * Edited by: Apothem
// *
// * 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? Check if gump is up, otherwise, look for the tool
//and use it
if not gumpexists 0x38920abd
if @findtype 0x1022 'any' 'backpack'
pause 250
@useobject 'found'
else //we failed to find a fletchers kit, so we stop the macro.
@replygump 0x38920abd 0
sysmsg 'fletching tools broke'
headmsg 'fletching tools broke'
stop
endif // end fletching tools?
endif //end gump check
// slow the spam
// make weapon
@replygump 0x38920abd 15
waitforgump 949095101 1500
@replygump 0x38920abd bowcraftBtn[0]
waitforgump 949095101 1500
pause 250
// still have fletching tools?
// 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
else // out of lumber
if @findtype 0x176b 'any' 'backpack' and not @findtype 0x1bd7 'any' 'backpack' bowcraftMats[0]
useobject 0x40483c21
waitforgump 173511501 15000
replygump 0xa57934d 60022
waitforgump 173511501 15000
replygump 0xa57934d 60000
waitforgump 173511501 15000
pause 250
replygump 0xa57934d 0
if not @findtype 0x1bd7 'any' 'backpack' bowcraftMats[0]
@replygump 0x38920abd 0
sysmsg 'not enough lumber'
headmsg 'not enough lumber'
stop
endif
else
@replygump 0x38920abd 0
sysmsg 'not enough lumber'
headmsg 'not enough lumber'
stop
endif
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
Ghurdo
Apprentice Scribe
Posts: 10 Joined: Fri Aug 03, 2018 10:36 pm
Post
by Ghurdo » Mon Sep 17, 2018 7:30 pm
I like the changes
... I made another macro, similar to this one, for carpentry too. Just seemed kinda redundant to post it since it is so much like this one... Just a change of the lists and the skill to use. I'm sure the other crafting skills can be set up easily too.