Jump to content
Sign in to follow this  
John SL

EQII fighting bot

Recommended Posts

I am posting a couple of EQ2 scripts.

This one is a fully working script which allows an EQ2 character to fight in unattended mode.

The code is not pretty, nor particulaly efficient, but it does work and perform its intended function well.

I wrote it for a Paladin (bacause that's what I play) and a Shadowknight (which is similar, to test its adaptability).

It is not a turnkey solution. You need to fiddle with the code a bit (just changing constants) to vary its characteristics depending on what you are doing.

It is critically dependant on finding certain items in specific precise screen locations - so to get it up an running you will need to either match these or you will need to adjust the code to adapt to your preset positions.

The core of the code is basically a cycle issuing combat actions in the sequence that the game uses to avail of what EQII calls Heroic Opportunities.

The fight continues until the target dies. And will quite sucessfully continue to fight through multiple enemies in a group or a series of separate encounters.

Around this core is built a shell which allows the user to select one of several modes of operation - the key ones of these are what I call Guard mode and Hunt mode.

Guard Mode essentially sits waiting for a target to occur and as soon as one does it begins to fight it - this allows you to leave your character in a dangerous place and it will fight each time it is attacked until either it dies or you return and turn it off. I tend to use Guard mode all the time while playing - basically I move around and if I'm attacked I let it do the tedious bit of fighting - or when I find a victim I target it and again let the script fight it out. Being jumped in mid fight, multiple enemies etc all work propely - but if the enemies are just too strong it has no ability to flee so you die. But it is a good fighter and takes the tedium out of normal fights. It also works well when grouped if used in assist mode.

Hunt mode is a variation on Guard mode where if a target hasn't occured in a preset time it will target the nearest NPC and will attack it. The cycle repeats undlessly until you die or it is stopped and it does again deal with being attacked.

Several of the functions work based on pixel colour at specified positions - however the only colour that matters is black - so the critical controls are placed over the letter box area of the screen so that they are either visible (i.e not black) or not visible (black) - this is used to detect targets and it is used to detect whether melee attack is on (black border on button).

You need to match these locations to your setup - the black background is pretty key so you're stuck with it unless you do a rework.

The actual fight cycle is dependant on the script having the characteristics (recast time, prefence, etc) of the combat arts in the HO cycle. These are hard coded constants you need to adapt to your character.

Normally to use this script I would start EQ - use Autoit's windoe spy to check my window was at 0,0 - so my preset location were correct (see the crafting script to see an alternative and better solution to this which searches for its 'known' screen positions - becasue it needs to !).. then I'd take the EQ window title and paste into my code (because it waits on the full window title not a subset of it - and SOE change it at each minor update - 3-5 times week) . Then check the setting for how many steps I want - agressive fighting or slower to preserve power etc. This bit only take a few seconds and you just get into the habit - and it means you are thinking about how you use it each time - and unless I was ranging widely in each session I'd not have to change it once I had it set up.

Then start the scrip - wait for the tool bar icon and give focus to EQ2 - which pops the script window - asking about mode .....

A features - when waiting in either mode (but not fighting) moving the mouse to 0,0 top left reverts the script to mode selction - effectively pausing it - useful to talk to an NPC without attacking them etc !

And one caveat - once the script is fighting especially with all the options turned up it has your mouse - it can be a real pain if you need to take back control (for example to flee a fight).

However - I have left the script running in both guard and hunt modes in moderately dangerous areas (blue agressive and yellow solo non agressive) and left it for extended periods (as in days rather than hours) and come back to a live character with significant level advancement.

I have also used it to succesfully camp many rare mobs - and returned several hours later to find that I had my update and was able to get back to playing rather than waiting !

Using this script unattended is probably a breach of the EQ EULA - but using it as an aid to playing is probably not - on your own head be it.

I play in 1280x1024 windowed mode with the window stretched (not maximised) to exactly fill the screen - with locked windows within the game the screen postions remain accurate from session to session.

Please feel free to post any questions.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...