Evil_Has_Survived Posted March 28, 2006 Posted March 28, 2006 ok all my friends say that diablo2 owns, and well I went out and bought it, they want me to play hardcore since I don't want to risk my cd key using maphacks, I decided to make a chicken thingy ChickenLifePercent=25; //chicken if life <25% ChickenManaPercent=0; //disabled MercChickenPercent=0; //disabled ChickenMode=0; ;0 off ;1 on if lifelose=25% send("{space}") 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 LOL as you can tell im new and im nooby, but I would love if you can make it something on the lines of this. I have made a script so that if space is hit you exit the game but I perfer it doing it itself. Thanks in advance
Thatsgreat2345 Posted March 28, 2006 Posted March 28, 2006 (edited) i dont understand whats going on all i can figure so far is that if the game isnt running you want a message box to pop up saying its not running but if it is u want a hotkey to be space that will kill the game. i just dont understand the chicken part ull have to explain the whole chicken thing while 1 If Winexists("Diablo II") Then Hotkeyset("{Space}","close") Else Msgbox(0,"Not Running","Diablo II isn't running") Exit EndIf wend func close() winkill("Diablo II") EndFunc Edited March 28, 2006 by thatsgreat2345
Evil_Has_Survived Posted March 28, 2006 Author Posted March 28, 2006 (edited) thatsgreat2345 said: i dont understand whats going on all i can figure so far is that if the game isnt running you want a message box to pop up saying its not running but if it is u want a hotkey to be space that will kill the game. i just dont understand the chicken part ull have to explain the whole chicken thing while 1 If Winexists("Diablo II") Then Hotkeyset("{Space}","close") Else Msgbox(0,"Not Running","Diablo II isn't running") Exit EndIf wend func close() winkill("Diablo II") EndFunc ok ill explain in more detail i guess. heres picture thats the picture see the red orb, thats your health bar. say if you have 1000 health, I want it so if say you lose 500 health which is 25% of your health you automaticly get booted from the game. but you have to tell the script how much health you got. so I got 1000 I have to type that then type how much I have to lose until I Exit the game oh and chicken is your health by the way chicken means your being a chicken because you don't want to die Edited March 28, 2006 by Evil_Has_Survived Thanks in advance
Xenobiologist Posted March 28, 2006 Posted March 28, 2006 HI, maybe you can check whether the healthbar has its specific color with Pixel...! And if the color of the pixel changes (pixel has to be at 25%) then exit. So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
Evil_Has_Survived Posted March 28, 2006 Author Posted March 28, 2006 (edited) th.meger said: HI,maybe you can check whether the healthbar has its specific color with Pixel...! And if the color of the pixel changes (pixel has to be at 25%) then exit.So long,MegaI have thought about that but one I don't know how to set or use pixels yet, and two when I level up I like putting points to health and I have items that give health so how would I keep changing that. I have thoguht about a script like this.currenthealth=("1000")losehealth=("500") or losehealth=("25%")If WinExists("Diablo II") Then HotKeySet("{Space}", "close")Else MsgBox(64, "Info", "The game isn´t running!") Exit(0)EndIfFunc Close() Send("!{F4}")EndFuncWhile 1 Sleep(100)sure enuff this script won't work but something on the lines of this would be niceWEnd Edited March 28, 2006 by Evil_Has_Survived Thanks in advance
Evil_Has_Survived Posted March 28, 2006 Author Posted March 28, 2006 I guess I am on my own for now. If you guys come up with something post please. Thanks in advance
Evil_Has_Survived Posted March 28, 2006 Author Posted March 28, 2006 (edited) thatsgreat2345 said: use the autoits window infothanks ill try it this is to find the pixels right. would someone send a example script of what I would do with the pixels when I get them please.ok I tryed it, I put the mouse on the health bar and pushed ctrl-alt-f to pause, this was my resultHex: 0x6F6F6F Dec: 7303023 Edited March 28, 2006 by Evil_Has_Survived Thanks in advance
Moderators SmOke_N Posted March 28, 2006 Moderators Posted March 28, 2006 I gave a fairly detailed example here: http://www.autoitscript.com/forum/index.ph...ndpost&p=166286 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 28, 2006 Author Posted March 28, 2006 SmOke_N said: I gave a fairly detailed example here: http://www.autoitscript.com/forum/index.ph...ndpost&p=166286thanks ill give it a shot but im not to good with pixels, I started scripting not to long ago I made a few scripts Thanks in advance
Moderators SmOke_N Posted March 28, 2006 Moderators Posted March 28, 2006 I enjoy pixel work (Now), but didn't when I first started, but through many many many etc... failures, I've gotten them down fairly well... One thing to keep in mind... Since Larry wrote most if not all of them (the functions), I would search alot of his threads he has made in reference to them, he truly is an AutoIt Guru! 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 28, 2006 Author Posted March 28, 2006 (edited) SmOke_N said: I enjoy pixel work (Now), but didn't when I first started, but through many many many etc... failures, I've gotten them down fairly well... One thing to keep in mind... Since Larry wrote most if not all of them (the functions), I would search alot of his threads he has made in reference to them, he truly is an AutoIt Guru!hm if you wouldn't mind I have a crazy idea.----------- <----------------1000 l ll l .............. <--------------- 50% main pixell ll l------------ <----------------DEADlol I didn't know how to add a picture off of my desktop, anyways pretend that the shitty picture I drew was my health bar lol. As you can see were it says 50% main pixel if I went in the game, and got the middle pixel(50%) marker and made a script telling it once it hits the 50% maker to exit the game would that work.since this maybe hard to read ill make another example.If WinExists("Diablo II") Sleep(1000)if (50%) marker is hit exit ("Diablo II")Func Close() Send("!{F4}")EndFuncWhile 1 Sleep(100)WEndit would look different but that sorta of a cheap smaple If this is not possible I would like a script like this pleaseIf WinExists("Diablo II") Sleep(1000)sethealth(1000)healthleave(500) or (50%)if (50%) marker is hit exit ("Diablo II")Func Close() Send("!{F4}")EndFuncWhile 1 Sleep(100)WEnd Edited March 28, 2006 by Evil_Has_Survived Thanks in advance
Thatsgreat2345 Posted March 28, 2006 Posted March 28, 2006 u would have to get the color , which is some sort of red, and the coords so just use autoits get info shit and then press shift ctrl f to save it and post it here cuz we just need 2 coords and we cna use the same coords for both top left and bottom right
Evil_Has_Survived Posted March 28, 2006 Author Posted March 28, 2006 Press CTRL-ALT-F to pause the display. >>>>>>>>>>>> Window Details <<<<<<<<<<<<< Title: Diablo II Class: Diablo II Size: X: 0 Y: 0 W: 800 H: 600 >>>>>>>>>>> Mouse Details <<<<<<<<<<< Screen: X: 77 Y: 540 Cursor ID: 2 >>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<< RGB: Hex: 0x888888 Dec: 8947848 >>>>>>>>>>> Control Under Mouse <<<<<<<<<<< Size: Control ID: ClassNameNN: Text: >>>>>>>>>>> Status Bar Text <<<<<<<<<<< >>>>>>>>>>> Visible Window Text <<<<<<<<<<< >>>>>>>>>>> Hidden Window Text <<<<<<<<<<< heres what I got Thanks in advance
Thatsgreat2345 Posted March 29, 2006 Posted March 29, 2006 (edited) While 1 $coord = PixelSearch( 77, 540, 77, 540, 0x888888) If Not @error Then call("close") EndIf WEnd Func close() winkill("Diablo II") exit EndFunc Edited March 29, 2006 by thatsgreat2345
Evil_Has_Survived Posted March 29, 2006 Author Posted March 29, 2006 (edited) thatsgreat2345 said: While 1 $coord = PixelSearch( 77, 540, 77, 540, 0x888888) If Not @error Then close() EndIf WEnd Func close() winkill("Diablo II") exit EndFunc nope sorry didn't work still died but thanks, ill try messing with it I think your script will work great jsut wrong pixel I think thats my mistake ill look again >>>>>>>>>>>> Window Details <<<<<<<<<<<<< Title: Diablo II Class: Diablo II Size: X: 0 Y: 0 W: 800 H: 600 >>>>>>>>>>> Mouse Details <<<<<<<<<<< Window: X: 73 Y: 536 Cursor ID: 2 >>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<< RGB: Hex: 0x6F6F6F Dec: 7303023 that might help ok Edited March 29, 2006 by Evil_Has_Survived Thanks in advance
Thatsgreat2345 Posted March 29, 2006 Posted March 29, 2006 (edited) Evil_Has_Survived said: nope sorry didn't work still died but thanks While 1 $coord = PixelSearch( 73, 536, 72, 536, 0x6F6F6F) If Not @error Then close() EndIf WEnd Func close() winkill("Diablo II") exit EndFunc Edited March 29, 2006 by thatsgreat2345
Evil_Has_Survived Posted March 29, 2006 Author Posted March 29, 2006 (edited) thatsgreat2345 said: While 1 $coord = PixelSearch( 73, 536, 72, 536, 0x6F6F6F) If Not @error Then close() EndIf WEnd Func close() winkill("Diablo II") exit EndFunc still not working did I mention that when you lose health the red turns transparent.. also RECTANGLE ? found in help file left coordinate of rectangle. <---- top top coordinate of rectangle. <---- right right coordinate of rectangle. <---- bottom bottom coordinate of rectangle. <---- colour Colour value of pixel to find (in decimal or hex). shade-variation [optional] A number between 0 and 255 to indicate the allowed number of shades of variation of the red, green, and blue components of the colour. Default is 0 (exact match). step [optional] Instead of searching each pixel use a value larger than 1 to skip pixels (for speed). E.g. A value of 2 will only check every other pixel. Default is 1. Edited March 29, 2006 by Evil_Has_Survived Thanks in advance
Thatsgreat2345 Posted March 29, 2006 Posted March 29, 2006 (edited) im sure it was finding the pixel its just not killing the window While 1 $coord = PixelSearch( 73, 536, 72, 536, 0x6F6F6F) If Not @error Then close() EndIf WEnd Func close() winkill('') exit EndFunc Edited March 29, 2006 by thatsgreat2345
Evil_Has_Survived Posted March 29, 2006 Author Posted March 29, 2006 (edited) I could jsut use this. 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 but I would like to have them both Edited March 29, 2006 by Evil_Has_Survived Thanks in advance
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