Bishop12 Posted December 13, 2018 Share Posted December 13, 2018 Hi Guys newbie only im doing only a test and i want to to ask how can i do like ahmm i want is when the script is running then i have 1 function down and i want him to call in while function for just only 1 time and i dont want him to run again when the while loop repeat again HotKeySet("{esc}","myExit") WinActivate("Untitled") WinMove("Untitled","",0,0) while(1) sleep(1000) Naming() WEnd Func Naming() Send("NotePad = Notepad",) EndFunc func myExit() MsgBox(0,"Exiting","Bot is quitting") Exit EndFunc Link to comment Share on other sites More sharing options...
Bishop12 Posted December 13, 2018 Author Share Posted December 13, 2018 Just now, Bishop12 said: Hi Guys newbie only im doing only a test and i want to to ask how can i do like ahmm i want is when the script is running then i have 1 function down and i want him to call in while function for just only 1 time and i dont want him to run again when the while loop repeat again HotKeySet("{esc}","myExit") WinActivate("Untitled") WinMove("Untitled","",0,0) while(1) sleep(1000) Naming() WEnd Func Naming() Send("NotePad = Notepad",) EndFunc func myExit() MsgBox(0,"Exiting","Bot is quitting") Exit EndFunc and then Func Naming() will just only call again when i re run the script ?? any one can help me ? Link to comment Share on other sites More sharing options...
Valiante Posted December 13, 2018 Share Posted December 13, 2018 You need to move your call to the Naming() function outside of the loop, before it, so that it will run once and then the script will idle in the loop until your hotkey is pressed; HotKeySet("{esc}","myExit") WinActivate("Untitled") WinMove("Untitled","",0,0) Naming() while(1) sleep(1000) WEnd Func Naming() Send("NotePad = Notepad") EndFunc func myExit() MsgBox(0,"Exiting","Bot is quitting") Exit EndFunc I also removed the comma from the Send in your example as it caused a syntax error. Link to comment Share on other sites More sharing options...
Bishop12 Posted December 13, 2018 Author Share Posted December 13, 2018 21 minutes ago, Valiante said: You need to move your call to the Naming() function outside of the loop, before it, so that it will run once and then the script will idle in the loop until your hotkey is pressed; HotKeySet("{esc}","myExit") WinActivate("Untitled") WinMove("Untitled","",0,0) Naming() while(1) sleep(1000) WEnd Func Naming() Send("NotePad = Notepad") EndFunc func myExit() MsgBox(0,"Exiting","Bot is quitting") Exit EndFunc I also removed the comma from the Send in your example as it caused a syntax error. ohh yes thankyou for that help sir Ty a lot know i know i probably work hard for this ty again .. 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