Jump to content

I need help in this hc script:))


Recommended Posts

I writed script what use pixelcheksum. Its check my invenotry and write in txt file free slots to : O and used slots to : X

Like this

Inventory record result:

0000000

xx00000

xx00000

xx00000

its work perfect. And now my quest. How i can move mouse that XX Area and click it? I dont have no idea:D because that xx change if i have items in other slots like

0000000

0000xx0

0000xx0

0000xx0

Or

0x00000

0000x00

0000x00

0000x00

etc...

Edited by fataly
Link to comment
Share on other sites

so, there is mine script

opt("PixelCoordMode", 2)

opt("MouseCoordMode", 2)

opt("ColorMode", 1)

$items = 0

$itemss = 0

winActivate("Diablo II")

HotKeySet("p","lol")

Sleep(1500)

MouseMove(60,60,1)

send("i")

Sleep(500)

$1 = PixelChecksum(426,341,444,342)

$2 = PixelChecksum(426,371,444,372)

$3 = PixelChecksum(426,399,444,400)

$4 = PixelChecksum( 436,430,444,430)

$5 = PixelChecksum(456,341,472,342)

$6 = PixelChecksum(456,371,472,372)

$7 = PixelChecksum(456,401,472,402)

$8 = PixelChecksum(466,429,472,440)

$9 = PixelChecksum(480,300,500,330)

$10 = PixelChecksum(480,371,500,372)

$11 = PixelChecksum(480,399,500,400)

$12 = PixelChecksum(480,430,500,430)

$13 = PixelChecksum(510,341,530,342)

$14 = PixelChecksum(513,371,530,372)

$15 = PixelChecksum(513,399,531,400)

$16 = PixelChecksum(513,430,531,430)

$17 = PixelChecksum(540,341,560,342)

$18 = PixelChecksum(543,371,560,372)

$19 = PixelChecksum(543,399,561,400)

$20 = PixelChecksum(543,430,561,430)

$21 = PixelChecksum(570,341,580,342)

$22 = PixelChecksum(573,371,580,372)

$23 = PixelChecksum(573,399,581,400)

$24 = PixelChecksum(573,430,581,430)

$25 = PixelChecksum(600,341,600,342)

$26 = PixelChecksum(600,371,600,372)

$27 = PixelChecksum(600,399,600,400)

$28 = PixelChecksum(600,430,600,430)

;PixelChecksum(426,341,444,362)

;$readfile = FileRead("inv.txt","1")

;send("i")

;While 1

; HotKeySet("k","check")

; WEnd

;Func check()

;Eka rivi

if $1 = 2530938112 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $5 = 1553796514 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $9 = 1667320854 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $13 = 2327252230 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $17 = 478678563 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $21 = 4175824813 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $25 = 27525322 then

FileWrite("inv.txt","o"&@CRLF)

Else

FileWrite("inv.txt","x"&@CRLF)

$items =+1

$itemss =+1

EndIf

;toka rivi

if $2 = 353769136 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $6 = 2602833683 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $10 = 253369319 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $14 = 2697860480 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $18 = 646320021 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $22 = 936840231 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $26 = 86901136 then

FileWrite("inv.txt","o"&@CRLF)

Else

FileWrite("inv.txt","x"&@CRLF)

$items =+1

$itemss =+1

EndIf

;kolmas rivi

if $3 = 1260850021 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $7 = 2648515815 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $11 = 177344055 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $15 = 3335982571 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $19 = 3922791877 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $23 = 3009676924 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $27 = 30671074 then

FileWrite("inv.txt","o"&@CRLF)

Else

FileWrite("inv.txt","x"&@CRLF)

$items =+1

$itemss =+1

EndIf

;neljäs rivi

if $4 = 1299186730 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $8 = 1638478318 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $12 = 1173557279 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $16 = 2495155029 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $20 = 2684357577 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $24 = 1756694410 then

FileWrite("inv.txt","o")

Else

FileWrite("inv.txt","x")

$items =+1

$itemss =+1

EndIf

if $28 = 32309494 then

FileWrite("inv.txt","o"&@CRLF)

Else

FileWrite("inv.txt","x"&@CRLF)

$items =+1

$itemss =+1

EndIf

;ToolTip("Found new items.",485,455,"")

;Sleep(3500)

send("i")

;FileWrite("inv.txt",""&@CRLF&@CRLF&$itemss& " New items.")

Func lol()

Exit

EndFunc

Link to comment
Share on other sites

from the help file.

A checksum only allows you to see if "something" has changed in a region - it does not tell you exactly what has changed.

is this because your just checking to see if its empty.?

Link to comment
Share on other sites

if its hard to explain, then it will be even more harder to achieve.

how abut this for starters.

sleep(5000)
dim $search[11]

for $ct = 426 to 606 step 20
    
    $search=PixelSearch($ct,$ct-85,$ct+18,$ct-84,16777215)
    
    if @error=0 Then
        $string="Xpos="&$search[0]&"   Ypos="&$search[1]
        MsgBox(0,"Found the pixel you was searching for",$string,0)
    Else
        MsgBox(0,"NOT FOUND!!!!","The Pixel was not found",0)
        EndIf

Next
Link to comment
Share on other sites

but thats not read mine inv.txt:F So i mean THIS:

first --> mine script take inventory checksum, then its make txt file and fill that with used and non used areas:

ooooooo

ooooooo

ooooooo

ooooooo

then main.au3 read that file and if its changed :

oxooooo

ooooooo

ooooooo

ooooooo

or something else, its go to shop and move mouse to that X.

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