PDA

View Full Version : Nq2 Auto -Work in progress -



DarkByte
07-22-2012, 02:19 PM
The aim of this bot is to make nq2 client fully playable in vb.net. But also to add several scripting features to the bot to make possible flexable auto hunting.


My first task was to build the gui window of the game , this seemed easy. Neopets use a 9X9 grid of images each 40X40px wide. So I made a function these images. However things where very distorted , I debugged my code and found that neopets was not using 9X9 images instead they would use sometimes 2-6 images on a single tile. These tiles would be layers ontop ofes one another using c.s.s tricks and transparent background images.

So I had to build a function to take care of this , unfortunatly it was harder than it should of been due to there being no simple way of rendering transparent images in vb.net without graphics render functions that usually only games use. Eventually I did just that and got the map to render:

[Only registered and activated users can see links]

The next part of my code was the navigation code , so we can walk about inside the game. To do this I used the following single image:
4700

I then plotted squares behind each arrow of the image and made a sort of "invisable" button underneath each arrow to walk the different needed directions.

Finally I could walk about inside the neoquest game! However movement was a little slow. I decided to instead map the entire neoqiest game to a file like so:

25, 17:t/forg.gif:Tresten
25, 18:t/forg.gif:Tresten

In the above the format is as follows:
Tile coordinate x/y : image name / city name

To do this I made a function that mapped the game for me as I walked around , I then walked around tresten until the entire citys information was contained in my file. Also I made the function download images to the /images/ folder. The idea behind this is that once I have mapped the entire game there will be no need for a image download function to ever execute in my bot. All images will be stored in the programs /images/ folder instead witch will heavily improve movement speed. Also by having a local map I can verify each of my commands are successful and also know witch tiles are walkable and witch are not.
This will be invaluable later.

To give you some idea of the work behind this , this is Tresten map:
[Only registered and activated users can see links]

I have a load more citys to do yet!


However my current task is to make the scripter work. I want to do this now as I do not want to have to alter loads of code later down the line.

The next goal is to make the script seen here (bottem left) run inside my bot. This script simply hunts around the city of Tresten and returns to mother to heal at less than 10 percent health. Then the script go's back to hunt. I will update as I go I work on this nearly every day.

[Only registered and activated users can see links]


23rd July 2012
Added the following functions to the scripter so far:
walkdirection(str Direction) - Walks a direction e.g "walkdir('east')"

Added some basic stats
[Only registered and activated users can see links]

Note , rohanne does not appear in the above image due to me debugging at the time of sshot. Do not worry , its not a bug and I can't be bothered to reupload.

health/max health are important for scripting / healing. Player location is used to determined witch map to load. Maps are loaded into memory and to keep things fast , each map for each city is a separate part of the array. I will now work on getting at least some world map into my map files.

Zachafer
07-24-2012, 07:13 PM
I then plotted squares behind each arrow of the image and made a sort of "invisable" button underneath each arrow to walk the different needed directions.


Why do that when it's so much easier in VBNet than in VB6? You could save yourself a lot of extraneous code by omitting the buttons.

[Only registered and activated users can see links]
Private Sub picNavigate_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles picNavigate.MouseClick
Dim directionClicked As String = CompassControl.HandleMouse(e.Location)
If directionClicked.Length > 0 Then
Debug.Print("Clicked {0} button.", directionClicked)
'WalkDirection(directionClicked)
Else
Debug.Print("No button clicked.")
End If
End Sub

j03
07-24-2012, 10:16 PM
Why do that when it's so much easier in VBNet than in VB6? You could save yourself a lot of extraneous code by omitting the buttons.

[Only registered and activated users can see links]
Private Sub picNavigate_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles picNavigate.MouseClick
Dim directionClicked As String = CompassControl.HandleMouse(e.Location)
If directionClicked.Length > 0 Then
Debug.Print("Clicked {0} button.", directionClicked)
'WalkDirection(directionClicked)
Else
Debug.Print("No button clicked.")
End If
End Sub

It is in VB.NET you monkey.

DarkByte
07-24-2012, 10:19 PM
^ You always feel the need to respond with your code , its annoying. The code I was describing was exactly the same as the code you posted. Both our codes plot squares behind the images and detect the clicks inside them. We used the exact same functions to accomplish this. The reason you did not know is because I did not post any code. You just assumed I did things another way.

If you have any other code improvement suggestions , keep them to yourself. I have not posted any code to this , so you have nothing to compare against except my words witch you always manage to nit pick the tiniest detail out of. Seriously I just made a scripting engine for neoquest and a engine to render the gui while mapping the entire world and all you respond with is a stupid comment about something so trivial it took me about 10 lines of code. Witch btw is more efficient than yours. /sigh

DarkByte
07-25-2012, 06:54 PM
It is annoying nothing else. I have an ego I know this and it is probably annoying. But put up with me and I will give you some kick ass programs. We all have our faults.

I will continue to update this thread and stay out of everything else now. My only focus is my programs I will take a back seat while I work. How to release these without crippling the economy (deflating nq2 prizes) is something me and joe will discuss at the time of release. Check back to this thread every few days and see how its coming along.

Neoquest
07-25-2012, 09:56 PM
It is annoying nothing else. I have an ego I know this and it is probably annoying. But put up with me and I will give you some kick ass programs. We all have our faults.

I will continue to update this thread and stay out of everything else now. My only focus is my programs I will take a back seat while I work. How to release these without crippling the economy (deflating nq2 prizes) is something me and joe will discuss at the time of release. Check back to this thread every few days and see how its coming along.

I don't think you have to worry about crippling the NQII economy, you need to go through the game three times to get prizes that are actually worth a substantial amount of NP. Not to mention the fact that there are already many NQII players out there.

Joshsadf
07-25-2012, 10:40 PM
Yea and the prizes aren't worth that much anyways.

Syphon
07-25-2012, 11:13 PM
And you can only get the insane prizes once per account
so 3 times to have a 50% chance of a profitable prize seems like too much of a waste to do over and over

j03
07-26-2012, 12:18 PM
It's not really about the prizes you get for completing NQII, it's the time it takes to complete. There will probably be delays hard-coded into this program to stop the high scores from being infested with impossible times. :P

DarkByte
07-26-2012, 08:45 PM
This is but one class inside a larger project made up of literally hundreds of classes that perform different task. You could add neoquest as a task to run a hour a day for instance. Then the next hour train , do dailys auto buy. Then the next hour sell any items bought. ect

You will be able to do this with a unlimited number of accounts at once. This bot would cripple the economy on release witch is why I have talked talked with Joe about it. He said to charge for it , witch I do not think will be possible inside this site as you charge for vip something as a programmer I would not see the money for. So I may just make it private on a site somewhere or just say fuck it and release it full public. We will see when the time comes.