Jump to content

Recommended Posts

Posted

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

Posted

Can you please describe what this is for?

Where do you define/set $Count?

Can you post the whole script?

My UDFs and Tutorials:

  Reveal hidden contents

 

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

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?

Posted

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

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

  On 10/26/2012 at 12:51 PM, 'caleb41610 said:

$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 :)
Posted (edited)

  On 10/26/2012 at 12:59 PM, 'Scripty said:

its not saying any numbers only $count :)

"Finished round $Count"
:ermm:

  On 10/26/2012 at 12:58 PM, 'water said:

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
Posted

  On 10/26/2012 at 12:58 PM, 'water said:

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

Posted (edited)

  On 10/26/2012 at 1:03 PM, 'Scripty said:

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...