Jump to content

I'm not even sure if this will work.. but I will try


sandman
 Share

Recommended Posts

I just created this AutoAttack program for MYKO v1313, and I'm not really sure if it will work. I wanted to ask someone with more experience with AutoIt than me. I don't care if feedback is negative, but I need an idea of how close it will be to working and/or what I have done wrong or what I need to add in. (This is my first AutoIt script.)

; MyKO Basic Auto-Attack Script
; Please don't copy my ideas without my approval first...
;
; This script includes a simple GUI to start, and stop the macro.

; DO NOT EDIT ANYTHING UNTIL LINE __
#include <GUIConstants.au3>
Dim $StartEnable, $StopEnable, $msg1, $msg2, $start, $Help, $About, $msg3, $msg4
GUICreate("MYKO AUTOATTACK 0.1", 200, 100)
$StartEnable = GUICtrlCreateButton("Start", 0, 0, 40)
$StopEnable = GUICtrlCreateButton("Stop", 160, 0, 40)
$Help = GUICtrlCreateButton("Help", 0, 40, 40, 40)
$About = GUICtrlCreateButton("About", 160, 40, 40, 40)
GUISetState(@SW_SHOW)

While 1
    $msg1 = GUIGetMsg()
    
    Select
    Case $msg1 = $StartEnable
        $start = "1"
        
    Case $msg1 = $GUI_EVENT_CLOSE
        ExitLoop
    EndSelect
WEnd

While 1
    $msg2 = GUIGetMsg()
    
    Select
    Case $msg2 = $StopEnable
        $start = "0"
    EndSelect
WEnd

While 1
    $msg3 = GUIGetMsg()
    
    Select
    Case $msg3 = $Help
        GUICreate("Help", 500, 500)
        GUICtrlCreateLabel("To activate the macro, simply click the Start button. To stop it, click the stop button." & _
         "If there is no response within the MYKO client, you may need to disable HackShield. I believe there is a " & _
         "program at FG forums that can disable HackShield.. after beta testing I will finalize the steps for this." & _
         "But for now, in version 0.1, you are on your own.")
         GUISetState(@SW_SHOW)
     EndSelect
 WEnd
 
 While 1
     $msg4 = GUIGetMsg()
     
     Select
     Case $msg4 = $About
         GUICreate("About", 500, 500)
         GUICtrlCreateLabel("Created by sandman85048@aim.com. This is not a finalized" & _
         "version; I am not responsible for any bugs or problems but may be able to " & _
         "give some limited support via email. (c) 2007 sandman."
         GUISetState(@SW_SHOW)
     EndSelect
 WEnd

WinWaitActive("Knight OnLine Client")



Func Attack()
    Send ("z")
    Sleep(100)
    Send("r")
    Sleep(200)
EndFunc

Func Attacker()
    Call ("Attack")
EndFunc

While $start = "1"
    Call ("Attacker")
WEnd

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

Okay.. v0.2.. I have tested this and none of the buttons do anything.. Help please! :)

; MyKO Basic Auto-Attack Script
; Please don't copy my ideas without my approval first...
;
; This script includes a simple GUI to start, and stop the macro.

; DO NOT EDIT ANYTHING UNTIL LINE __
#include <GUIConstants.au3>
Dim $StartEnable, $StopEnable, $msg1, $msg2, $start, $Help, $About, $msg3, $msg4
GUICreate("MYKO AUTOATTACK 0.1", 200, 100)
$StartEnable = GUICtrlCreateButton("Start", 0, 0, 40)
$StopEnable = GUICtrlCreateButton("Stop", 160, 0, 40)
$Help = GUICtrlCreateButton("Help", 0, 40, 40, 40)
$About = GUICtrlCreateButton("About", 160, 40, 40, 40)
GUISetState(@SW_SHOW)

