Jump to content

Need ideas/help


Recommended Posts

OK guys.

Heres what im tryin to do.

Posted Image

Im trying to get my script to read each individual "Space" and find out which potion it has in it. (Red health, Blue mana, Empty.. well empty.)

I got the 2nd lower box setup below. The only problem is, i think the blue color is wrong, and when i screenshot, control +v in pant, and use au3 info in it, i cannot get

exactly where the pixelcheck is in diablo.

SO my question is.

Question 1: Is there a more efficent way of doing this?

If anyone has a potbot/healthbot script for diablo II i would LOVE to get my hands on the source for refrences.

This is what i got so far.

$Belt1Health = 0xA42818
$Belt1Mana = 0x303094
$Belt1Empty = 0x080808


While 1
$var = PixelGetColor( 473 , 604 )
;   MsgBox(0,"The hex color is", Hex($var, 6))
If $var = $Belt1Health Then;
    
If Not IsDeclared("sToolTipAnswer") Then Local $sToolTipAnswer
$sToolTipAnswer = ToolTip("There is a Health in belt2",Default,Default,"D2",1,0)

    If $var = $Belt1Empty Then
If Not IsDeclared("sToolTipAnswer") Then Local $sToolTipAnswer
$sToolTipAnswer = ToolTip("There is nothing in belt2",Default,Default,"D2",1,0)

        If $var = $Belt1Mana Then
            If Not IsDeclared("sToolTipAnswer") Then Local $sToolTipAnswer
$sToolTipAnswer = ToolTip("There is a mana in belt2",Default,Default,"D2",1,0)
            EndIf
    EndIf
EndIf
Wend

Question 2: Also, what would be the best way to get the current health.

Heres an example of the health bar:

Posted Image

It would be a pain in the royal something to scan each individual Vertical pixel for a change.

Note. Im really unexperienced with math for autoitscript. Mainly all i know is pixelsearch and mouseclick and iniread :D

Edited by ecstatic
Link to comment
Share on other sites

Send 1234 four times, go to Malah press Ctrl and press right click (or shift?) and fill your belt with health potions. Send 34 four times and go back to Malah and again fill your third and fourth columns with mana and say hello nice and you're set. ;]

Or if you prefer it more accurately and thrifty you can start to read a few memory addresses you'll get a clue what to do then. By the way, all the graphics are loaded from your computer and not from the server.

Link to comment
Share on other sites

Send 1234 four times, go to Malah press Ctrl and press right click (or shift?) and fill your belt with health potions. Send 34 four times and go back to Malah and again fill your third and fourth columns with mana and say hello nice and you're set. ;]

Or if you prefer it more accurately and thrifty you can start to read a few memory addresses you'll get a clue what to do then. By the way, all the graphics are loaded from your computer and not from the server.

Only problem with this is its a huge waste of gold, the currency, and its assumed the user of my "bot" is on a low-count.

Where would i start about memory reading.

Link to comment
Share on other sites

Use PixelSearch to find each of those colors you're using to determine what potions are in what slot. it can search a square area too and it can also search for colors that are CLOSE to the color you specified (as in a bit darker/ a bit ligter etc). Check the documentation for it:

PixelSearch ( left, top, right, bottom, color , shade-variation )

left, right, top, bottom define a square in which to do the searching for that pixel, and shade variation is how close the found color can be to your specified one

It would work something like

- pixelsearch for something red-ish in one slot

- 'if not @error then' (this would do the next action if pixelsearch found something) message box "there's a health in that slot"

- 'else' pixelsearch for something blue-ish to determine if it's actually a mana

- etc

you could probably do a function that works like FunctionName(coordinates to search and color) so you don't have to write 100 lines of code for each slot

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...