Sparrowlord Posted December 19, 2006 Share Posted December 19, 2006 Hello, I am having a tid bit of trouble counting loops, heres a example of what I mean. Func mouse() While 1 msg() cc() WEnd EndFunc Func msg() $msg = 'hello this is my message' Send($msg) sleep(10000) Send ($msg) sleep(10000) Send($msg) sleep(10000) Send ($msg) sleep(10000) EndFunc Func cc() Mouseclick ("left") EndFunc Now I can count the number in the msg func but when func mouse reloops it starts all over again. Any help? Link to comment Share on other sites More sharing options...
mikehunt114 Posted December 19, 2006 Share Posted December 19, 2006 Func mouse() $count = 0 While 1 msg() cc() $count += 1 WEnd EndFunc Func msg() $msg = 'hello this is my message' Send($msg) sleep(10000) Send ($msg) sleep(10000) Send($msg) sleep(10000) Send ($msg) sleep(10000) EndFunc Func cc() Mouseclick ("left") EndFunc IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
Sparrowlord Posted December 19, 2006 Author Share Posted December 19, 2006 Yeah but Id like to count the total amount of messages sent just not the func, theres 4 messages in the func Link to comment Share on other sites More sharing options...
mikehunt114 Posted December 19, 2006 Share Posted December 19, 2006 (edited) Yeah but Id like to count the total amount of messages sent just not the func, theres 4 messages in the func $count += 4oÝ÷ Ù±ßÛ:¸Ê°j{m¡Ê.ÖµêÞiÈf²®¶sdgVæ2×6r b33c¶×6rÒb33¶VÆÆòF22×ÖW76vRb33° 6VæBb33c¶×6r b33c¶6÷VçB³Ò 6ÆVW 6VæBb33c¶×6r b33c¶6÷VçB³Ò 6ÆVW 6VæBb33c¶×6r b33c¶6÷VçB³Ò 6ÆVW 6VæBb33c¶×6r b33c¶6÷VçB³Ò 6ÆVW¤VæDgVæ Edited December 19, 2006 by mikehunt114 IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
Sparrowlord Posted December 19, 2006 Author Share Posted December 19, 2006 Still getting a error. Heres what I got. Func mouse() JFC() While 1 Msg() CC() WEnd EndFunc $count = 0 Func Msg() $msg = 'Heres my message.{ENTER}' $1 = 0 While $1 <= 4 Send($msg) $count += 1 TrayTip("Messages Sent", $count, 5, 1) sleep(10000) Send ($msg) $count += 1 TrayTip("Messages Sent", $count, 5, 1) sleep(10000) Send($msg) $count += 1 TrayTip("Messages Sent", $count, 5, 1) sleep(10000) Send ($msg) $count += 1 TrayTip("Messages Sent", $count, 5, 1) sleep(10000) WEnd EndFunc Link to comment Share on other sites More sharing options...
mikehunt114 Posted December 19, 2006 Share Posted December 19, 2006 You should post the error you get along with your code, otherwise it's more or less a guessing game for those who are trying to help. My guess is that you are getting an undefined variable error, because you are initializing $count after it's being called in your While loop. If you set $count = 0 before your While loop, it should work. IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
ChrisL Posted December 19, 2006 Share Posted December 19, 2006 Global $Count = 0 While 1 Msg() Msgbox (0,"","Count is now " & $count) WEnd Func Msg() $msg = 'Heres my message.{ENTER}' $1 = 0 While $1 <= 4 ;Send($msg) $count += 1 TrayTip("Messages Sent", $count, 5, 1) ;sleep(10000) ;Send ($msg) $count += 1 TrayTip("Messages Sent", $count, 5, 1) ;sleep(10000) ;Send($msg) $count += 1 TrayTip("Messages Sent", $count, 5, 1) ;sleep(10000) ;Heres my message. ;Send ($msg) $count += 1 TrayTip("Messages Sent", $count, 5, 1) ;sleep(10000) $1 +=1 WEnd EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire 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