Baronello Posted June 4, 2012 Share Posted June 4, 2012 Im trying to make my first script and failing with any syntaxis i tryed. Help with code please. $num = 0 Do sleep(500) Send($num) $num+=1 StringLen($num) = a sleep(500) Send("{Enter}") sleep(500) if a = 1 then Send("{Backspace}") if a = 2 then Send("{Backspace}") Send("{Backspace}") if a = 3 then Send("{Backspace}") Send("{Backspace}") Send("{Backspace}") if a = 4 then Send("{Backspace}") Send("{Backspace}") Send("{Backspace}") Send("{Backspace}") if a = 5 then Send("{Backspace}") Send("{Backspace}") Send("{Backspace}") Send("{Backspace}") Send("{Backspace}") Until $num = 11111 $num = 0 Do sleep(500) Send($num) $num+=1 sleep(500) Send("{Enter}") sleep(500) if $num = StringLen(1) then Send("{Backspace}") if $num = StringLen(2) then Send("{Backspace}") Send("{Backspace}") if $num = StringLen(3) then Send("{Backspace}") Send("{Backspace}") Send("{Backspace}") if $num = StringLen(4) then Send("{Backspace}") Send("{Backspace}") Send("{Backspace}") Send("{Backspace}") if $num = StringLen(5) then Send("{Backspace}") Send("{Backspace}") Send("{Backspace}") Send("{Backspace}") Send("{Backspace}") Until $num = 11111 Link to comment Share on other sites More sharing options...
JohnOne Posted June 4, 2012 Share Posted June 4, 2012 if $num = StringLen(1) then Send("{Backspace}") Endif All "If..Then" must have an "Endif" in your case. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Baronello Posted June 4, 2012 Author Share Posted June 4, 2012 Ye my friend allready told me this, thx. <3 Im dumb in coding. ._. So which syntaxis for StringLen right then? Link to comment Share on other sites More sharing options...
stormbreaker Posted June 4, 2012 Share Posted June 4, 2012 StringLen is used to get the length of a string. Example: - stringlen('mkish') returns 5 if you want to get length of a no. Then use it like stringlen('' & $number) I suggest using switch-case rather than if endif. ---------------------------------------- :bye: Hey there, was I helpful? ---------------------------------------- My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1 Link to comment Share on other sites More sharing options...
Baronello Posted June 4, 2012 Author Share Posted June 4, 2012 Thx, get it working. <3 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