04-19-2009, 06:46 AM
Here's an Easy UO macro to pick cotton in fields. It searches your screen for cotton plants and runs to the first one it finds. It doesn't always go to the closest one so it takes longer then I'd like it to, but at least I don't have to target the small white spots and double click the plants every time.
I'm new to Easy UO and was wondering if anyone here had any experience writing scripts for it. What I'd like to do with this script is mod it so it will double click any plant within 2-3 tiles range of where I'm standing. Then I can run around myself and my Razor scavenger agent will put it in my pack when I take my first step after double clicking the plant.
Here's the version with added comments of what I have figured out so far. If anyone is familiar with Easy UO can you correct any mistakes please.
Thanks for any and all help guys!
Here's what I've been able to narrow it down to so it just runs around and double clicks the plants. Like I said in my first post this lets my Razor Scavenger agent pick up the bales once the Easy UO macro finds and double clicks the plant.
I'm new to Easy UO and was wondering if anyone here had any experience writing scripts for it. What I'd like to do with this script is mod it so it will double click any plant within 2-3 tiles range of where I'm standing. Then I can run around myself and my Razor scavenger agent will put it in my pack when I take my first step after double clicking the plant.
PHP Code:
;==================================
; Script Name: Cotton Gatherer
; Author: JJarmis
; Version: 1.00
; Client Tested with: 4.0.2a
; EUO version tested with: 1.41 (0075)
; Shard OSI / FS: OSI
; Revision Date: 3/7/04
; Public Release: 3/7/04
; Global Variables Used: None
; Purpose: To gather cotton as it spawns on the ground
;==================================
; This Script simply finds the cotton plants on the ground
; gets the cotton off the plant and puts it in your backpack
; NOTE: You MUST have 1 cotton in your open backpack
; for this to work!
initevents
loop:
set %hi 0
set %l 0
finditem CPE_IPE_HPE_FPE G_15
if #findkind = -1
goto loop
move #findx #findy 0
set #lobjectid #findid
loop2:
set %hi %hi + 1
event macro 17 0
wait 5
finditem NFF G_1
if %hi > 200
goto loop
if #findkind = -1
goto loop2
wait 5
event drag #findid
loop3:
set %l %l + 1
if %l < 70
goto loop3
finditem NFF C
set %clickx #findx + 25
set %clicky #findy + 10
click %clickx %clicky p
goto loop
Here's the version with added comments of what I have figured out so far. If anyone is familiar with Easy UO can you correct any mistakes please.
Thanks for any and all help guys!
PHP Code:
initevents
loop:
set %hi 0 ;what is %hi?
set %l 0 ;what is %l?
finditem CPE_IPE_HPE_FPE G_15 ;find cotton
if #findkind = -1 ;if there's not cotton on your screen the macro will loop from the start of loop to here. essentially a stop.
goto loop
move #findx #findy 0 ;move to where cotton found
set #lobjectid #findid ;set as next target
loop2:
set %hi %hi + 1 ;what does this do?
event macro 17 0 ;double click the item
wait 5
finditem NFF G_1 ;find a container (what container)
if %hi > 200 ;what does this do?
goto loop
if #findkind = -1 ;if item not found
goto loop2
wait 5
event drag #findid ;pick up cotton
loop3:
;this part puts the cotton in your pack
set %l %l + 1 ;what does this do?
if %l < 70
goto loop3
finditem NFF C ;what do these lines do?
set %clickx #findx + 25
set %clicky #findy + 10
click %clickx %clicky p
goto loop;repeat
Here's what I've been able to narrow it down to so it just runs around and double clicks the plants. Like I said in my first post this lets my Razor Scavenger agent pick up the bales once the Easy UO macro finds and double clicks the plant.
PHP Code:
initevents
loop:
finditem CPE_IPE_HPE_FPE G_15 ;find a cotton plant
if #findkind = -1 ;if no cotton plant is found, goto loop. this is essentially an end statement and stops you from running in the same direction forever
goto loop
move #findx #findy 0 ;move to where a plant was found
set #lobjectid #findid
loop2:
event macro 17 0 ;double click on cotton plant