Jump to content

Look at my script


Recommended Posts

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)
WEnd
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.

'

CODE
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

Edited by Aasem
Link to comment
Share on other sites

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.

'

CODE
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

Here is a example of what happens Shadow Copy's Action: dodges right

You 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

It 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 by Aasem
Link to comment
Share on other sites

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") Then

Once 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") Then

You 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

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") Then

Once 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") Then

You 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

Nice try...

Global $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

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

Here is a example of what happens Shadow Copy's Action: dodges right

You 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

#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 :D

Lets try like this

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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

#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 :D

Lets try like this

That 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

That didn't do anything.

it did :D its detecting right left and no movment ;)

probably y did not tested it like you shud :D

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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

it did :D its detecting right left and no movment ;)

probably y did not tested it like you shud :D

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

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 connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...