Kaso Posted October 15, 2005 Share Posted October 15, 2005 I have made a script to create a password depending on the ID you enter into the inputbox. The script reallly doesn't matter because before I installed SciTe4Au3Upd.exe & autoit-v3-setup.exe it complied and "go" with out errors. Anyways having installed the 2 new d/l's even from a fresh install (meaning uninstalling autoit and scite and deleting then folder C:\Program Files\AutoIt3 I get the following message when hitting F5 to test the script. C:\Program Files\AutoIt3\Include\String.au3(16,59) : ERROR: $strHex already declared as parameter Local $strChar, $aryHex, $i, $iDec, $Char, $file, $strHex, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Program Files\AutoIt3\Include\String.au3(60,112) : ERROR: $i_EncryptLevel already declared as parameter If Number($i_EncryptLevel) <= 0 Or Int($i_EncryptLevel) <> $i_EncryptLevel Then Local $i_EncryptLevel = 1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~^ D:\test.au3 - 2 error(s), 0 warning(s) I am using _stringreverse in my script which requires #include <script.au3> in order to work. Its weird cuz if I choose continue anyways it runs without any problems. I have only had this problem since using the newest d/l's. I have also tried it on 2 different PC's same results... Any ideas? Bug? Link to comment Share on other sites More sharing options...
A.B.Ames Posted October 15, 2005 Share Posted October 15, 2005 Hi, Probably best to post a copy of your script, you may have the include listed twice or have a variable with same name as one in the include script? But is is telling you that 2 varibles from the #include have been already declared. Iv'e done this a few times myself ant too was able to continue anyways but i but did locate my error of declaring the samve varible twice. The reason that it may only happen since new d/l's could be due to new varible names used in the include scripts. A.B.Ames Link to comment Share on other sites More sharing options...
Kaso Posted October 16, 2005 Author Share Posted October 16, 2005 (edited) expandcollapse popup#include <String.au3> opt("WinWaitDelay", 100) opt("WinTitleMatchMode", 4) opt("WinDetectHiddenText", 1) opt("MouseCoordMode", 0) opt("TrayIconHide", 1) $id1 = InputBox("What the windows login ID?", " ", "", " M", 250, 125) If @error = 1 Then Exit Func StringStrip($String, $Chars, $Count = 0, $CaseSensitive = 0) ;Error Checking If ($String == "") Then Return $String If ($Chars == "") Then Return $String If NOT (IsInt($CaseSensitive)) Then $CaseSensitive = Number($CaseSensitive);Returns 0 or the number If ($CaseSensitive > 1) Then $CaseSensitive = 1 If NOT (IsInt($Count)) Then $Count = Number($Count);Returns 0 or the number ;Let's make this into an array for looping $Chars = StringSplit($Chars, "") For $loop = 1 To $Chars[0] $String = StringReplace($String, $Chars[$loop], "", $Count, $CaseSensitive) Next Return $String EndFunc ;==>StringStrip $id = StringLower($id1) $idstrip = StringStrip($id, "abcdefghijklmnopqrstuvwxyz") $array = StringSplit($idstrip, "") While $array[0] > 6 $id1 = InputBox("What the windows login ID?", "No more than 6 numbers in the ID!", "", " M", 250, 125) If @error = 1 Then Exit $id = StringLower($id1) $idstrip = StringStrip($id, "abcdefghijklmnopqrstuvwxyz") $array = StringSplit($idstrip, "") WEnd If $array[0] = 6 Then $arrayadd = $array[1] + $array[2] + $array[3] + $array[4] + $array[5] + $array[6] ElseIf $array[0] = 5 Then $arrayadd = $array[1] + $array[2] + $array[3] + $array[4] + $array[5] ElseIf $array[0] = 4 Then $arrayadd = $array[1] + $array[2] + $array[3] + $array[4] ElseIf $array[0] = 3 Then $arrayadd = $array[1] + $array[2] + $array[3] ElseIf $array[0] = 2 Then $arrayadd = $array[1] + $array[2] ElseIf $array[0] = 1 Then $arrayadd = $array[1] EndIf $arrayid = StringSplit($id, "") $idprecap = $arrayid[1] $idcap = StringUpper($idprecap) $arrayrev = _StringReverse($arrayadd) $adminpass = $idcap & $arrayrev ClipPut($adminpass) MsgBox(64, "Admin Password Is ...", $adminpass)Wow what a fast reply. Thanks for the support. Theres the code. for the script. heres the code for Sring.au3 which is from the autoit install. expandcollapse popup#include-once ;=============================================================================== ; ; Function Name: _HexToStr("hex") ; Description: Convert a hex string of characters to ASCII Characters. ; Parameter(s): $strHex is the hex string you want to convert. ; Requirement(s): Hex Input. ; Return Value(s): On Success - Returns the converted string of characters. ; On Failure - -1 and sets @ERROR = 1 ; Author(s): Jarvis Stubblefield ; ;=============================================================================== Func _HexToString($strHex) Local $strChar, $aryHex, $i, $iDec, $Char, $file, $strHex, $iOne, $iTwo $aryHex = StringSplit($strHex, "") For $i = 1 To $aryHex[0] $iOne = $aryHex[$i] $i = $i + 1 $iTwo = $aryHex[$i] $iDec = Dec($iOne & $iTwo) $Char = Chr($iDec) $strChar = $strChar & $Char Next If $strChar = "" Then SetError(1) Return -1 Else Return $strChar EndIf EndFunc ;=============================================================================== ; ; Function Name: _StringEncryption() ; Description: RC4 Based string encryption ; Parameter(s): $i_Encrypt - 1 to encrypt, 0 to decrypt ; $s_EncryptText - string to encrypt ; $s_EncryptPassword - string to use as an encryption password ; $i_EncryptLevel - integer to use as number of times to encrypt string ; Requirement(s): None ; Return Value(s): On Success - Returns the string encrypted (blank) times with (blank) password ; On Failure - Returns a blank string and sets @error = 1 ; Author(s): Wes Wolfe-Wolvereness ; ;=============================================================================== ; Func _StringEncrypt($i_Encrypt, $s_EncryptText, $s_EncryptPassword, $i_EncryptLevel = 1) If $i_Encrypt <> 0 And $i_Encrypt <> 1 Then Return '' SetError(1) ElseIf $s_EncryptText = '' Or $s_EncryptPassword = '' Then Return '' SetError(1) Else If Number($i_EncryptLevel) <= 0 Or Int($i_EncryptLevel) <> $i_EncryptLevel Then Local $i_EncryptLevel = 1 Local $v_EncryptModified Local $i_EncryptCountH Local $i_EncryptCountG Local $v_EncryptSwap Local $av_EncryptBox[256][2] Local $i_EncryptCountA Local $i_EncryptCountB Local $i_EncryptCountC Local $i_EncryptCountD Local $i_EncryptCountE Local $i_EncryptCountF Local $v_EncryptCipher Local $v_EncryptCipherBy If $i_Encrypt = 1 Then Local $i_EncryptCountC = 0 For $i_EncryptCountF = 0 To $i_EncryptLevel Step 1 $i_EncryptCountG = '' $i_EncryptCountH = '' $v_EncryptModified = '' For $i_EncryptCountG = 1 To StringLen($s_EncryptText) If $i_EncryptCountH = StringLen($s_EncryptPassword) Then $i_EncryptCountH = 1 Else $i_EncryptCountH = $i_EncryptCountH + 1 EndIf $v_EncryptModified = $v_EncryptModified & Chr(BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountG, 1)), Asc(StringMid($s_EncryptPassword, $i_EncryptCountH, 1)), 255)) Next $s_EncryptText = $v_EncryptModified $i_EncryptCountA = '' $i_EncryptCountB = 0 $i_EncryptCountC = '' $i_EncryptCountD = '' $i_EncryptCountE = '' $v_EncryptCipherBy = '' $v_EncryptCipher = '' $v_EncryptSwap = '' $av_EncryptBox = '' Local $av_EncryptBox[256][2] For $i_EncryptCountA = 0 To 255 $av_EncryptBox[$i_EncryptCountA][1] = Asc(StringMid($s_EncryptPassword, Mod($i_EncryptCountA, StringLen($s_EncryptPassword)) + 1, 1)) $av_EncryptBox[$i_EncryptCountA][0] = $i_EncryptCountA Next For $i_EncryptCountA = 0 To 255 $i_EncryptCountB = Mod( ($i_EncryptCountB + $av_EncryptBox[$i_EncryptCountA][0] + $av_EncryptBox[$i_EncryptCountA][1]), 256) $v_EncryptSwap = $av_EncryptBox[$i_EncryptCountA][0] $av_EncryptBox[$i_EncryptCountA][0] = $av_EncryptBox[$i_EncryptCountB][0] $av_EncryptBox[$i_EncryptCountB][0] = $v_EncryptSwap Next For $i_EncryptCountA = 1 To StringLen($s_EncryptText) $i_EncryptCountC = Mod( ($i_EncryptCountC + 1), 256) $i_EncryptCountD = Mod( ($i_EncryptCountD + $av_EncryptBox[$i_EncryptCountC][0]), 256) $i_EncryptCountE = $av_EncryptBox[Mod( ($av_EncryptBox[$i_EncryptCountC][0] + $av_EncryptBox[$i_EncryptCountD][0]), 256) ][0] $v_EncryptCipherBy = BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountA, 1)), $i_EncryptCountE) $v_EncryptCipher = $v_EncryptCipher & Hex($v_EncryptCipherBy, 2) Next $s_EncryptText = $v_EncryptCipher Next Else For $i_EncryptCountF = 0 To $i_EncryptLevel Step 1 $i_EncryptCountB = 0 $i_EncryptCountC = '' $i_EncryptCountD = '' $i_EncryptCountE = '' $v_EncryptCipherBy = '' $v_EncryptCipher = '' $v_EncryptSwap = '' $av_EncryptBox = '' Local $av_EncryptBox[256][2] For $i_EncryptCountA = 0 To 255 $av_EncryptBox[$i_EncryptCountA][1] = Asc(StringMid($s_EncryptPassword, Mod($i_EncryptCountA, StringLen($s_EncryptPassword)) + 1, 1)) $av_EncryptBox[$i_EncryptCountA][0] = $i_EncryptCountA Next For $i_EncryptCountA = 0 To 255 $i_EncryptCountB = Mod( ($i_EncryptCountB + $av_EncryptBox[$i_EncryptCountA][0] + $av_EncryptBox[$i_EncryptCountA][1]), 256) $v_EncryptSwap = $av_EncryptBox[$i_EncryptCountA][0] $av_EncryptBox[$i_EncryptCountA][0] = $av_EncryptBox[$i_EncryptCountB][0] $av_EncryptBox[$i_EncryptCountB][0] = $v_EncryptSwap Next For $i_EncryptCountA = 1 To StringLen($s_EncryptText) Step 2 $i_EncryptCountC = Mod( ($i_EncryptCountC + 1), 256) $i_EncryptCountD = Mod( ($i_EncryptCountD + $av_EncryptBox[$i_EncryptCountC][0]), 256) $i_EncryptCountE = $av_EncryptBox[Mod( ($av_EncryptBox[$i_EncryptCountC][0] + $av_EncryptBox[$i_EncryptCountD][0]), 256) ][0] $v_EncryptCipherBy = BitXOR(Dec(StringMid($s_EncryptText, $i_EncryptCountA, 2)), $i_EncryptCountE) $v_EncryptCipher = $v_EncryptCipher & Chr($v_EncryptCipherBy) Next $s_EncryptText = $v_EncryptCipher $i_EncryptCountG = '' $i_EncryptCountH = '' $v_EncryptModified = '' For $i_EncryptCountG = 1 To StringLen($s_EncryptText) If $i_EncryptCountH = StringLen($s_EncryptPassword) Then $i_EncryptCountH = 1 Else $i_EncryptCountH = $i_EncryptCountH + 1 EndIf $v_EncryptModified = $v_EncryptModified & Chr(BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountG, 1)), Asc(StringMid($s_EncryptPassword, $i_EncryptCountH, 1)), 255)) Next $s_EncryptText = $v_EncryptModified Next EndIf Return $s_EncryptText EndIf EndFunc ;==>_StringEncrypt ;=============================================================================== ; ; Description: Changes a string to proper case, same a =Proper function in Excel ; Syntax: _StringProper( $sString) ; Parameter(s): $sString - String to change to proper case. ; Requirement(s): None ; Return Value(s): On Success - Returns the proper string. ; On Failure - Returns an empty string and sets @error = 1 ; Author(s): Jos van der Zande ; Note(s): None ; ;=============================================================================== Func _StringProper($s_Str) Local $iX = 0 Local $CapNext = 1 Local $s_nStr = "" Local $s_CurChar For $iX = 1 To StringLen($s_Str) $s_CurChar = StringMid($s_Str, $iX, 1) Select Case $CapNext = 1 If __CharacterIsApha($s_CurChar) Then $s_CurChar = StringUpper($s_CurChar) $CapNext = 0 EndIf Case Not __CharacterIsApha($s_CurChar) $CapNext = 1 Case Else $s_CurChar = StringLower($s_CurChar) EndSelect $s_nStr = $s_nStr & $s_CurChar Next Return ($s_nStr) EndFunc ;==>_StringProper ;=============================================================================== ; ; Description: Repeats a string a specified number of times. ; Syntax: _StringRepeat( $sString, $iRepeatCount ) ; Parameter(s): $sString - String to repeat ; $iRepeatCount - Number of times to repeat the string ; Requirement(s): None ; Return Value(s): On Success - Returns string with specified number of repeats ; On Failure - Returns an empty string and sets @error = 1 ; Author(s): Jeremy Landes ; Note(s): None ; ;=============================================================================== Func _StringRepeat($sString, $iRepeatCount) ;============================================== ; Local Constant/Variable Declaration Section ;============================================== Local $sResult Local $iCount Select Case Not StringIsInt($iRepeatCount) SetError(1) Return "" Case StringLen($sString) < 1 SetError(1) Return "" Case $iRepeatCount <= 0 SetError(1) Return "" Case Else For $iCount = 1 To $iRepeatCount $sResult = $sResult & $sString Next Return $sResult EndSelect EndFunc ;==>_StringRepeat ;=============================================================================== ; ; Description: Reverses the contents of the specified string. ; Syntax: _StringReverse( $sString ) ; Parameter(s): $sString - String to reverse ; Requirement(s): None ; Return Value(s): On Success - Returns reversed string ; On Failure - Returns an empty string and sets @error = 1 ; Author(s): Jonathan Bennett ; Note(s): None ; ;=============================================================================== Func _StringReverse($sString) ;============================================== ; Local Constant/Variable Declaration Section ;============================================== Local $sReverse Local $iCount If StringLen($sString) >= 1 Then For $iCount = 1 To StringLen($sString) $sReverse = StringMid($sString, $iCount, 1) & $sReverse Next Return $sReverse Else SetError(1) Return "" EndIf EndFunc ;==>_StringReverse ;=============================================================================== ; ; Function Name: _StrToHex("string") ; Description: Convert a string of characters to hexidecimal. ; Parameter(s): $strChar is the string you want to convert. ; Requirement(s): String Input. ; Return Value(s): On Success - Returns the converted string in hexidecimal. ; On Failure - -1 and sets @ERROR = 1 ; Author(s): Jarvis Stubblefield ; ;=============================================================================== Func _StringToHex($strChar) Local $aryChar, $i, $iDec, $hChar, $file, $strHex $aryChar = StringSplit($strChar, "") For $i = 1 To $aryChar[0] $iDec = Asc($aryChar[$i]) $hChar = Hex($iDec, 2) $strHex = $strHex & $hChar Next If $strHex = "" Then SetError(1) Return -1 Else Return $strHex EndIf EndFunc ;================================================================================= ; Helper functions Func __CharacterIsApha($s_Str) Local $a_Alpha = "abcdefghijklmnopqrstuvwxyz" Return ( StringInStr($a_Alpha, $s_Str)) EndFunc ;==>__CharacterIsApha Edited October 21, 2013 by Jos Link to comment Share on other sites More sharing options...
Kaso Posted October 16, 2005 Author Share Posted October 16, 2005 I fixed it. although it doesn't really fix the problem it does get around it for me. I created a new include stringreverse.au3 and copied just the code for the func _stringreverse works for me. not sure what was causing the problem but i'm around it. Link to comment Share on other sites More sharing options...
w0uter Posted October 16, 2005 Share Posted October 16, 2005 (edited) Func _HexToString($strHex) Local $strChar, $aryHex, $i, $iDec, $Char, $file, $strHex, $iOne, $iTwo...EndFuncsame goes for the other error, only a different func. Edited October 16, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
A.B.Ames Posted October 16, 2005 Share Posted October 16, 2005 (edited) Hi there, Seems you found a bug, you can get around it by looking in the include file and just coping the function to the bottom of your script then commenting out the include at the top of your script. seems the Func _HexToString($strHex) <--is seen as a declaration Func _StringEncrypt($i_Encrypt, $s_EncryptText, $s_EncryptPassword, $i_EncryptLevel = 1) <-seen as declaration in these 2 functions plus they are being declared again below. hope this helps TKAre A.B.Ames Edit ---looks like i type too slow both have found what i did... Edited October 16, 2005 by A.B.Ames Link to comment Share on other sites More sharing options...
MHz Posted October 16, 2005 Share Posted October 16, 2005 Have a look in your beta folder then you may find a corrected version of String.au3? String.au3 looks fine in the latest beta that I have. Link to comment Share on other sites More sharing options...
Kaso Posted October 16, 2005 Author Share Posted October 16, 2005 I did a fresh intall on a pc with no autoit at all. i'm not using the beta defs. I used 3.1.1 and scite4 installs. as for the defs i tihnk the date was aug 8 2005. anyways i am around the problem. thanks for the help. should this bug be brought up to anyone? Link to comment Share on other sites More sharing options...
Skruge Posted October 16, 2005 Share Posted October 16, 2005 I did a fresh intall on a pc with no autoit at all. i'm not using the beta defs. I used 3.1.1 and scite4 installs. as for the defs i tihnk the date was aug 8 2005. anyways i am around the problem. thanks for the help. should this bug be brought up to anyone?It has already been corrected in the beta. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
Kaso Posted October 16, 2005 Author Share Posted October 16, 2005 (edited) so using the beta defs 3.1.1.76 should not show the errors? I just tried it and i stll get the error. what do u mean its fixed in the beta, which beta? Edited October 16, 2005 by Kaso Link to comment Share on other sites More sharing options...
MHz Posted October 16, 2005 Share Posted October 16, 2005 (edited) UDFS, not Definitions. The latest are with the AutoIt beta or you can update your UDFs separately from here. The latest UDFs are updated to work with the latest AutoIt beta as you cannot redeclare a UDF parameter in the AutoIt beta. Bugs have also been fixed in the latest UDFs. Edited October 16, 2005 by MHz 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