Scripty Posted October 26, 2012 Share Posted October 26, 2012 So i want the script to count for me evry time it says $count(or something like that) then it +the last number with one possible? Func test () while 1 ControlSend("[CLASS:Notepad]", "", "Edit1", "Finished round $Count") ControlSend("[CLASS:Notepad]", "", "Edit1", "{ENTER}") WEnd endfunc Link to comment Share on other sites More sharing options...
water Posted October 26, 2012 Share Posted October 26, 2012 Can you please describe what this is for? Where do you define/set $Count? Can you post the whole script? Scripty 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
caleb41610 Posted October 26, 2012 Share Posted October 26, 2012 (edited) $count += 1 $count = $count + 1 either way will add 1 to whatever $count was Func test () $count = 0 while 1 $count += 1 ControlSend("[CLASS:Notepad]", "", "Edit1", "Finished round $Count") ControlSend("[CLASS:Notepad]", "", "Edit1", "{ENTER}") WEnd endfunc will indefinitely send 1, 2, 3... etc but depending on whatever it is you are trying to do.. I'm 99% sure there's a better way. Describe your goal if you can. Edited October 26, 2012 by caleb41610 Scripty 1 Multi-Connection TCP Server Link to comment Share on other sites More sharing options...
Scripty Posted October 26, 2012 Author Share Posted October 26, 2012 the script is not made yet it's a script for skype, I will hang up the phone and messege the caller "i have not time" just want it to count how many times Possible? Link to comment Share on other sites More sharing options...
water Posted October 26, 2012 Share Posted October 26, 2012 I would do it the other way round. First write your script and then see how you could do the counting. The function you have shown only fills Notepad with numbers very fast. Use something like this: Func test () $count = 0 while 1 $count += 1 ControlSend("[CLASS:Notepad]", "", "Edit1", "Finished round " & $Count & @CRLF) Sleep(1000) WEnd endfunc Scripty 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Scripty Posted October 26, 2012 Author Share Posted October 26, 2012 $count += 1 $count = $count + 1 either way will add 1 to whatever $count was Func test () $count = 0 while 1 $count += 1 ControlSend("[CLASS:Notepad]", "", "Edit1", "Finished round $Count") ControlSend("[CLASS:Notepad]", "", "Edit1", "{ENTER}") WEnd endfunc will indefinitely send 1, 2, 3... etc but depending on whatever it is you are trying to do.. I'm 99% sure there's a better way. Describe your goal if you can. its not saying any numbers only $count Link to comment Share on other sites More sharing options...
caleb41610 Posted October 26, 2012 Share Posted October 26, 2012 There's a Skype UDF that might help you, but honestly I still have no idea what you are trying to do with the counting part. You can count with += Using TimerInit() and TimerDiff() may help you more. or you could check the actual time with @Hour, @Min, @Sec Scripty 1 Multi-Connection TCP Server Link to comment Share on other sites More sharing options...
caleb41610 Posted October 26, 2012 Share Posted October 26, 2012 (edited) its not saying any numbers only $count "Finished round $Count" I would do it the other way round. First write your script and then see how you could do the counting. The function you have shown only fills Notepad with numbers very fast. Use something like this: Func test () $count = 0 while 1 $count += 1 ControlSend("[CLASS:Notepad]", "", "Edit1", "Finished round " & $Count & @CRLF) Sleep(1000) WEnd endfunc Hate to go off topic, but I can never get the indentation to work when I paste code. Any idea why? Edited October 26, 2012 by caleb41610 Multi-Connection TCP Server Link to comment Share on other sites More sharing options...
Scripty Posted October 26, 2012 Author Share Posted October 26, 2012 I would do it the other way round. First write your script and then see how you could do the counting. The function you have shown only fills Notepad with numbers very fast. Use something like this: Func test () $count = 0 while 1 $count += 1 ControlSend("[CLASS:Notepad]", "", "Edit1", "Finished round " & $Count & @CRLF) Sleep(1000) WEnd endfunc can i put the $count b4 the func test () ? Link to comment Share on other sites More sharing options...
caleb41610 Posted October 26, 2012 Share Posted October 26, 2012 (edited) can i put the $count b4 thefunc test () ?$count += 1 has to be inside the loopdeclaring $count = 0 could be anywhere you want, as long as it's declared before the loop starts. At the beginning of the function works.. I always add declares to the top of my script after #include stuff.If you have no use for $count outside the function, it's better to declare it inside the function as a Local variable. Otherwise declare it at the top of the script as Global Edited October 26, 2012 by caleb41610 Scripty 1 Multi-Connection TCP Server Link to comment Share on other sites More sharing options...
Scripty Posted October 26, 2012 Author Share Posted October 26, 2012 Thank you guys did help me but i have a question ,more... new topic for no off 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