sandman Posted January 23, 2007 Share Posted January 23, 2007 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.) expandcollapse popup; 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 More sharing options...
NutherNoob Posted January 23, 2007 Share Posted January 23, 2007 I think you have too many While...End loops. I may be wrong but from what I've seen you can have 1. Try using "Case" instead within the While....End loop. Thats about all I'm good for I'm afraid Link to comment Share on other sites More sharing options...
sandman Posted January 23, 2007 Author Share Posted January 23, 2007 Okay.. v0.2.. I have tested this and none of the buttons do anything.. Help please! expandcollapse popup; 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 More sharing options...
Helge Posted January 23, 2007 Share Posted January 23, 2007 Just for my curiosity's sake I need to ask you... why did you choose to use Call in your script ? I find it odd that it's typically scripts related to game-automation that uses Call in this way... Link to comment Share on other sites More sharing options...
sandman Posted January 23, 2007 Author Share Posted January 23, 2007 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 More sharing options...
CoderDunn Posted January 23, 2007 Share Posted January 23, 2007 (edited) 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 January 23, 2007 by Hallman Link to comment Share on other sites More sharing options...
CoderDunn Posted January 23, 2007 Share Posted January 23, 2007 (edited) I fixed it up a bit. This should work now. It now can turn on/off with a hotkey (Home) expandcollapse popup; 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 January 23, 2007 by Hallman Link to comment Share on other sites More sharing options...
Helge Posted January 23, 2007 Share Posted January 23, 2007 Use Random and Call to call a random function :$var = Random(1, 5, 1) Call("func" & $var)oÝ÷ Ø&¥§îËb¢wbç-,"¶ènÆ®¶sfgVæ3"oÝ÷ Ù+Z®Öºw-çjgv©¨§²Úâ¬xjY_¢¹è欢|!jÛ(z÷«jëh×6Call("func2") Link to comment Share on other sites More sharing options...
sandman Posted January 23, 2007 Author Share Posted January 23, 2007 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 More sharing options...
sandman Posted January 23, 2007 Author Share Posted January 23, 2007 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 More sharing options...
uber125 Posted January 23, 2007 Share Posted January 23, 2007 (edited) Can you run the game in window mode? If so do you get the same result? Edited January 23, 2007 by uber125 Link to comment Share on other sites More sharing options...
sandman Posted January 23, 2007 Author Share Posted January 23, 2007 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 More sharing options...
sandman Posted January 28, 2007 Author Share Posted January 28, 2007 (edited) bump.. need help on this! EDIT: The window mode didn't work..=( it still didn't activate. Edited January 28, 2007 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 More sharing options...
Stinkfuss Posted February 27, 2007 Share Posted February 27, 2007 "program at FG forums that can disable HackShield.." hi, im searching for a prog which can disable hackshield but i cant find one that works so if u remember the name of a program that works or have a link than post it please. 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