crazedwombat Posted May 1, 2009 Share Posted May 1, 2009 (edited) OK, i've got little to no experience in programming, but i've always had a knack for it naturally..so far this is what i've taught myself and seen in examples and i need help with the questions listed afterwards..HotKeySet("^!x", "MyExit")while 1;autopot$coord = PixelSearch(127,169,128,170,0x0011B5) ; check mana and pot accordinglyIf @error Then send(4) sleep(500)EndIf$coord = PixelSearch(323,155,324,156,0xCFEAFB) ; make sure enemy isn't targetted, don't want to be healing while i am fightingif @error Then$coord = PixelSearch(177,156,178,157,0xEA0000) ; check hp level and heal accordinglyIf @error Then send(3) sleep(5000)EndIfEndIfWEndwhile 1 ;autofight$coord = PixelSearch(323,155,324,156,0xCFEAFB) ; no enemy targetted? target one and kill!if @error Then send("2") sleep(500) send("2") sleep(500) send("{TAB}") sleep(500) send("1") sleep(500)EndIfWEndFunc MyExit() ExitEndFunc As you may be able to tell this is a simplistic bot for use with a game that has so many shortcuts that it only NEEDS to be simple..My questions are as follows:1. For some reason the bot gets stuck attacking and never seems to do the autopot loop except sometimes randomly, how can i make it do the autopot loop until it registers the right pixels(full hp/mana) before it continues to the autofight, and then how to get it to stop the autofight and return to the autopot once my character is hurt?however, the auto pot alone works, and the auto fight alone works, it's only when i combine the 2 scripts that it can't seem to figure out which one takes priority. I've tried DO/UNTIL, EXITLOOP, i just can't figure it out i guess.. so used to the old goto days i can't figure out how to make it stick to one loop until completed then move to the next then back again.2. The window, which is actually in WINDOWED mode not fullscreen, is titled in japanese, i've used the info tool to get the name, and then tried using WinActivate("口袋西游") but instead of 口袋西游 it says ???? and it doesn't active the window....... how can i make it activate the window? because as of now it's a race between scite and clicking the window just to debug my script.... here's a snap of the info tool on the window i want it to activate..>>>> Window <<<<Title: 口袋西游Class: XYElementClient WindowPosition: -1, 98Size: 808, 638Style: 0x94CE0000ExStyle: 0x00000100Handle: 0x000700B4>>>> Control <<<<Class: Instance: ClassnameNN: Advanced (Class): ID: Text: Position: Size: ControlClick Coords: Style: ExStyle: Handle: 0x0001007A>>>> Mouse <<<<Position: 680, 225Cursor ID: 0Color: 0xB2922B>>>> StatusBar <<<<>>>> Visible Text <<<<>>>> Hidden Text <<<<THANKS IN ADVANCE.. PS i've tried searching to find the answers, but when your questions are as long as mine are it is at best a futile effort. That and if i don't know what command i'm having problems with / not using, i can't know to search for it, i wish goto was still available, if pixelsearch = 1 then goto autopot, how are these loops easier than that? Edited May 1, 2009 by crazedwombat Link to comment Share on other sites More sharing options...
BrettF Posted May 1, 2009 Share Posted May 1, 2009 Try some more error checking... What does PixelSearch return? Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
crazedwombat Posted May 1, 2009 Author Share Posted May 1, 2009 Try some more error checking... What does PixelSearch return? Cheers,BrettI'm not sure how to check that, but like i said i can split the 2 scripts up, and they work fine independently, just not when i combine them. i've also tried making it one big loop by just deleting the first wend and second while 1, still the same result.Pixelsearch must be returning right, it just can't decide whether it should attack or pot, and understandably so, because both the heal and the attack are dependent on NOT having an enemy targetted. Link to comment Share on other sites More sharing options...
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