Page 1 of 2

LOTRO Bots - Autoit bot

Posted: April 23rd, 2007, 9:02 pm
by owner2119
This is a simple low level close combat bot. Made for fun while i wait for lotroExtreme. Will upadte with loot and more options later if lotroExtreme is not out soon.


o = auto kill
p = next target
1 = swift strike
2 = wild attack
4 = brutal attacks

; Detect windows by class name
opt("winTitleMatchMode", 4)
If @error Then
MsgBox(4096, "Error", "detect window")
endif

; Set Coordinate mode to relative to window
AutoItSetOption ( "PixelCoordMode", 2 )
AutoItSetOption ( "MouseCoordMode", 2 )
AutoItSetOption ( "SendKeyDownDelay", 50 )

global $Window = winGetHandle("classname=Turbine Device Class")
If @error Then
MsgBox(4096, "Error", "Could not find the correct window")
endif





; Main Loop
While WinExists($Window)
Sleep(1000);


$healthfull = health();
$targetlive = target();
$energyfull = energy();




if $healthfull=1 And $targetlive=0 and $energyfull=1 then
send ("p")
Send("{w 60}")
send ("p")
Send("{d 23}")
send ("p")
endif


if $targetlive=1 then
send ("o")
sleep(2000)
send ("1")
sleep(2000)
send ("2")
sleep(2000)
send ("1")
sleep(2000)
send ("4")
endif





Wend


Func health()
WinActivate ($Window);

$color1="0x24b60b"
If pixelgetcolor(261, 51) = $color1 then
WinActivate($Window);
return 1;
Else
return 0;
endif

EndFunc






Func energy()
WinActivate ($Window);

$color1="0x0f5cfa"
If pixelgetcolor(261, 62) = $color1 then
WinActivate($Window);
return 1;
Else
return 0;
endif

EndFunc






Func target()
WinActivate ($Window);

$color1="0x9babb7"
If pixelgetcolor(470, 105) = $color1 then
WinActivate($Window);
return 1;
Else
return 0;
endif

EndFunc

Posted: April 23rd, 2007, 9:59 pm
by wyvernx
Dont worry, lotrextreme will support autoit, so you can continue to bot in autoit and just get the player info/mob info etc from lotr extreme and use themin your script!

Posted: April 24th, 2007, 5:14 am
by owner2119
If u need help testing or anything let me know.

Posted: April 27th, 2007, 9:49 am
by antareus
Edited your bot abit to make sure that it doesnt exit auto attack once it has entered it.

; Detect windows by class name
opt("winTitleMatchMode", 4)
If @error Then
MsgBox(4096, "Error", "detect window")
endif

; Set Coordinate mode to relative to window
AutoItSetOption ( "PixelCoordMode", 1 )
AutoItSetOption ( "MouseCoordMode", 1 )
AutoItSetOption ( "SendKeyDownDelay", 200)

global $Window = winGetHandle("classname=Turbine Device Class")
If @error Then
MsgBox(4096, "Error", "Could not find the correct window")
endif





; Main Loop
While WinExists($Window)
Sleep(1000);


$healthfull = health();
$targetlive = target();
$energyfull = energy();


If $healthfull=0 And $targetlive=0 then
send("9")
endif

if $healthfull=1 And $targetlive=0 and $energyfull=1 then
send ("p")
Send("{w 60}")
send ("p")
Send("{d 23}")
send ("p")
endif


if $targetlive=1 then
send ("o")
sleep(2000)
KillLoop()
Killloop2()
endif


Wend



Func KillLoop()
Sleep (1000)
send ("1")
sleep(2000)
send ("2")
sleep(2000)
send ("1")
sleep(2000)
send ("4")
sleep(2000)


EndFunc

Func Killloop2()
if $targetlive=1 then
KillLoop()
Else
send("9")
EndIf
EndFunc



Func health()
WinActivate ($Window);

$color1="0x24BA0B"

If pixelgetcolor(383, 176) = $color1 then
WinActivate($Window);
return 1;
Else
return 0;
endif

EndFunc






Func energy()
WinActivate ($Window);

$color1="0x0F5FFF"
If pixelgetcolor(384, 187) = $color1 then
WinActivate($Window);
return 1;
Else
return 0;
endif

EndFunc






Func target()
WinActivate ($Window);

$color1="0x0A0A12"
If pixelgetcolor(408, 181) = $color1 then
WinActivate($Window);
return 1;
Else
return 0;
endif

EndFunc

Posted: May 2nd, 2007, 2:19 am
by kim2222
dosent seem to work for me,my char just stands there and does nothing,do you have to remap the ingame keys to match o=auto attack ect?

are you on US client or EU as they runiing different ver of game atm?

or does lotr stop third party programs for gaining access to keyboard?

any answers or workarounds much appreciated,thanks

Posted: May 2nd, 2007, 8:32 am
by antareus
kim2222 wrote:dosent seem to work for me,my char just stands there and does nothing,do you have to remap the ingame keys to match o=auto attack ect?

