Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

[EUO Macro] - Picking Cotton
#1

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.

PHP Code:
;==================================
Script Name:   Cotton Gatherer
Author:  JJarmis
Version1.00
Client Tested with4.0.2a
EUO version tested with1.41 (0075)
Shard OSI FSOSI
Revision Date3/7/04
; Public Release3/7/04
; Global Variables UsedNone
PurposeTo 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 
    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 %%

    
if %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 ;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 
%%;what does this do?

    if %
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 
#2

How the heck did you color it like that? 0_o is that a [tag] of some sort or did you do it manually?
#3

Sindern Wrote:How the heck did you color it like that? 0_o is that a [tag] of some sort or did you do it manually?

What a disappointment when I see a reply to my thread and that's what it is :p hahaha

At the top of where you write your message you see all the little icons like B I U... The one all the way at the right that looks like a file and says 'php'. Highlight your text and click that button and it will color it based on the 'commands'. Or add {php} {/php} at the start and end of your text (use [] instead of {}).

More or less all words are predefined to be certain colors. And there are modifiers like ' ' which apparently make everything in between red. If you want to do it for cool looking posts a draw back is that a paragraph (one continuous line) will show up like that when using these tags so you have to add enters after each line so you don't slide for ever.

Here's what this would look like with the php tags (enters added in between so you don't have to scroll for forever):

PHP Code:
[quote=Sindern]How the heck did you color it like that?
0_o  is that a [tagof some sort or did you do it manually?[/QUOTE]

What a disappointment when I see a reply to my thread and thats
what it is 
:p hahaha.

At the top of where you write your message you see all the little icons
like B I U
... The one all the way at the right that looks like a file and
says 'php'Highlight your text and click that button and it will color it
based on the 
'commands'. Or add {php} {/phpat the start and end
of your text 
(use [] instead of {}).

More or less all words are predefined to be certain colors.  And there
are modifiers like 
' ' which apparently make everything in between red.
If 
you want to do it for cool looking posts a draw back is that a
paragraph 
(one continuous linewill show up like that when using these
tags so you have to add enters after each line so you don
't have to
slide for forever.


Here'
s what this would look like with the php tags (enters added in
between so you don
't have to scroll for forever): 
#4

Eighty Swords Wrote: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.

Didn't I already post a script for this? Just have the script running and run around near cotton. It double-clicks cotton plants and places the cotton in your pack. Don't even need to have razor scavenger agent running. It also does the same for flax if you happen to know where those fields are.

I was sure I posted it but can't find it right now so here it is again:
Code:
finditem IPE_FPE_HPE_CPE_TEK_VEK_WEK G_2
if #FINDCNT > 0
{
   set #lObjectID #FINDID
   event Macro 17 ; last object
}

finditem NFF_QEK_PEK G_2
if #FINDCNT > 0
{
   Exevent Drag #findid #findstack
   Exevent Dropc #backpackid
}
#5

Oh dang you did and it was an answer to my post here haha. I totally forgot about that. Thanks again man! I'll go try it now since I need more cloth and I'll post back saying how in love I am with it Smile

Edit:

This macro is awesome!!! Does exactly what I wanted; double clicks all plants within range and drops it in my pack. Only minor setback was like you said in that other post, it would sometimes drag the item in my pack and move it somewhere else in the pack instead of taking the one on the ground. So I commented out the second part and now it reads;

Quote:finditem IPE_FPE_HPE_CPE_TEK_VEK_WEK G_2
if #FINDCNT > 0
{
set #lObjectID #FINDID
event Macro 17 ; last object
}

And now it double clicks the plants within range and the Razor scavenger agent picks it up for me.

Canaris next time you're in game I owe ya 5k for the macro because it's so cool! I'd give you more but I'm kinda poor haha


Forum Jump:


Users browsing this thread: 1 Guest(s)