403forbidden Posted May 9, 2009 Share Posted May 9, 2009 Is there any function that could modify a string in a way that makes the letter of a string go up or down one, like the basis of all encryption? For instance, "dog" as the string, and "eph" as the return? I can make it myself, but i wanted to check just in case it already existed. Link to comment Share on other sites More sharing options...
JackDinn Posted May 10, 2009 Share Posted May 10, 2009 have you seen _StringEncrypt () but dont think there is a single command to do that. Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D Link to comment Share on other sites More sharing options...
monoceres Posted May 10, 2009 Share Posted May 10, 2009 Why in the world would such a trivial function be included in the autoit product? It's no more than 5 lines of code. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
JackDinn Posted May 10, 2009 Share Posted May 10, 2009 (edited) your right but on the other hand why include _stringExplode() as its nothing extra than StringSplit() other than maybe 1 or 2 lines of code if you wanted to use the $Limit var Edited May 10, 2009 by JackDinn Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D Link to comment Share on other sites More sharing options...
Yashied Posted May 10, 2009 Share Posted May 10, 2009 (edited) You can do it. global $Text = '403forbidden' $Text = _StringInverse($Text) ConsoleWrite($Text & @CR) $Text = _StringInverse($Text) ConsoleWrite($Text & @CR) func _StringInverse($sString) local $Ret = '' while $sString > '' $c = Asc(StringLeft($sString, 1)) switch $c case 32 to 127 $Ret &= Chr(32 + 127 - $c) case else $Ret &= Chr($c) endswitch $sString = StringTrimLeft($sString, 1) wend return $Ret endfunc; _StringInverse Edited May 10, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
403forbidden Posted May 11, 2009 Author Share Posted May 11, 2009 Thanks for the help, I will have a look. Link to comment Share on other sites More sharing options...
JackDinn Posted May 11, 2009 Share Posted May 11, 2009 while $sString > ''was just wondering about that? can a string be used in a numeric expression like this "a"<"b" ? testing it it does look like it can but does that mean that it assigns the ASCII val to the strings automatically or is it just a null string ""= 0 (FALSE) and anything other than a null "Z"=1 (TRUE)? tried looking at Number("a") but it returns 0 so im a little confused how using while $sString > "" would work Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D Link to comment Share on other sites More sharing options...
Yashied Posted May 11, 2009 Share Posted May 11, 2009 was just wondering about that? can a string be used in a numeric expression like this "a"<"b" ? testing it it does look like it can but does that mean that it assigns the ASCII val to the strings automatically or is it just a null string ""= 0 (FALSE) and anything other than a null "Z"=1 (TRUE)? tried looking at Number("a") but it returns 0 so im a little confused how using while $sString > "" would workwhile StringLen($sString) > 0 My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
martin Posted May 11, 2009 Share Posted May 11, 2009 was just wondering about that? can a string be used in a numeric expression like this "a"<"b" ? testing it it does look like it can but does that mean that it assigns the ASCII val to the strings automatically or is it just a null string ""= 0 (FALSE) and anything other than a null "Z"=1 (TRUE)? tried looking at Number("a") but it returns 0 so im a little confused how using while $sString > "" would workWhen comparing strings as in if $a > $b, AutoIt seems to compare alphabetically but case independantly. When comparing a string to a number then AutoIt will take any leading digits as the number for the string.Effectively If $a > '' is the same as If $a <> '' Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Qousio Posted May 11, 2009 Share Posted May 11, 2009 Shameless self promotion: http://www.autoitscript.com/forum/index.ph...mp;#entry681294 Link to comment Share on other sites More sharing options...
JackDinn Posted May 11, 2009 Share Posted May 11, 2009 string comp to int "a"="0" False string comp to string "a"= 0 True aye interesting, so when a string is compared to a string "1"<"2"<"3"<"a"<"b"<"c" ... etc, but if an int is involved then the string is only valued as the first number in the string, but then why does "1a" <> 1 ? it's all pretty academic really as you wouldn't really compare strings in this way, but interesting how AI treats them. dont mine my musing I'll have to go and have a tinker and try some things out just for my peace of mind on this one, cheers for the pointer Martin that was very helpful. Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D Link to comment Share on other sites More sharing options...
403forbidden Posted May 11, 2009 Author Share Posted May 11, 2009 (edited) Ok, I have what I wa't, Yashied, I was thinking something more like this. expandcollapse popupMsgBox(0, "Info", _String_Inverse("403forbidden", 1, "Down")) MsgBox(0, "Info", _String_Inverse("403forbidden", 1, "Up")) MsgBox(0, "Info", _String_Inverse("403forbidden", 8, "Up")) MsgBox(0, "Info", _String_Inverse("403forbidden", 8, "Down")) Func _String_Inverse($String, $Inverse_Count, $Direction = "Up") Local $Count = 1 Local $Return For $Count = 1 To StringLen($String) If StringIsAlNum(StringRight(StringLeft($String, $Count), 1)) = 0 Then Return -1 Next $Count = 1 If $Direction = "Up" Then For $Count = 1 To StringLen($String) If StringIsLower(StringRight(StringLeft($String, $Count), 1)) = 1 Then If Asc(StringRight(StringLeft($String, $Count), 1)) + $Inverse_Count > 122 Then $Return = $Return & Chr(Asc(StringRight(StringLeft($String, $Count), 1)) + $Inverse_Count - 26) EndIf If Asc(StringRight(StringLeft($String, $Count), 1)) + $Inverse_Count < 122 Then $Return = $Return & Chr(Asc(StringRight(StringLeft($String, $Count), 1)) + $Inverse_Count) EndIf EndIf If StringIsUpper(StringRight(StringLeft($String, $Count), 1)) = 1 Then If Asc(StringRight(StringLeft($String, $Count), 1)) + $Inverse_Count > 90 Then $Return = $Return & Chr(Asc(StringRight(StringLeft($String, $Count), 1)) + $Inverse_Count - 26) EndIf If Asc(StringRight(StringLeft($String, $Count), 1)) + $Inverse_Count < 90 Then $Return = $Return & Chr(Asc(StringRight(StringLeft($String, $Count), 1)) + $Inverse_Count) EndIf EndIf If StringIsDigit(StringRight(StringLeft($String, $Count), 1)) = 1 Then If Asc(StringRight(StringLeft($String, $Count), 1)) + $Inverse_Count > 57 Then $Return = $Return & Chr(Asc(StringRight(StringLeft($String, $Count), 1)) + $Inverse_Count - 10) EndIf If Asc(StringRight(StringLeft($String, $Count), 1)) + $Inverse_Count < 57 Then $Return = $Return & Chr(Asc(StringRight(StringLeft($String, $Count), 1)) + $Inverse_Count) EndIf EndIf Next EndIf If $Direction = "Down" Then For $Count = 1 To StringLen($String) If StringIsLower(StringRight(StringLeft($String, $Count), 1)) = 1 Then If Asc(StringRight(StringLeft($String, $Count), 1)) - $Inverse_Count > 97 Then $Return = $Return & Chr(Asc(StringRight(StringLeft($String, $Count), 1)) - $Inverse_Count) EndIf If Asc(StringRight(StringLeft($String, $Count), 1)) - $Inverse_Count < 97 Then $Return = $Return & Chr(Asc(StringRight(StringLeft($String, $Count), 1)) - $Inverse_Count + 26) EndIf EndIf If StringIsUpper(StringRight(StringLeft($String, $Count), 1)) = 1 Then If Asc(StringRight(StringLeft($String, $Count), 1)) - $Inverse_Count > 65 Then $Return = $Return & Chr(Asc(StringRight(StringLeft($String, $Count), 1)) - $Inverse_Count) EndIf If Asc(StringRight(StringLeft($String, $Count), 1)) - $Inverse_Count < 65 Then $Return = $Return & Chr(Asc(StringRight(StringLeft($String, $Count), 1)) - $Inverse_Count + 26) EndIf EndIf If StringIsDigit(StringRight(StringLeft($String, $Count), 1)) = 1 Then If Asc(StringRight(StringLeft($String, $Count), 1)) - $Inverse_Count > 48 Then $Return = $Return & Chr(Asc(StringRight(StringLeft($String, $Count), 1)) - $Inverse_Count) EndIf If Asc(StringRight(StringLeft($String, $Count), 1)) - $Inverse_Count < 48 Then $Return = $Return & Chr(Asc(StringRight(StringLeft($String, $Count), 1)) - $Inverse_Count + 10) EndIf EndIf Next EndIf Return $Return EndFunc ;==>_String_Inverse Edited May 11, 2009 by 403forbidden 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