blizzedout Posted February 23, 2006 Share Posted February 23, 2006 Ok i have a script that relogs in as differnet accounts, but when i get over 9 u have a problem because of two digits. Send("chad00" & $AccountNumber & "@gmail.com") how would i make it so if $AccountNumber > 9 then add a 0 in front of the number. or just have the numbers go like this 001,002,003,004,005,006,007,008,009,010,011.... Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted February 23, 2006 Moderators Share Posted February 23, 2006 (edited) Something like this? If $AccountNumber > 9 Then $AccountNumber = 0 & $AccountNumber Or for the second one like this: If $AccountNumber <= 9 Then $AccountNumber = 0 & 0 & $AccountNumber If $AccountNumber > 9 Then $AccountNumber = 0 & $AccountNumber Edited February 23, 2006 by big_daddy Link to comment Share on other sites More sharing options...
blizzedout Posted February 23, 2006 Author Share Posted February 23, 2006 Something like this? If $AccountNumber > 9 Then $AccountNumber = 0 & $AccountNumber Or for the second one like this: If $AccountNumber <= 9 Then $AccountNumber = 0 & 0 & $AccountNumber If $AccountNumber > 9 Then $AccountNumber = 0 & $AccountNumber So it will produce this? $AccountNumber = 50 If $AccountNumber > 9 Then $AccountNumber = 0 & $AccountNumber Account #: 050 and $AccountNumber = 4 $AccountNumber <= 9 Then $AccountNumber = 0 & 0 & $AccountNumber Account #: 004 ? Link to comment Share on other sites More sharing options...
blizzedout Posted February 23, 2006 Author Share Posted February 23, 2006 (edited) yea but what ill happen when i do $AccountNumber = $AccountNumber + 1 Do the zeros interfear? or can i just remove them, like strip all the zeros before adding them. Edited February 23, 2006 by blizzedout Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted February 23, 2006 Moderators Share Posted February 23, 2006 So it will produce this? $AccountNumber = 50 If $AccountNumber > 9 Then $AccountNumber = 0 & $AccountNumber Account #: 050 and $AccountNumber = 4 $AccountNumber <= 9 Then $AccountNumber = 0 & 0 & $AccountNumber Account #: 004 ? Yes it will...if you expect to go over 100 account you will have to allow for that: $AccountNumber = 100 If $AccountNumber <= 9 Then $AccountNumber = 0 & 0 & $AccountNumber If $AccountNumber > 9 And $AccountNumber < 100 Then $AccountNumber = 0 & $AccountNumber Link to comment Share on other sites More sharing options...
blizzedout Posted February 23, 2006 Author Share Posted February 23, 2006 Yes it will...if you expect to go over 100 account you will have to allow for that: $AccountNumber = 100 If $AccountNumber <= 9 Then $AccountNumber = 0 & 0 & $AccountNumber If $AccountNumber > 9 And $AccountNumber < 100 Then $AccountNumber = 0 & $AccountNumberNa i dont need it to go over 100 but thanks just wana know if the zeros will interfear when doing: $AccountNumber = $AccountNumber + 1 Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted February 23, 2006 Moderators Share Posted February 23, 2006 Na i dont need it to go over 100 but thanks just wana know if the zeros will interfear when doing: $AccountNumber = $AccountNumber + 1 Well...try this, it seems to work fine for me: $AccountNumber = 20 If $AccountNumber <= 9 Then $AccountNumber = 0 & 0 & $AccountNumber If $AccountNumber > 9 And $AccountNumber < 100 Then $AccountNumber = 0 & $AccountNumber InputBox("", "", $AccountNumber) $AccountNumber = $AccountNumber + 1 If $AccountNumber <= 9 Then $AccountNumber = 0 & 0 & $AccountNumber If $AccountNumber > 9 And $AccountNumber < 100 Then $AccountNumber = 0 & $AccountNumber InputBox("", "", $AccountNumber) Link to comment Share on other sites More sharing options...
blizzedout Posted February 23, 2006 Author Share Posted February 23, 2006 Works good thank man, tested it by doin this. $AccountNumber = 0 While 1 $AccountNumber = $AccountNumber + 1 If $AccountNumber <= 9 Then $AccountNumber = 0 & 0 & $AccountNumber If $AccountNumber > 9 Then $AccountNumber = 0 & $AccountNumber MsgBox(4096, "Test", "Account #: " & $AccountNumber, 10) Wend Turns out when you add 1 to 001 it will produce 2 not 002 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