-TS- Posted December 7, 2003 Share Posted December 7, 2003 im trying to make a random set 5 to 15letters/numbers $A = Random( 5 , 15 ) $a2 = 1 do $a2 = $a2 + 1 $Abc123 = Random( 1 , 36 ) if $Abc123 = 1 then Endif send("a") if $Abc123 = 2 then Endif send("b") if $Abc123 = 3 then Endif ... if $Abc123 = 36 then Endif send("0") until $a2 = $A but it alweys comes up with abcde..... THX *TS* Link to comment Share on other sites More sharing options...
-TS- Posted December 7, 2003 Author Share Posted December 7, 2003 o my nvm that i saw the problem.... LMAO Link to comment Share on other sites More sharing options...
CyberSlug Posted December 7, 2003 Share Posted December 7, 2003 (edited) So what was the problem?Anyway, you could greatly simply your code with the CHR command....$Abc123 = Random( 1 , 36 ) If $Abc123 > 26 Then;numbers 0-9 Send( Chr(27 + $Abc123) ) Else;letters a-z Send( Chr(96 + $Abc123) ) EndIfHere's a chart for your reference:Chr(48) == "0" ... Chr(57) == "9"...Chr(65)== "A" ... Chr(90) == "Z"...Chr(97) = "a" ... Chr(122) == "z"Maybe you will find this usefulEDIT: Also, the select case command could come in handy. Edited December 7, 2003 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
-TS- Posted December 7, 2003 Author Share Posted December 7, 2003 na i found out what i was doing wrong the endif statement is befor the if command Link to comment Share on other sites More sharing options...
CyberSlug Posted December 7, 2003 Share Posted December 7, 2003 Thanks for replying--I overlooked that! Still, take a look at my suggested code..... Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
-TS- Posted December 7, 2003 Author Share Posted December 7, 2003 thx, that looks like it would save 200+ lines of codes Link to comment Share on other sites More sharing options...
CyberSlug Posted December 7, 2003 Share Posted December 7, 2003 I just realized a slightly more straight-forward way:$alphabet = "abcdefghijklmnopqrstuvwxyz1234567890" $Abc123 = "" For $i = 1 to Random(5,15) $Abc123 = $Abc123 & StringMid($alphabet, Random(1,36), 1) Next Send($Abc123) Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
-TS- Posted December 7, 2003 Author Share Posted December 7, 2003 o wow, i guess i should read and play with all the commands... THX 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