While 1
    $msg1 = GUIGetMsg()
    $msg2 = GUIGetMsg()
    $msg3 = GUIGetMsg()
    $msg4 = GUIGetMsg()
    
    Select
    Case $msg1 = $StartEnable
        $start = "1"
        
    Case $msg1 = $GUI_EVENT_CLOSE
        ExitLoop
        
    Case $msg2 = $StopEnable
        $start = "0"
        
    Case $msg3 = $Help
        GUICreate("Help", 500, 500)
        GUICtrlCreateLabel("To activate the macro, simply click the Start button. To stop it, click the stop button." & _
         "If there is no response within the MYKO client, you may need to disable HackShield. I believe there is a " & _
         "program at FG forums that can disable HackShield.. after beta testing I will finalize the steps for this." & _
         "But for now, in version 0.1, you are on your own.")
         GUISetState(@SW_SHOW)
         
     Case $msg4 = $About
         GUICreate("About", 500, 500)
         GUICtrlCreateLabel("Created by sandman85048@aim.com. This is not a finalized" & _
         "version; I am not responsible for any bugs or problems but may be able to " & _
         "give some limited support via email. (c) 2007 sandman."
         GUISetState(@SW_SHOW)
    EndSelect
WEnd

WinWaitActive("Knight OnLine Client")



Func Attack()
    Send ("z")
    Sleep(100)
    Send("r")
    Sleep(200)
EndFunc

Func Attacker()
    Call ("Attack")
EndFunc

While $start = "1"
    Call ("Attacker")
WEnd

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

I don't know.. I was just looking through the online documentation and I thought that would work. Why, is there some other command that does the same thing?

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

I don't know.. I was just looking through the online documentation and I thought that would work. Why, is there some other command that does the same thing?

Call ("Attacker")

And

Attacker()

are the same thing.

Is this a full screen game?

Edited by Hallman
Link to comment
Share on other sites

I fixed it up a bit. This should work now. It now can turn on/off with a hotkey (Home)

; MyKO Basic Auto-Attack Script
; Please don't copy my ideas without my approval first...
;
; This script includes a simple GUI to start, and stop the macro.


#include <GUIConstants.au3>

GUICreate("MYKO AUTOATTACK 0.1", 220, 100)
$StartEnable = GUICtrlCreateButton("Start", 10, 10, 100, 25)
$StopEnable = GUICtrlCreateButton("Stop", 110, 10, 100, 25)

GUICtrlSetState($StopEnable, $GUI_DISABLE) ; make the stop button disabled

$Help = GUICtrlCreateButton("Help", 10, 50, 100, 25)
$About = GUICtrlCreateButton("About", 110, 50, 100, 25)
GUISetState(@SW_SHOW)

$start = 0 ; create a variable which will identify if the macro is running or not. 1 = yes, 0 = no

HotKeySet("{HOME}", "SwitchOnOff") ; set a hotkey (in this case the HOME key) to turn the macro on / off

While 1
    $msg = GUIGetMsg()

    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
            
        Case $msg = $StartEnable
            SwitchOnOff() ; call the switch function. This turns the macro on / off depending on what $start is.

        Case $msg = $StopEnable
            SwitchOnOff()
            
        Case $msg = $Help

            MsgBox(0, "Help", "To activate the macro, simply click the Start button or press the HOME key. To stop it, click the stop button or HOME key." & _
                    "If there is no response within the MYKO client, you may need to disable HackShield. I believe there is a " & _
                    "program at FG forums that can disable HackShield.. after beta testing I will finalize the steps for this." & _
                    "But for now, in version 0.1, you are on your own.")


        Case $msg = $About
            $AboutWin = GUICreate("About", 300, 100)
            GUICtrlCreateLabel("Created by sandman85048@aim.com. This is not a finalized" & _
                    "version; I am not responsible for any bugs or problems but may be able to " & _
                    "give some limited support via email. (c) 2007 sandman.", 10, 10, 280, 80)
            
            GUISetState(@SW_SHOW, $AboutWin)
            
            While 1
                $msg = GUIGetMsg()

                Select
                    Case $msg = $GUI_EVENT_CLOSE
                        GUIDelete($AboutWin) ; Delete the about GUI
                        ExitLoop
                        
                EndSelect
                
            WEnd
            
    EndSelect
WEnd

Func SwitchOnOff()
    If $start = 0 Then ; If the macro is off ...
        AdlibEnable("Attack", 200) ; enable it. This function calls "Attack" every 200 m/s
        GUICtrlSetState($StartEnable, $GUI_DISABLE) ; disable the start btn
        GUICtrlSetState($StopEnable, $GUI_ENABLE) ; enable the stop btn
        $start = 1
        
    Else ; if the macro is on ...
        
        AdlibDisable() ; disable the autoit function that is calling the macro
        GUICtrlSetState($StartEnable, $GUI_ENABLE) ; enable the Start btn
        GUICtrlSetState($StopEnable, $GUI_DISABLE) ; Disable the stop btn
        $start = 0
    EndIf
EndFunc   ;==>SwitchOnOff

Func Attack()
    If WinActive("Knight OnLine Client") Then ; If "Knight OnLine Client" is the current active window then ...
        Send("z")
        Sleep(100)
        Send("r")
        Sleep(200)
    EndIf
EndFunc   ;==>Attack

Hope it helps, Hallman

Edited by Hallman
Link to comment
Share on other sites

Thank you a lot Helge and Hallman. Yes, this is a full screen game.

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

Need help on why the game isn't responding in any way... buttons do things (gray out or gray in) but do not affect the game. Is it because it is a fullscreen game? I was thinking that may be the problem.

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

Yes, you can run it in window mode. I'll try that right now.

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

bump.. need help on this!

EDIT: The window mode didn't work..=( it still didn't activate.

Edited by sandman

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

  • 5 weeks later...

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