[EasyUO] Add boards to woodkeys

If you make a Client-side script you can publish it here for other players to use
Locked
User avatar
Natilla
Expert Scribe
Posts: 31
Joined: Tue Feb 03, 2009 1:31 pm

[EasyUO] Add boards to woodkeys

Post by Natilla »

I have created a script that adds boards to your woodworker's keys. Just put any boards into a secure container, put your woodworker's keys in your backpack, and run the script. It moves the boards from the secure container to your backpack, then adds them to the keys. Can handle larger amounts of wood if you unload heavier stuff from your backpack first.

Code: Select all

; Title: Addboardstowoodkeys.txt
; Purpose: Add boards (not logs) from a secure container to your woodkeys.
; Your Backpack, statusbar and paperdoll must be open for this to work.
; Must have only woodkeys in your backpack.
; Please remove metal keys and spellkeys before using.
; Must have boards in a secure container or in your backpack.
; Script will ask you to target your secure container that contains the wood.
; v 1.0  04.01.2009  Works on Excelsior Freeshard.  No others tested.
; Brought to you by Natilla the Novice Scripter.
; This is my first script ever.  I have no prior programming experience, just
; downloading and analyzing others' scripts.  If you find problems, please let me know.
; If you have constructive criticism that will
; enhance this script or add to my scripting knowledge, then please share.


gosub init
gosub setup_secure
gosub setup_woodkeys

loop:
wait 0
gosub addboards
goto loop

;******Add boards to your woodkeys*****
sub addboards
finditem TLK C_ , #backpackid   ; looks for boards in backpack.
wait 15
if  #findcnt < 1   ; if no boards, goes to sub to get some.
{
gosub getboards
return
}
set %woodstack #findid
set #lobjectid %woodkeys
set #ltargetid %woodstack

finditem %woodkeys C_ , #backpackid
wait 15
event macro 17 0
wait 30
set %clickx #contposx + 280
set %clicky #contposy + 260
click %clickx %clicky f
wait 15
target 2s
event macro 22
wait 20
click %clickx %clicky r
key esc
return

;***** Get Boards from your secure container and move to backpack**
sub getboards
finditem tlk C_ , %secure
if #findkind <> -1
{
  exevent drag #findid %Amt
  exevent dropc #backpackid
  wait 15
   return
}
   display Oh, my! You are all out of boards. Go get some more and let's do it again =D
   display Brought to you by Natilla the Novice Scripter.
   halt
return
 
;***********Initializing*** Must have statusbar open for it to find your weight.
; might add opening of statusbar here if people don't follow instructions.
; but i don't want to. >.<
sub init
initevents
set %maxweight #maxweight
set %amt ( %maxweight - #weight ) * 10
return

;************ Set up secure container with boards inside*********
sub setup_secure
wait 35
event ExMsg #charID 3 0 Now click on the secure container
wait 15
set #targcurs 1
wait 35
SET_SECURE:
if #targcurs = 1
goto set_secure
set %secure #ltargetid
set #lObjectID %secure
nextcpos 285 50
event macro 17 0
wait 15
return
 
;*****setup woodkeys***MUST BE IN YOUR BACKPACK****
sub setup_woodkeys
finditem  NUI C_ , #backpackid
if #findcnt = 0
{
display You have no keys. Get some and restart script. Ending script.
halt
}
set %keys #findid
gosub onlywoodkeys
return

;****Will find other keys that are not woodkeys and tell you to remove them***
sub onlywoodkeys
finditem %keys c_ , #backpackid
event property #findid
if wood notin #property
{
display Please remove all other keys from your backpack before proceeding. Then press play.
pause
gosub setup_woodkeys
}
set %woodkeys #findid
return

Locked