Jump to content
Sign in to follow this  
Scripty

I want the script to count for me :)

Recommended Posts

Scripty

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

Share this post


Link to post
Share on other sites
water

Can you please describe what this is for?

Where do you define/set $Count?

Can you post the whole script?

  • Like 1

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
caleb41610

$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 by caleb41610
  • Like 1

Share this post


Link to post
Share on other sites
Scripty

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?

Share this post


Link to post
Share on other sites
water

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
  • Like 1

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
Scripty

$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 :)

Share this post


Link to post
Share on other sites
caleb41610

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

  • Like 1

Share this post


Link to post
Share on other sites
caleb41610

its not saying any numbers only $count :)

"Finished round $Count"
:ermm:

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 by caleb41610

Share this post


Link to post
Share on other sites
Scripty

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 () ?

Share this post


Link to post
Share on other sites
caleb41610

can i put the $count b4 the

func test () ?

$count += 1 has to be inside the loop

declaring $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 by caleb41610
  • Like 1

Share this post


Link to post
Share on other sites
Scripty

Thank you guys :) did help me

but i have a question ,more...

new topic for no off topic

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×