kokaaaaa Posted August 4, 2010 Share Posted August 4, 2010 Can`t find the same problem on the forum. But im sure that it is simple. what i need: After pressing a "start" button i need the program sanding something to the window after pressing a "stop" button i need it to STOP doing it BUT it doesnt doing what i want. that is my code: #include <GUIConstants.au3> GUICreate("NHF",130,70) GUISetState () $butt1=GUICtrlCreateButton("start",10,10,55,50) $butt2=GUICtrlCreateButton("stop",65,10,55,50) $label3=GuiCtrlCreateLabel("By Harusal",166,55,55,15) GuiSetState() While 1 $msg=GuiGetMsg() Select Case $msg=$butt1 call("Start") Case $msg=$butt2 Call("Stop") Case $msg=$GUI_EVENT_CLOSE Exit EndSelect Wend Func Start() WinActivate ("sd.txt - Блокнот") While 1 Send ("{1}") WEnd EndFunc Func Stop() ; what to do to stop the Start Func??? EndFunc I found another solution which i dont like. how? im creating two scripts. first will be sanding command to window, second will be starting or killing the first one it looks like that: THE 1st process (Start.exe) While 1 WinActivate ("blahblahblah") send {"{1}") Wend THE 2nd process #include <GUIConstants.au3> GUICreate("NHF",130,70) GUISetState () $butt1=GUICtrlCreateButton("start",10,10,55,50) $butt2=GUICtrlCreateButton("stop",65,10,55,50) $label3=GuiCtrlCreateLabel("By Harusal",166,55,55,15) GuiSetState() While 1 $msg=GuiGetMsg() Select Case $msg=$butt1 Run ("Start.exe") Case $msg=$butt2 ProcessClose("Start.exe") Case $msg=$GUI_EVENT_CLOSE Exit EndSelect Wend Please HELP!!!! Link to comment Share on other sites More sharing options...
Developers Jos Posted August 4, 2010 Developers Share Posted August 4, 2010 (edited) Couple of observations: 1. Do not use Call() 2. Reason script 1 doesn't work is because Start() never returns thus you are not checking for any buttons pressed anymore! 3. Which games are you trying to automate? Jos Edited August 4, 2010 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
kokaaaaa Posted August 4, 2010 Author Share Posted August 4, 2010 (edited) Couple of observations:1. Do not use Call()2. Reason script 1 doesn't work is because Start() never returns thus you are not checking for any buttons pressed anymore!3. Which games are you trying to automate?Joscan u show or say what better to use instead of Call()and how to make Start() return???i`ve automated warping and asteroid harvesting in EVE online with the second variantand now i`m trying to automate honor farming in WOW (not official server) BUT the reason why im doing it:1) a hobby after work 2) is practice with programing and English a little (im from Ukraine ) Edited August 4, 2010 by kokaaaaa Link to comment Share on other sites More sharing options...
kokaaaaa Posted August 4, 2010 Author Share Posted August 4, 2010 Couple of observations: 1. Do not use Call() 2. Reason script 1 doesn't work is because Start() never returns thus you are not checking for any buttons pressed anymore! 3. Which games are you trying to automate? Jos thanks a lot! ive got it! #include <GUIConstants.au3> GUICreate("NHF",130,70) GUISetState () $butt1=GUICtrlCreateButton("start",10,10,55,50) $butt2=GUICtrlCreateButton("stop",65,10,55,50) $label3=GuiCtrlCreateLabel("By Harusal",166,55,55,15) GuiSetState() While 1 $msg=GuiGetMsg() Select Case $msg=$butt1 call("Start") Case $msg=$GUI_EVENT_CLOSE Exit EndSelect Wend Func Start() Do $msg=GuiGetMsg() ControlSend ("blah", "", "", "{1}") Until $msg= $butt2 EndFunc Link to comment Share on other sites More sharing options...
kokaaaaa Posted August 4, 2010 Author Share Posted August 4, 2010 Couple of observations:1. Do not use Call()2. Reason script 1 doesn't work is because Start() never returns thus you are not checking for any buttons pressed anymore!3. Which games are you trying to automate?JosBut i`m still interested what i can use instead of Call()?? Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 4, 2010 Share Posted August 4, 2010 We don't do bots here. Read the announcement. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
kokaaaaa Posted August 5, 2010 Author Share Posted August 5, 2010 We don't do bots here. Read the announcement.i`m not asking you to help me make a bot. i made it already.i`m asking you to help me solve the problem. i ask u to teach me, to give me an advice. as i sad i need it not for making bot, i need it cause is interesting for me Link to comment Share on other sites More sharing options...
Developers Jos Posted August 5, 2010 Developers Share Posted August 5, 2010 i`m not asking you to help me make a bot. i made it already.i`m asking you to help me solve the problem. i ask u to teach me, to give me an advice. as i sad i need it not for making bot, i need it cause is interesting for me as stated...*click* SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts