AntiBNI Posted December 14, 2006 Posted December 14, 2006 Im making a script that will send Spacebar and ` to a active window and also it will chek if the HP of an character is at 3/5 , 1/2 and at 1/3 of the hp. If its at 3/5 it will send again Spacebar key and `,but if its at 1/2 it will send 4 wait 20 secs and send 4 again and if its at 1/3 of the HP the script will close the game and close it self. The problem is that it does send the Space and the ` key but when it should send 4 because the HP is lower then the requiered,the script closes and i donno why it does that. Heres the Script. sleep (10000) send (" ") sleep (100) send (" ") sleep (20000) send ("`") sleep (2000) send ("`") sleep (2000) send ("`") sleep (2000) send ("`") If PixelGetColor (204,31) = 47616 Then send (" ") sleep (100) send (" ") sleep (20000) send ("`") sleep (2000) send ("`") sleep (2000) send ("`") sleep (2000) send ("`") Else If PixelGetColor (174,31) = 47616 Then Send ("4") sleep (17000) Send ("4") Else If PixelGetColor (111,31) = 5315 Then ProcessClose ("whatever.exe") Then ProcessClose("whatever.au3") EndIf EndIf EndIf Thnx in advice. cheers, Anti
Dizzydbd Posted December 14, 2006 Posted December 14, 2006 ProcessClose ("whatever.exe") Thenhuh?Also u may want to do all this in a while loop. I don't really understand what u try to pull with this.
AntiBNI Posted December 14, 2006 Author Posted December 14, 2006 huh?Also u may want to do all this in a while loop. I don't really understand what u try to pull with this.I just want that when my chars HP gets low the bots send numkey (4) or if HP is not so low it keeps killing and yah i will do a loop.i just want to know why it dosent send 4 and it closes.
Uten Posted December 14, 2006 Posted December 14, 2006 Im making a script that will send Spacebar and ` to a active window and also it will chek if the HP of an character is at 3/5 , 1/2 and at 1/3 of the hp. If its at 3/5 it will send again Spacebar key and `,but if its at 1/2 it will send 4 wait 20 secs and send 4 again and if its at 1/3 of the HP the script will close the game and close it self. The problem is that it does send the Space and the ` key but when it should send 4 because the HP is lower then the requiered,the script closes and i donno why it does that. Heres the Script. sleep (10000) send (" ") sleep (100) send (" ") sleep (20000) send ("`") sleep (2000) send ("`") sleep (2000) send ("`") sleep (2000) send ("`") If PixelGetColor (204,31) = 47616 Then send (" ") sleep (100) send (" ") sleep (20000) send ("`") sleep (2000) send ("`") sleep (2000) send ("`") sleep (2000) send ("`") Else If PixelGetColor (174,31) = 47616 Then Send ("4") sleep (17000) Send ("4") Else If PixelGetColor (111,31) = 5315 Then ProcessClose ("whatever.exe") Then ProcessClose("whatever.au3") EndIf EndIf EndIf Thnx in advice. cheers, AntiUSe tidy on your script (and use scite4autoit3 if you dont allready). According to your description of the problem you should watch your PixelGetColor calls. Use some ConsoleWrite (or msgbox) calls do get a picture of what is appening. Or do a search for +assert +dbg in the forum. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
AntiBNI Posted December 14, 2006 Author Posted December 14, 2006 USe tidy on your script (and use scite4autoit3 if you dont allready). According to your description of the problem you should watch your PixelGetColor calls. Use some ConsoleWrite (or msgbox) calls do get a picture of what is appening. Or do a search for +assert +dbg in the forum. nvm,did it. i changed the PixelGetColor (174,31) = 47616 to PixelSearch (x,0,y,0,Pixel Color)=PixelColor =P thanks Uten for ur response. Apriciate it. Cheers, Anti
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