Jump to content

Script For A Game


Recommended Posts

it would be easier if u just got the process name

while 1
    
If WinExists("Diablo II") Then
HotKeySet("{Space}", "close")
$coord = PixelSearch( 77, 540, 77, 540, 0x888888)
If Not @error Then
call("Close")
Else
MsgBox(64, "Info", "The game isn´t running!")
Exit(0)
EndIf

wend 

Func Close()
Send("!{F4}")
EndFunc
Edited by thatsgreat2345
Link to comment
Share on other sites

  • Replies 56
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

while 1
    
If WinExists("Diablo II") Then
HotKeySet("{Space}", "close")
$coord = PixelSearch( 77, 540, 77, 540, 0x888888)
If Not @error Then
call("Close")
Else
MsgBox(64, "Info", "The game isn´t running!")
Exit(0)
EndIf

wend 

Func Close()
Send("!{F4}")
EndFunc
ok looks great but I get error

wend 1

Error: "wend" statement with no matching "While" statement

hehe thanks for keep trying to help me

Edited by Evil_Has_Survived
Thanks in advance
Link to comment
Share on other sites

it would be easier if u just got the process name

while 1
    
If WinExists("Diablo II") Then
HotKeySet("{Space}", "close")
$coord = PixelSearch( 77, 540, 77, 540, 0x888888)
If Not @error Then
call("Close")
Else
MsgBox(64, "Info", "The game isn´t running!")
Exit(0)
EndIf

wend 

Func Close()
Send("!{F4}")

EndFunc

it would be easier if u just got the process name sounds willing how would I do it

Thanks in advance
Link to comment
Share on other sites

press ctrl alt delete and open up taskmanager, choose the process tag and find the im guessing its gonna be diablo.exe but just find a process that has to do with diablo , diablo has to be running by the way

game.exe i thoguht it would be diablo II.exe also but...

Edited by Evil_Has_Survived
Thanks in advance
Link to comment
Share on other sites

while 1
    
If WinExists("Diablo II") Then
HotKeySet("{Space}", "close")
$coord = PixelSearch( 77, 540, 77, 540, 0x5C0001)
If Not @error Then
Send("!{F4}")
Else
MsgBox(64, "Info", "The game isn´t running!")
Exit(0)
EndIf
Endif
wend

hey could u take a screen shot and upload it so i cant take a look i found one and i have a feelin u got the wrong color

Link to comment
Share on other sites

The colors he posted are all some versions or gray, because when you use Au3Info.exe in DII you see the color of the cursor (a big hand). You have to find the coord and do the pixel checking manually.

By the way, 25% of 1000 is 250, not 500.

teehee sorry your correct, how would I find the pixel manually

Thanks in advance
Link to comment
Share on other sites

Just get the locations with the Au3Info, and then move the mouse, and run a script to the the color at that location. Or, make a script to constantly output the pixel color of a pixel at MouseX - 10 and MouseY - 10 (use MouseGetPos) in a traytip, and get the pixel that way.

Link to comment
Share on other sites

Just get the locations with the Au3Info, and then move the mouse, and run a script to the the color at that location. Or, make a script to constantly output the pixel color of a pixel at MouseX - 10 and MouseY - 10 (use MouseGetPos) in a traytip, and get the pixel that way.

77, 540, 77, 540, 0x888888) ok lets see if I get this right

77 move left right, 540 up down

0x888888 but since the mouse gets in the way of the health orb how can I get the right pixel, I think this is the pixel atleast :)

maybe if this script worked I could do it push enter in game and it creates a box on my desktop :mellow:

HotKeySet("{ENTER}", "run C:\Documents and Settings\Dietmar franken\Desktop\New AutoIt v3 Script (2).au3")

call("MsgBox(64, "Info","")

$var = PixelGetColor( 10 , 100 )

MsgBox(0,"The decmial color is", $var)

MsgBox(0,"The hex color is", Hex($var, 6))

Edited by Evil_Has_Survived
Thanks in advance
Link to comment
Share on other sites

WinActivate ("Diablo II")
WinWaitActive ("Diablo II")
$Timer = TimerInit ()
While TimerDiff ($Timer) < 3000
    TrayTip ("Pixel Grabbing", "In " & 3 - Int (TimerDiff ($Timer)/1000) & " seconds", 10)
    Sleep (250)
WEnd
TrayTip ("", "", 1)
$Color = PixelGetColor (77, 540)
MsgBox (0, "Pixel Grabbed", "Pixel Color for: (77, 540) is:" & @CRLF & "Dec: " & $Color & @CRLF & "Hex: " & Hex ($Color, 6))

Edited by greenmachine
Link to comment
Share on other sites

WinActivate ("Diablo II")
WinWaitActive ("Diablo II")
$Timer = TimerInit ()
While TimerDiff ($Timer) < 3000
    TrayTip ("Pixel Grabbing", "In " & 3 - Int (TimerDiff ($Timer)/1000) & " seconds", 10)
    Sleep (250)
WEnd
TrayTip ("", "", 1)
$Color = PixelGetColor (77, 540)
MsgBox (0, "Pixel Grabbed", "Pixel Color for: (77, 540) is:" & @CRLF & "Dec: " & $Color & @CRLF & "Hex: " & Hex ($Color, 6))
While 1

$coord = PixelSearch( 77, 540, 77, 540, 16777215)

If Not @error Then

call("close")

EndIf

WEnd

Func close()

winkill("Diablo II")

exit

EndFunc

well I got this pixel, when I was in diablo and turned on script and went back in diablo it booted me. so I have the wrong pixel or its not reading the pixel if I sent a picture could you get the same pixels or does the game give you different kind of pixel colors.

Thanks in advance
Link to comment
Share on other sites

So this is your code...

While 1

$coord = PixelSearch( 77, 540, 77, 540, 16777215)

If Not @error Then

call("close")

EndIf

WEnd

Func close()

winkill("Diablo II")

exit

EndFunc

What that does is kill Diablo II if a pure white pixel is found in that search. I'm assuming that since you say it "booted you" that it found a pixel.

I'm also fairly sure pure white isn't what you want to look for if you're checking a red health bar. Use hex format 0xRRGGBB and it'll work better (much easier to read).

Oh, and instead of Call ("close"), just do close().

Edited by greenmachine
Link to comment
Share on other sites

  • Moderators

IMHO...ThatsGreat... Big applaud... but I'm wondering what this guy has done to make this work himself??

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

IMHO...ThatsGreat... Big applaud... but I'm wondering what this guy has done to make this work himself??

lol I made this script, well with help :)

If WinExists("Diablo II") Then
    HotKeySet("{Space}", "close")
Else
    MsgBox(64, "Info", "The game isn´t running!")
    Exit(0)
EndIf

Func Close()
    Send("!{F4}")
EndFunc

While 1
    Sleep(100)
WEnd

im not a pixel type of guy right now and ill give that a try and see if it works, Thanks everybody that is helping, but alot goes out to green :mellow:

Edited by Evil_Has_Survived
Thanks in advance
Link to comment
Share on other sites

While 1
$coord = PixelSearch( 77, 540, 77, 540, 16777215)
If Not @error Then
call("close")
EndIf
WEnd

Func close()
winkill("Diablo II")
exit
EndFunc

ok lol one last question I hope :) I replaced 16777215 with 0xRRGGBB and it didn't like it. oh and smoke by you guys giving me scripts I like reading them to learn them :mellow:.

Edited by Evil_Has_Survived
Thanks in advance
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...