are you on US client or EU as they runiing different ver of game atm?

or does lotr stop third party programs for gaining access to keyboard?

any answers or workarounds much appreciated,thanks
You need to match the commands with the ingame keys as the follow:

o = auto kill
p = next target
1 = swift strike
2 = wild attack
4 = brutal attacks

So auto attack needs to be assigned to your o key and next target needs to be assigned to your p key, otherwise the bot wont do anything.

Posted: May 3rd, 2007, 3:24 am
by kim2222
ok i changed they keys but it still does nothing,even if i start the combat i just stand there doing nothing,i tried pausing the the script then un pausing but nothing,all it does is open the the lotr window but nothing else.

are you using any other programs aswell beside autoit?

Posted: May 3rd, 2007, 6:42 pm
by demekeq
Tried it out and had the same problems as kim2222.

Went into keymapping and changed all the required binds and for some reason it presses the 9th slot at the beggining of the script

seen this line:

If $healthfull=0 And $targetlive=0 then
send("9")
endif

so I went and put swift strikes in the 9th slot and that made my toon start attacking.

he still dies though when something comes up behind him, just stands there till hes killed...any work-around for this? not much of an autoit user...or scripts in general.

Posted: May 3rd, 2007, 10:54 pm
by kim2222
yeah i did same put an attack in slot 9 and it presses that key.but none of the other keys 1,2,3 or 4 also auto attack wont start,cant seem to figure it out,i checked all my key bindings are the same as instructed :cry:

Posted: May 5th, 2007, 7:55 am
by antareus
Oh that, that was a minor thing I added for my captain, you can remove it though. It was to simply make my captain activate his Health recover skill which becomes enabled once a mob dies.

Also the bot is very sketchy as it is, it has trouble dealing with agg and is very easy to kill. But with that said, it's better then nothing.

Atm I'm trying to develope a lotro bot using the Extreme client, so we'll see how that goes.

Posted: May 5th, 2007, 8:01 am
by antareus
demekeq wrote:Tried it out and had the same problems as kim2222.

Went into keymapping and changed all the required binds and for some reason it presses the 9th slot at the beggining of the script

seen this line:

If $healthfull=0 And $targetlive=0 then
send("9")
endif

so I went and put swift strikes in the 9th slot and that made my toon start attacking.

he still dies though when something comes up behind him, just stands there till hes killed...any work-around for this? not much of an autoit user...or scripts in general.
Also as a note to my previous post, it should only press "9", if your health isnt full and if there isnt a mob targetted. So you sure you got all the pixel points straight? It might just have been a coding error I made but didn't notice it myself when I ran the bot, either way you can just erase that part of the code.

NOTE NOTE NOTE Please remember to enable the "run to target when attacking" option, otherwise the bot will most likely not work as intended.

Posted: May 8th, 2007, 1:06 pm
by coreyk67
i made a few changes to cast a healing spell if i get low on health while in combat and after, and had to remap the x,y and color settings but this works great for me. I gained lvl 19 to 20 last night in about 6 hrs testing it. i also added a counter so it would only run X times

Posted: May 8th, 2007, 1:41 pm
by coreyk67
i was also wondering how would i get banned using something like this? how can they tell?

Posted: May 25th, 2007, 10:07 am
by kim2222
could you tell me how you get and what these refer to (exactly what are the co ordinates pointing to),as they dont work on my bot,ive tried getting the pixel points but weird things happen.im gusing there set up to your game window and this is why i need to change them to work on mine.

+++++++++++++++++++++++++++++++++++
Func health()
WinActivate ($Window);

$color1="0x24b60b"
If pixelgetcolor(261, 51) = $color1 then
WinActivate($Window);
return 1;
Else
return 0;
endif

EndFunc


Func energy()
WinActivate ($Window);

$color1="0x0f5cfa"
If pixelgetcolor(261, 62) = $color1 then
WinActivate($Window);
return 1;
Else
return 0;
endif

EndFunc



Func target()
WinActivate ($Window);

$color1="0x9babb7"
If pixelgetcolor(470, 105) = $color1 then
WinActivate($Window);
return 1;
Else
return 0;
endif

EndFunc
++++++++++++++++++++++++++++++++++


also i have figured out a way to loot mobs with this program using this in my script,what it does it loot corspse which is dead next to you (directly in front of you) directly after you have killed them.

send("{SHIFTDOWN}")
sleep(1000)
MouseClick("right")
sleep(1000)
send("{SHIFTUP}")
sleep(1000)

any help appreciated cheers

Posted: June 11th, 2008, 5:13 pm
by melnas59
could you tell me how you get and what these refer to (exactly what are the co ordinates pointing to),as they dont work on my bot,ive tried getting the pixel points but weird things happen.im gusing there set up to your game window and this is why i need to change them to work on mine.
I too would like to know how to get these coordinates. What program do you use?