masarcasticz Posted November 27, 2008 Share Posted November 27, 2008 (edited) i got this script while 1 send ("{space}");atk sleep (100) wend while 1 send("2");hp sleep (5000) wend while 1 send("1");mana sleep (5000) wend i want it to run 3 "while" together but it run only first while. what code should i use? anyone can help me please? ps.sorry for my bad english Edited November 27, 2008 by masarcasticz Link to comment Share on other sites More sharing options...
dbzfanatic Posted November 27, 2008 Share Posted November 27, 2008 You need to use functions. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
masarcasticz Posted November 27, 2008 Author Share Posted November 27, 2008 (edited) yes i have tried function but it doesn't like what i want i want it to run 3 things together but function will run it one by one i use this while 1 atk() hp() mana() wend func atk() send ("{space}");atk sleep (100) endfunc func hp() send("2");hp sleep (5000) endfunc func mana() send("1");mana sleep (5000) endfunc help me please Edited November 27, 2008 by masarcasticz Link to comment Share on other sites More sharing options...
dbzfanatic Posted November 27, 2008 Share Posted November 27, 2008 Autoit is single-threaded only. You can only run one thing at a time, the closest you can get to multi-threading is Adlibs and timers. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
masarcasticz Posted November 27, 2008 Author Share Posted November 27, 2008 ah I see.. Thank You very much dbzfanatic I will study about Adlibs and timers. Link to comment Share on other sites More sharing options...
Chapi Posted November 27, 2008 Share Posted November 27, 2008 ah I see.. Thank You very much dbzfanatic I will study about Adlibs and timers. Try something like this: $begin = TimerInit() while 1 $diff = TimerDiff($begin) if (mod($diff, 100) > 95) Then send ("{space}");atk EndIf if (mod($diff, 5000) > 4900) Then send("2");hp send("1");mana EndIf WEnd Link to comment Share on other sites More sharing options...
bo8ster Posted November 28, 2008 Share Posted November 28, 2008 I can think one other way, create a bat file that calls three autoit scripts. You will have to compile the three scripts first to get the exes. By using the start command, you create a new process in which the call runs in independent of the cmd process the bat file runs in. Example: Start script_1.exe Start script_2.exe Start script_3.exe The bat file will finish but the three exes will still be running within there own processes. Hope that helps. Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
ken82m Posted November 28, 2008 Share Posted November 28, 2008 (edited) True, you could do the same thing with a single AutoIT script. expandcollapse popupIf @Compiled = 0 Then MsgBox(0,"","This Script must compiled to properly function") Exit EndIf If $CMDLine[0] > 0 Then Opt("TrayIconHide", 1) If $CMDLine[1] = "/atk" Then atk() Exit EndIf If $CMDLine[1] = "/hp" Then hp() Exit EndIf If $CMDLine[1] = "/mana" Then mana() Exit EndIf Opt("TrayIconHide", 0) EndIf RunAllSends() Func RunAllSends() $1 = Run(@ScriptFullPath & " /atk") $2 = Run(@ScriptFullPath & " /hp") $3 = Run(@ScriptFullPath & " /mana") While ProcessExists($1) AND ProcessExists($2) AND ProcessExists($3) Sleep(10) Wend EndFunc func atk() MsgBox(0,"","Send 1") ;send ("{space}");atk sleep (100) endfunc func hp() MsgBox(0,"","Send 2") ;send("2");hp sleep (5000) endfunc func mana() MsgBox(0,"","Send 3") ;send("1");mana sleep (5000) endfunc Edited November 28, 2008 by ken82m "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains." Link to comment Share on other sites More sharing options...
bo8ster Posted November 28, 2008 Share Posted November 28, 2008 I see that working too. As long as it has it's own process, I assume Run does that. Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] 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