Page 1 of 1

LOTRO Bots - Farmalot Bot

Posted: July 22nd, 2007, 9:23 am
by tault_mississippi
It was killing me - all that dang clickin'!

Here's a quick an easy way to reap what you sow. Your going to have to find a few mouse coordinates to use it - if you don't know how to do that, then don't use it. :-)

Code: Select all

dim bgwHWND
dim X
dim Y
dim iteration
dim iterations

iteration = 1
iterations = 35

ownLOTROWindow
'mouseLoc

while ( iteration <= iterations)
    plantFarm
    harvestField
    lootHarvest
   debugLog "Completed iteration: " & iteration & " of " & iterations
   iteration = iteration + 1
wend


sub plantFarm
    dim X, Y
    X = randomize(336, 278)
    Y = randomize(620, 610)
    Mouse.FullMouseMove X, Y, 1 
    Mouse.LMouseClick X, Y, 1, 1
    sleep 27000 
end sub

sub harvestField
    dim X, Y
    X = randomize(746, 665)
    Y = randomize(596, 550)
    Mouse.FullMouseMove X, Y, 1 
    Mouse.LMouseClick X, Y, 1, 1
    Mouse.RMouseClick X, Y, 1, 1
    sleep 8000
end sub

sub lootHarvest
    dim X, Y
    X = randomize(675, 592)
    Y = randomize(668, 661)
    Mouse.FullMouseMove X, Y, 1 
    Mouse.LMouseClick X, Y, 1, 1
    sleep 400
end sub

sub ownLOTROWindow
    debugLog "Attempting find the LoTRO Window"
    bgwHWND = Windows.FindWindowByTitle("The Lord of the Rings Online")
    if ( bgwHWND <= 0) then
        debugLog "Whoops, you need to launch LOTRO first..." 
    end if
    ShowWindow bgwHWND
    Sleep 500
    FocusWindow bgwHWND
    Sleep 500
    debugLog "Success! LOTRO Found " 
end sub

function randomize (max, min)
    randomize = (Int((max-min+1)*Rnd+min))
end function


sub mouseLoc
  while (true)

   X = Mouse.GetCursorPosX()
   y = Mouse.GetCursorPosY()

   debuglog "X:" & X & "\t Y:" &Y
   Sleep 1000
  wend
end sub


Posted: July 22nd, 2007, 9:43 am
by 6point6
works but overcomplicating a minor function. Sorry Missi ;)

Nvm just realized it wasnt AIT lol :P

Posted: July 23rd, 2007, 6:35 am
by Tault_admin
very nice moving to confirmed

Posted: July 23rd, 2007, 7:26 am
by tault_mississippi
6point6 - what minor function did you feel I was over complicating?

Posted: July 23rd, 2007, 11:54 am
by 6point6
as i said my bad
"Nvm just realized it wasnt AIT lol"

autoit just does it with fewer commands... thats all :)

Posted: August 6th, 2007, 2:59 pm
by jazz215
Not sure if they patched farming to take a little longer now, but it was trying to harvest to early. I extended the sleep time and works like a charm.

this is great! thanks!

Posted: August 6th, 2007, 3:08 pm
by tault_mississippi
oh yea, this is calibrated for tier one farming which goes slightly faster than tier2, etc.

So definitely, each tier will need a different timer set for it - thanks for pointing that out.

Posted: August 8th, 2007, 4:07 am
by nikeks
since some are newbies.. like me.. what environment you need to run the code?.. and is there an easy prog for finding x,y cords on your screen??.. thanx but we all start asking simple questions :)

Posted: September 3rd, 2007, 1:24 am
by apollo2889
I would love to use this but I honestly am a total script noob. Can anyone explain how to use it or at least point me in the general direction? Thnaks

Posted: September 10th, 2007, 1:23 pm
by ergotamine
nikeks wrote:since some are newbies.. like me.. what environment you need to run the code?.. and is there an easy prog for finding x,y cords on your screen??.. thanx but we all start asking simple questions :)
I THINK this code is used with LOTROExtreem or one of their other scripting engines, imho smarter to learn what you can and port over pieces to your own personal AutoIT script, if you can use the mouse for everthing even better, undetectable other than reading your programs running - which if you just name the AutoIT Script something non related and keep LOTRO as the window on TOP you can run anything in the background (LOTRO in the top left, movie playin behind it on the bottom right of screen) if your screen is big enough that is :P (sorry rambled a lil out of topic there...)

For X/Y Question

if you install AutoIT you can use the Window Info tool it installs, scroll the bar over on the tool until you can see the Mouse tab, click on that and you should get an X, Y, Window in Focus, Color in Hex, ect...