Aasem Posted June 12, 2009 Author Share Posted June 12, 2009 (edited) Maybe:WinActivate("Bleach: Last Horizon 2.0 Alpha", "") WinWaitActive("Bleach: Last Horizon 2.0 Alpha", "") Send("{NUMPAD5}") WinWaitActive("Shadow Sparring", "") Send("{Enter}") SendKeepActive("Bleach: Last") While 1 If WinExists("Bleach: Last", "dodges right") Then Send("{NUMPAD9}") If WinExists("Bleach: Last", "dodges left") Then Send("{NUMPAD7}") If WinExists("Bleach: Last", "no movement") Then Send("{NUMPAD8}") Sleep(9) WEndI am still getting the same problem. EDIT No it works to a point. Maybe I need to put sleep time in between because it's going too fast? Here is my first code where it recognizes them all but will not loop. Also what are strings? Maybe I can use them to my advantage in this. 'CODEWinActivate ( "Bleach: Last Horizon 2.0 Alpha", "") WinWaitActive ( "Bleach: Last Horizon 2.0 Alpha", "") Send ( "{NUMPAD5}" ) WinWaitActive ( "Shadow Sparring", "") Send ( "{Enter}" ) If WinWaitActive ( "Bleach: Last Horizon 2.0 Alpha", "Shadow Copy's Action: dodges right") Then Send ( "{NUMPAD9}" ) ElseIf WinWaitActive ( "Bleach: Last Horizon 2.0 Alpha", "Shadow Copy's Action: dodges left.") Then Send ( "{NUMPAD7}" ) Else WinWaitActive ( "Bleach: Last Horizon 2.0 Alpha", "Shadow Copy's Action: no movement.") Send ( "{NUMPAD8}" ) EndIf Edited June 12, 2009 by Aasem Link to comment Share on other sites More sharing options...
Aasem Posted June 12, 2009 Author Share Posted June 12, 2009 (edited) I am still getting the same problem.EDIT No it works to a point. Maybe I need to put sleep time in between because it's going too fast?Here is my first code where it recognizes them all but will not loop. Also what are strings? Maybe I can use them to my advantage in this.'CODEWinActivate ( "Bleach: Last Horizon 2.0 Alpha", "")WinWaitActive ( "Bleach: Last Horizon 2.0 Alpha", "")Send ( "{NUMPAD5}" )WinWaitActive ( "Shadow Sparring", "")Send ( "{Enter}" )If WinWaitActive ( "Bleach: Last Horizon 2.0 Alpha", "Shadow Copy's Action: dodges right") ThenSend ( "{NUMPAD9}" )ElseIfWinWaitActive ( "Bleach: Last Horizon 2.0 Alpha", "Shadow Copy's Action: dodges left.") ThenSend ( "{NUMPAD7}" )ElseWinWaitActive ( "Bleach: Last Horizon 2.0 Alpha", "Shadow Copy's Action: no movement.")Send ( "{NUMPAD8}" )EndIfHere is a example of what happens Shadow Copy's Action: dodges rightYou have Successfully hit your shadow copy!Shadow Copy's Action: dodges left.You have Successfully hit your shadow copy!Shadow Copy's Action: no movement.You have Successfully hit your shadow copy!Shadow Copy's Action: dodges left.You have failed to hit your shadow copy and it dissipates!You end your Training session.Taichou has just completed theIt only stops working when it comes to left shadow spar. Hmmm maybe it has something to do with thaqt command? Middle and right works fine. Kudos to you being you got me the furthest. :] Edited June 12, 2009 by Aasem Link to comment Share on other sites More sharing options...
Aasem Posted June 12, 2009 Author Share Posted June 12, 2009 Errr bumpity? Link to comment Share on other sites More sharing options...
herewasplato Posted June 12, 2009 Share Posted June 12, 2009 I'm probably not the best person to help you script a game. I only posted because you said that your code worked, but not in a loop. And because others were repeating your code in various forms.I cannot understand how your code ever worked.The code that you posted should halt/wait here:If WinWaitActive ( "Bleach: Last Horizon 2.0 Alpha", "Shadow Copy's Action: dodges right") ThenOnce that window/text is active, the script sends the number and then exits. None of the other lines will ever run.Are you sure that your code does not use:If WinActive ( "Bleach: Last Horizon 2.0 Alpha", "Shadow Copy's Action: dodges right") ThenYou said, "Also what are strings? Maybe I can use them to my advantage in this."I'm too tired to explain, so I'll just say that they are hard to push. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Aasem Posted June 12, 2009 Author Share Posted June 12, 2009 I'm probably not the best person to help you script a game. I only posted because you said that your code worked, but not in a loop. And because others were repeating your code in various forms.I cannot understand how your code ever worked.The code that you posted should halt/wait here:If WinWaitActive ( "Bleach: Last Horizon 2.0 Alpha", "Shadow Copy's Action: dodges right") ThenOnce that window/text is active, the script sends the number and then exits. None of the other lines will ever run.Are you sure that your code does not use:If WinActive ( "Bleach: Last Horizon 2.0 Alpha", "Shadow Copy's Action: dodges right") ThenYou said, "Also what are strings? Maybe I can use them to my advantage in this."I'm too tired to explain, so I'll just say that they are hard to push.I'm not sure. When I replace the WinWaitActive with WinActive it doesn't work at all. Err if anyone else can explain strings that would be fine. Link to comment Share on other sites More sharing options...
Aasem Posted June 12, 2009 Author Share Posted June 12, 2009 Nice try... expandcollapse popupGlobal $Paused, $Active HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("{F9}", "ShowMe") ;;;; Body of program would go here ;;;; While 1 While $Active WinActivate("Bleach: Last Horizon 2.0 Alpha", "") WinWaitActive("Bleach: Last Horizon 2.0 Alpha", "") Send("{NUMPAD5}") WinWaitActive("Shadow Sparring", "") Send("{Enter}") If WinWaitActive("Bleach: Last Horizon 2.0 Alpha", "Shadow Copy's Action: dodges right") Then Send("{NUMPAD9}") ElseIf WinWaitActive("Bleach: Last Horizon 2.0 Alpha", "Shadow Copy's Action: dodges left.") Then Send("{NUMPAD7}") Else WinWaitActive("Bleach: Last Horizon 2.0 Alpha", "Shadow Copy's Action: no movement.") Send("{NUMPAD8}") EndIf Sleep(10) WEnd WEnd ;;;;;;;; Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() Exit 0 EndFunc ;==>Terminate Func ShowMe() $Active = Not $Active EndFunc ;==>ShowMe *** NOT TESTED EDITED**** 8)I randomedly tried this. It worked. I don't know what I did wrong. But for some reason it loops the whole thing. I need the code to loop only the shadow spars IF's. Link to comment Share on other sites More sharing options...
herewasplato Posted June 12, 2009 Share Posted June 12, 2009 The simple and incomplete definition of a "string" in AutoIt is that it is the same thing as text.There can be empty strings but I'm not sure that there can be empty text.[unless you count political speeches.]An empty string in AutoIt is assumed to be False if used a Boolean.[Political speeches can also be assumed to be false.]Clear as mud? [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Aasem Posted June 12, 2009 Author Share Posted June 12, 2009 So that means empty strings can be the reason my code ins't working? Link to comment Share on other sites More sharing options...
herewasplato Posted June 12, 2009 Share Posted June 12, 2009 So that means empty strings can be the reason my code ins't working?No. I don't think that you need to know about strings to script this game. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
herewasplato Posted June 12, 2009 Share Posted June 12, 2009 Here is a example of what happens Shadow Copy's Action: dodges rightYou have Successfully hit your shadow copy!Shadow Copy's Action: dodges left.You have Successfully hit your shadow copy!Shadow Copy's Action: no movement.You have Successfully hit your shadow copy!Shadow Copy's Action: dodges left.You have failed to hit your shadow copy and it dissipates!You end your Training session.Taichou has just completed the...Is this like text in a chat window?If it is, then you will not be able to use Win...(title, text) to identify the window. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Aasem Posted June 12, 2009 Author Share Posted June 12, 2009 Here is just a screen shot I took. Maybe this will help more.Note the bottom right. Link to comment Share on other sites More sharing options...
Aasem Posted June 12, 2009 Author Share Posted June 12, 2009 Bumpity bump. Link to comment Share on other sites More sharing options...
Aasem Posted June 12, 2009 Author Share Posted June 12, 2009 Bump so it doesn't fall on the second page. :[ Link to comment Share on other sites More sharing options...
oMBRa Posted June 12, 2009 Share Posted June 12, 2009 you are allowed to bump your thread once within 24 hours Link to comment Share on other sites More sharing options...
bogQ Posted June 12, 2009 Share Posted June 12, 2009 (edited) #include <Array.au3> While 1 $data = WinGetText("Bleach: Last Horizon 2.0 Alpha") $split = StringSplit($data,"Shadow Copy's Action: ",1) ;~ _ArrayDisplay($split, "$avArray as a 2D array") $splited = StringLeft($split[$split[0]],8) Select Case $splited = "dodges l" ToolTip("LEFT",0,0) Case $splited = "dodges r" ToolTip("RIGHTT",0,0) Case $splited = "no movem" ToolTip("NO MOVEMENT",0,0) Case Else ToolTip("I DONT SEE ANYTHING",0,0) EndSelect Sleep(100) WEnd edit: added Case Else Lets try like this Edited June 12, 2009 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Aasem Posted June 12, 2009 Author Share Posted June 12, 2009 #include <Array.au3> While 1 $data = WinGetText("Bleach: Last Horizon 2.0 Alpha") $split = StringSplit($data,"Shadow Copy's Action: ",1) ;~ _ArrayDisplay($split, "$avArray as a 2D array") $splited = StringLeft($split[$split[0]],8) Select Case $splited = "dodges l" ToolTip("LEFT",0,0) Case $splited = "dodges r" ToolTip("RIGHTT",0,0) Case $splited = "no movem" ToolTip("NO MOVEMENT",0,0) Case Else ToolTip("I DONT SEE ANYTHING",0,0) EndSelect Sleep(100) WEnd edit: added Case Else Lets try like thisThat didn't do anything. But you think I should try a select case instead of a If, elseif, else? Link to comment Share on other sites More sharing options...
bogQ Posted June 12, 2009 Share Posted June 12, 2009 That didn't do anything.it did its detecting right left and no movment probably y did not tested it like you shud TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Aasem Posted June 12, 2009 Author Share Posted June 12, 2009 it did its detecting right left and no movment probably y did not tested it like you shud Oh yeah it's detecting it, but when I use other peoples codes I have no idea what to do from there. Can you help me further? Link to comment Share on other sites More sharing options...
bogQ Posted June 12, 2009 Share Posted June 12, 2009 but when I use other peoples codes I have no idea what to do from there. Can you help me further?anyone can, y got to start learning and testing 'string' and 'Array' comands from the help file, so that y can understand them and after that if u have problem or something that y dont understand post on forum and someone will try to help if your stuck. TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Aasem Posted June 12, 2009 Author Share Posted June 12, 2009 I don't understand what a string is completely or a array cmmand. Can you give me of a example place to use them? 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