Give this a try, I haven't tested it here(I moved from another shard recently) but I will try to fix it up if you have issues
(Not my code, modified by me)
Essentially you set up a few variables and if you are using a pack animal, then start it. It should open a target, select a tree and it will walk to the tree for you, chop it till it's done and wait for you to select another tree
Again, I haven't modified it for uoex yet but I think the only things that you would need to change are the system messages it looks for.
Again let me know if you have issues and I will go test it out myself(Need to get lj up anyways)
Code: Select all
;==================================
; Script Name: SemiAutoLumberjacker
; Author: MoonRaver
; Version: 1.0
; Client Tested with: 5.0.9.1
; EUO version tested with: 1.5 v 123
; Shard OSI / FS: RunUO
; Revision Date: Unrevised
; Public Release: 09/10/07
; Global Variables Used: None
; Purpose: Attended jacking! You target trees, It does the rest, including: requips axes, chops, makes boards, dismounts/mounts and uses a beetle, or can also dump in a container near you such as a packy.
;==================================
; Notes: If you want to stop the semiautochopper, just hit ESC while you have a target cursor.
; Also, this uses Make Last to make boards, chop a tree and make one batch manually first.
;==================================
; Where ever they originally came from, openstatusbar, openbackpack, openpaperdoll, and waitforvar
; are borrowed code. I've seen them in a few macros, and this is another using them. All are
; lag proof ways to open and move the common gumps.
;==================================
;Setup
;Where to put cut boards.
;If you're using a mule of some sort, set mule id as container, and set beetle #true.
;If you're without either, set %container as any bag you have on you, at least as #backpackid if you have none, and set beetle #false.
set %container YGCZRND
set %beetle #true
;Max weight is wrong for some reason, set it here manually
set %maxweight #maxweight
set %delay 4
;Logs and boards. Default is OSI/RunUO. Change if needed.
set %log ZLK
set %board TLK
;Carpentry tools and Axes, Default is OSI/RunUO.
set %tool EGG_AIG_FSF ;What to use to turn to boards
set %axe FSF ;What to use to chop wood
;Tool bag and Axe bag are where you keep them. Default is your backpack.
set %toolbag #backpackid
set %axebag #backpackid
;Messages you see while chopping.
set %notenough not_enough_wood
set %putsome you_put_some
set %cantchop use_an_axe_on
set %toofar that_is_too
;Just in case no message comes up, how long until we fail chopping?
set %timeout 8
;Ease of use and debugging.
set %verbose #true ;Adds messages only you can see to tell you what's going on.
set %debug #false ;Pauses ALOT.
;Initial setup of status bar, paperdoll, backpack. Leave them open.
set %paperdoll #charid
;gosub openstatusbar
;gosub openpaperdoll
;gosub openbackpack
if %debug
pause
main:
if #weight >= %maxweight
gosub processwood
finditem %axe C_ , %paperdoll
if #findkind <> -1
{ ;We have an axe equipped.
set #lobjectid #findid
set %lastaxe #findid
event macro 17
target
set %lastaxe #ltargetid
if %verbose
event ExMsg #charID 3 0 Click a tree
while #TARGCURS > 0
{
onhotkey ESC
gosub die
wait 1
}
set %lasttree #ltargetid
set %ltx #ltargetx
set %lty #ltargety
set %ltz #ltargetz
set #ltargetkind 3
move %ltx %lty 1 5s
set %timeexpire #time + %delay
set %jrnl #jindex
gosub repeatTree
while #true
{
wait 10
if #jindex >= %jrnl
{
set %jrnl %jrnl + 1
scanjournal %jrnl
if %notenough in #journal
{
if %verbose
event ExMsg #charID 3 0 Not enough wood
goto main
}
if %toofar in #journal
{
if %verbose
event ExMsg #charID 3 0 Too far away
goto main
}
if %cantchop in #journal
{
if %verbose
event ExMsg #charID 3 0 Can't chop that
goto main
}
if %putsome in #journal
{
if %verbose
event ExMsg #charID 3 0 Recieved logs
gosub repeatTree
}
if you_hack_at in #journal
{
gosub repeatTree
}
}
if #time > %timeexpire
{
if %debug
pause
if %verbose
event ExMsg #charID 3 0 Time ran out on chopping!
goto main
}
}
}
else ;Reload axe, we don't have one on
{
gosub reloadaxe
wait 2s
}
sub repeatTree
set %timeexpire #time + %delay
set #ltargetid %lastaxe
event macro 17 0
target
event macro 22 0
return
chopped:
if %debug
pause
goto main
sub reloadaxe
finditem %axe C_ , %axebag
if #findkind <> -1
{
if %verbose
event ExMsg #charID 3 0 Reequipping axe
;Uses exevent droppd, tested working with a hatchet in a RunUO environment
wait 20
exevent drag #findid
wait 20
exevent droppd
wait 20
}
else
{
if %debug
pause
if %verbose
event ExMsg #charID 3 0 Out of axes... Halting!
halt
}
return
sub processwood
if %verbose
event ExMsg #charID 3 0 Processing wood
finditem %axe C_ , %paperdoll
if #findkind <> -1
{
set #lobjectid #findid
finditem %log C_ , #backpackid
while #findkind <> -1
{
event macro 17 0 ;Use a tool
target 2s
set #ltargetid #findid
set #ltargetkind 1
event macro 22 0
wait 10
finditem %log C_ , #backpackid
}
}
else
{
if %debug
pause
if %verbose
event ExMsg #charID 3 0 You're out of carpentry tools.. Halting!
halt
}
if %beetle
{
set #lobjectid %container ;Make beetle last object
event macro 17 ;Hop on the beetle
finditem %board C_ , #backpackid
while #findkind <> -1
{
set #lobjectid #charid ;Make us last object
exevent drag #findid #findstack
wait 10
exevent dropc %container
wait 10
finditem %board C_ , #backpackid
}
else
{
if %debug
pause
if %verbose
event ExMsg #charID 3 0 You should have boards in your pack but don't!
}
}
if #weight >= %maxweight
{
event ExMsg #charid 3 0 Your full! Go unload somewhere before starting again.
halt
}
return
sub die
if %debug
pause
if %verbose
event ExMsg #charID 3 0 User quit SemiAutoChopper!
halt
; ===========================
; WaitForVar - A wait sub for Lag
; %1 = var (eg. #contname, #contID,...)
; %2 = Operator (eg. =, <, <>, ...)
; %3 = Value
; %4 = timeout (in seconds)
; Returns #true if sucessful
; ===========================
sub waitForVar
set %timeout #time + 5
if %0 > 3
set %timeout #time + %4
waitForVarLoop:
if # . %1 %2 %3
return #true
if #time >= %timeout
return #false
goto waitForVarLoop