Moderators SmOke_N Posted March 29, 2006 Moderators Posted March 29, 2006 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 .Well currently there are 164041 posts in this forum... there are a few scripts in there to learn from I'm sure 1. There's no need to use Call('Close'), you should just use Close() 2. Did you literally put in "0xRRGGBB"? Or did you put in the Hex color for 16777215? 3. You are only looking in one spot... x = 77 , y = 540 for the section you are wanting to search... so you don't need to use PixelSearch() you could use PixelGetColor() 4. You aren't using Opt('PixelCoordMode', somenumber) like I suggested. Opt('WinTitleMatchMode', 2) Opt('PixelCoordMode', 2);<< look in help to see what that should be (again how did you get your coords in AutoInfo >> Options >> Coord Mode While 1 If (PixelGetColor(77, 540) == 16777215) Then Close() EndIf Sleep(10) WEnd Func Close() WinKill('Diablo II') EndFunc 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.
Evil_Has_Survived Posted March 29, 2006 Author Posted March 29, 2006 (edited) um lol 164041 posts I think you have mistaken your post makes post 42. and I ran your script it doesn't work. I don't get why this takes so long all we need is the one pixel and the health bar is red but when you lose health it turns transparent for example. I should of posted this picture maybe early lol see the picture thats what it looks like when your dead, no red health when your health drops it turns transparent I used a god mode Edited March 29, 2006 by Evil_Has_Survived Thanks in advance
Evil_Has_Survived Posted March 29, 2006 Author Posted March 29, 2006 lol I didn't know that one post would be this big because of one little pixel hehe, ill try messing with it and see if I can find the correct pixel Thanks in advance
greenmachine Posted March 30, 2006 Posted March 30, 2006 um lol 164041 posts I think you have mistaken your post makes post 42. and I ran your script it doesn't work. I don't get why this takes so long all we need is the one pixel and the health bar is red but when you lose health it turns transparent for example. I should of posted this picture maybe early lolsee the picture thats what it looks like when your dead, no red health when your health drops it turns transparentI used a god mode He said forum (all of support or even all of the forums), not this thread. What he meant is that after 160000+ posts, there's got to be a solution floating out there already (and there is, I've worked on it before). What is implied by that is that you should go search.It's taking forever because you're not getting it. It really doesn't sound like you're working much on your own... try going back to the beginning and re-reading all the help that's been given, read some more in the helpfile, and write your own script. Just play with it a while and see what happens.
viking Posted March 30, 2006 Posted March 30, 2006 (edited) Ok, here it comes It's a finished script. Func CheckLife() $life = PixelGetColor(61, 574) If $life <> 5898240 Then ExitGame() EndIf EndFunc Func ExitGame() Send("{SPACE}"); Change to your "Clear Screen" key Sleep(10) Send("{ESC}") Sleep(200) MouseClick("left",361,284,1,0) Sleep(1000) EndFunc WinActivate("Diablo II") WinWaitActive("Diablo II") WinMove("Diablo II", "", 1, 1) While 1 CheckLife() Sleep(200) Wend This will exit the game if the life is below ~40% It checks every 0.2 seconds (200ms). Edit it to whatever you like! Edit: It's made for 1024x768 windows resolution and 16 bit colors. And oh, here is a little script that writes the color under your mouse to a textfile. Press INSERT to print the color under your mouse. HotKeySet("{INSERT}", "GetColor") winactivate("Diablo II") WinWaitActive("Diablo II") winmove("Diablo II", "", 1, 1) Func GetColor() $coords = MouseGetPos() sleep(100) mouseMove(800, 600, 1) sleep(400) $color = pixelgetcolor($coords[0], $coords[1]) sleep(50) $file = FileOpen("colors.txt", 1) filewriteline("colors.txt", $color & " coords: " & $coords[0] & ", " & $coords[1]) FileClose($file) EndFunc while 1 sleep(200) WEnd Edited March 30, 2006 by viking
greenmachine Posted March 30, 2006 Posted March 30, 2006 Ok, here it comes Put all this your AutoIt File. Func CheckLife() $life = PixelGetColor(61, 574) If $life <> 5898240 Then ExitGame() EndIf EndFunc Func ExitGame() Send("{ESC}") Sleep(200) MouseClick("left",361,284,1,0) Sleep(1000) EndFunc WinActivate("Diablo II") WinWaitActive("Diablo II") WinMove("Diablo II", "", 1, 1) While 1 CheckLife() Sleep(200) Wend This will exit the game if the life is below ~40% It checks every 0.2 seconds (200ms). Edit it to whatever you like! Edit: It's made for 1024x768 windows resolution and 16 bit colors. And oh, here is a little script that writes the color under your mouse to a textfile. Press INSERT to print the color under your mouse. HotKeySet("{INSERT}", "GetColor") winactivate("Diablo II") WinWaitActive("Diablo II") winmove("Diablo II", "", 1, 1) Func GetColor() $coords = MouseGetPos() sleep(100) mouseMove(800, 600, 1) sleep(400) $color = pixelgetcolor($coords[0], $coords[1]) sleep(50) $file = FileOpen("colors.txt", 1) filewriteline("colors.txt", $color & " coords: " & $coords[0] & ", " & $coords[1]) FileClose($file) EndFunc while 1 sleep(200) WEnd I was going to mention the life never being 90, but you just fixed that. But I still have this other thing to mention: One problem with sending ESC to exit the game is that ESC also closes menus (such as inventory, etc).. so what happens when the user has his inventory open because he is trying to switch weapons (or whatever) and gets hit below 50% life? Hitting esc might just close the window and cause him to drop the fancy gear, and/or die anyway because he didn't fully exit the game in time.
viking Posted March 30, 2006 Posted March 30, 2006 (edited) He can edit it of course, maybe send Clear Screen first? (Default Space) And oh, about the life. When you use colormode, 1 (BGR), the red color on the lifeball is 90. OK i added the space key Edited March 30, 2006 by viking
greenmachine Posted March 30, 2006 Posted March 30, 2006 He can edit it of course, maybe send Clear Screen first?(Default Space)And oh, about the life.When you use colormode, 1 (BGR), the red color on the lifeball is 90.I see, didn't think of doing BGR color (I figured we should confuse him as little as possible since he can't get this much already).Space is clear screen? Hmm, didn't know that one either. Evidently botting d2 makes you really look at it, and I never did...
viking Posted March 30, 2006 Posted March 30, 2006 (edited) We can confuse this even more, i would say the best way for a "Chicken hack" is to simply read the "Current Life" address using the _MemRead function made by w0uter. Edited March 30, 2006 by viking
greenmachine Posted March 30, 2006 Posted March 30, 2006 We can confuse this even more, i would say the best way for a "Chicken hack" is to simply read the "Current Life" address using the _MemRead function made by w0uter.That'd probably be the most reliable way, and it's probably the way d2jsp does it.
Evil_Has_Survived Posted March 30, 2006 Author Posted March 30, 2006 I tryed I found out that one you have be in game before you turn it on lol or it clicks in the same spot and can't stop it. two when your in the game and turn it on it just saves the game and exits. thanks for trying once again though ill look at maphacks set up and see what I can find Thanks in advance
greenmachine Posted March 30, 2006 Posted March 30, 2006 I tryed I found out that one you have be in game before you turn it on lol or it clicks in the same spot and can't stop it. two when your in the game and turn it on it just saves the game and exits. thanks for trying once again though ill look at maphacks set up and see what I can findYou could always.. say.. edit the thing yourself. Or would it be too hard to remove the Exit?
Moderators SmOke_N Posted March 30, 2006 Moderators Posted March 30, 2006 I really think you should try this before continueing any further... you don't seem to be grasping anything specific, and looks like your expecting someone to write it specific for you...: http://www.autoitscript.com/forum/index.php?showtopic=21048 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.
Evil_Has_Survived Posted March 30, 2006 Author Posted March 30, 2006 im sort of new and im sorry, im pretty good but not when it's comes to pixel, well pixels are ok but not when your trying to locate them in a game thats the hardest, well atleast for me Thanks in advance
pcdestroyer Posted March 30, 2006 Posted March 30, 2006 (edited) wooh , haven't been on these forums for a while ;] well i wrote a bot a while ago, based on the rishodi one, but i made my own chicken/pot drinker ill post a link in a few minutes, i need to find the source code first ;] Edit: Check my signature i updated my site ;] , just look at the source code and you should be able to figure it out, its percentage based , meaning you need to set a percent of your life at which it will chicken out. Edit:#2 If you have any question, feel free to ask =P Edited March 30, 2006 by pcdestroyer
da.eXecutoR Posted August 7, 2006 Posted August 7, 2006 Hi I made a little "Following Bot" for Diablo2. Cause I dont have the time to level every single char, I wrote a Script with Autoit. This script runs a copy of diablo2 on my laptop. This character will follow the character with which I'm playing on my computer. If he's life falls bellow a level (in %, to set up in an ini file) he will drink a health pot. I will copy the life part here when I'm at home and didn't forgot it. I made it this way: The health bullet is for example 280px high. The bullet starts at 540px (if you play 800x600 window mode). So it means: 0% Life = 540px 100% Life = 540px -280px = 380px So if you want the script to quit @ 25% life do the following: 540 - (280/100*25) an check this pixel for the color RED. You get the HEX of this color by using the auto it window info. In the script check this pixel for the red color, if it isn't red. Close the game. If you want to keep in the game if you take poison dmg, also check for the green color. Hope you have an idea of how I made it. As I said... if I remember in the evening, I will put my source here. Greetings da.eXecutoR
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now