Jump to content

Help with script for java MMO game Dofus


Recommended Posts

Greetings,

I am a new user of Autoit and programming in general. I am requesting help with writing a script for a game by the name of Dofus. Dofus is a java based game that has a stand-alone client which is controlled by keystrokes and mouse clicks. The game is played with other people over a server connection and has many complex features such as crafting, advanced combat and player vs. player combat.

My ultimate goal is to make a script which would automate the tedious grind of leveling up a character. Something that takes months upon months could take a few weeks with the power of Autoit. This script will have to be able to click on NPC's (non-player creatures) that wander about maps to begin combat. Then engage and defeat these NPC's in combat. In-addition to combat, the script would transverse distances across the world of Dofus to a storage area and empty the items collected from fighting into the bank, after which the script would return to fighting.

As I have mentioned, I know very little about Autoit. My initial goals are broken down into 5 parts:

#1. Determine how to auto detect creatures and initialize combat with them.

#2. Determine how to auto execute a successful combat situation defeating creatures.

#3. Determine how to auto navigate the map to and from the hunting location.

#4. Determine how to auto empty the rewards of combat into the storage area called the bank.

#5. Determine how to auto log back in if connection is terminated.

So this is where you guys come in. I need some help to get started. I know i will need to use some kind of pixel detection and loops to determine if combat has started. Could I get some assistance just with #1. for now.. (one thing at a time.)?

Here are a few images from the game which show random NPC's that need to be clicked upon to start combat. Notice that the creatures have red stars around them (added in paint - not in game) and that if you hover over the creature a black box appears with the names of the creatures (perhaps could be used to our advantage?):

Posted Image

Posted Image

Posted Image

For reference the game can be located and downloaded for free here: http://www.dofus.com/en

Link to comment
Share on other sites

No one will write it for you.

If you want that, one place you can go.

How about you start by looking in the helpfile for some functions you think may help. Then search around for it. Has anyone done this before? Have a look at previous bots etc...

Cheers,

Brett

Link to comment
Share on other sites

No one will write it for you. If you want that, one place you can go.

Oh, I guess I was not very clear. My intentions were to find beginners guides for each of the 5 points I listed. I am not looking for someone to write it for me (otherwise how could I ever expand upon it?) Assuming I could write 5 stand alone scripts for each of the 5 points, starting with point 1 (detecting and clicking randomly moving and placed creatures) does anyone know of a place I could read a good tutorial on the needed functions?

Link to comment
Share on other sites

I must not have been clear either.

Search for it. It has been done too many times to count. I'm sure you will be able to find most if not all of your answers from a simple search.

Cheers,

Brett

Link to comment
Share on other sites

If the map is always the same, and you were the only one to use it, you could probably just spend a bit of time making points to click until you enter your combat zone.

From there you could run a loop to find a color that is unqiue to the creature you want to kill, then click it and attack.

And every x seconds/minutes you could press whatever key to see your inventory and check to see if the last slot has the default color, if not then you could assume it is full..

and to go out of the loop and into another set of predetermined points that bring you to the bank.

Thats just what I would do... mainly because i'm awful at autoit.

Safe to say you're going to have to spend a lot more time into than you think in order to get something going.

Link to comment
Share on other sites

I must not have been clear either. Search for it. It has been done too many times to count. I'm sure you will be able to find most if not all of your answers from a simple search. Cheers, Brett

Thanks for your help BrettF I really do appreciate you taking the time to respond. A few questions: first, when you say "search for it" do you mean that the information I need is located here in the forums? I have tried searches for "pixel" and "auto attack" which are generic terms used in gaming. Hell, I tried a "dofus" search too. Of course I understand these are specific terms relating to the game, but I have not enough experience with AutoIt to know what functions would be used to replicate the necessary actions. A google search brings up other sources for Autoit scripts and tutorials, are you suggesting it would be better I go else where for assistance or could you perhaps offer up a function or two to take a look into to get me started?

Link to comment
Share on other sites

Open autoit and click help, Its actually really helpful.

If you dont understand the examples provided, copy/paste them and test it out. Edit parts of it to see what gets effected.

Its all pretty slow going, but then again you said you wanted to learn =-p

Try a search inside the help guide, it should help you get a draft going.

Link to comment
Share on other sites

PixelSearch

Send

MouseMove

Thanks so much this is a big help. I am already finding tremendous amounts of info on PixelSearch which is just what i need. Quick question... From what I see pixelSearch requires first a location and then a hex color. Is this the same function that is used if the location is not known, but the color is? For example if I know i need to find an area of white on the screen, can i still use PixelSearch in this backwards way?

Link to comment
Share on other sites

Ok so the more I look into this the more complicated it seems to get, seeing there are thousands of creatures all with different colors, and as the game time changes the screen darkens for night and day, that plus creatures can hide behind trees / grass. On top of all that, this game is very colorful and many of the same colors on the NPC's are on the people... SO how about this new approach:

First look at these two images:

Posted Image

My new approach would scan the screen by moving the mouse around until an enemy is detected by the black pop up box. When that happens the script would click starting combat.

#1. A mouse scan (calls to move mouse around screen in a pattern that covers screen quickly)

#2. At the same time the mouse moves a function sets a variable as the location of the mouse pointer.

#3. While the mouse scans, the variable for the mouse location is used to determine if the black box is present.

#4. If the black box is detected the mouse is clicked to start combat.

This might be more effective then pixelsearch on its own as the black box would always be black, and could more easily be found. Any thoughts?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...