While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $radio1 And BitAND(GUICtrlRead($radio1), $GUI_CHECKED) = $GUI_CHECKED
; --------------------- Functions ----------------------------- ; Binary to Decimal Func _BinaryToDec($strBin) Local $Return Local $lngValue Local $intIndex
If StringRegExp($strBin,'[0-1]') then $lngValue = 0 For $intIndex = StringLen($strBin) to 1 step -1 $strDigit = StringMid($strBin, $intIndex, 1) Select case $strDigit="0" ; do nothing case $strDigit="1" $lngValue = $lngValue + (2 ^ (StringLen($strBin)-$intIndex)) case else ; invalid binary digit, so the whole thing is invalid $lngValue = 0 $intIndex = 0 ; stop the loop EndSelect Next
; Decimal To Binary Func _DecToBinary($iDec) Local $i, $sBinChar = ""
If StringRegExp($iDec,'[[:digit:]]') then $i = 1
Do $x = 16^$i $i +=1 ; Determine the Octets Until $iDec < $x
For $n = 4*($i-1) To 1 Step -1 If BitAND(2 ^ ($n-1), $iDec) Then $sBinChar &= "1" Else $sBinChar &= "0" EndIf Next Return $sBinChar Else MsgBox(0,"Error","Wrong input, try again ...") Return EndIf EndFunc
; #FUNCTION# ============================================================== ; Function Name..: _HexToDec ( "expression" ) ; Description ...: Returns decimal expression of a hexadecimal string. ; Parameters ....: expression - String representation of a hexadecimal expression to be converted to decimal. ; Return Values .: Success - Returns decimal expression of a hexadecimal string. ; Failure - Returns "" (blank string) and sets @error to 1 if string is not hexadecimal type. ; Author ........: jennico (jennicoattminusonlinedotde) ; Remarks .......: working input format: "FFFF" or "0xFFFF" (string format), do NOT pass 0xFFFF without quotation marks (number format). ; current AutoIt Dec() limitation: 0x7FFFFFFF (2147483647). ; Related .......: Hex(), Dec(), _DecToHex() ; ======================================================================= Func _HexToDecimal($hx_hex) If StringLeft($hx_hex, 2) = "0x" Then $hx_hex = StringMid($hx_hex, 3) If StringIsXDigit($hx_hex) = 0 Then SetError(1) MsgBox(0,"Error","Wrong input, try again ...") Return "" EndIf Local $ret="", $hx_count=0, $hx_array = StringSplit($hx_hex, ""), $Ii, $hx_tmp For $Ii = $hx_array[0] To 1 Step -1 $hx_tmp = StringInStr($HX_REF, $hx_array[$Ii]) - 1 $ret += $hx_tmp * 16 ^ $hx_count $hx_count += 1 Next Return $ret EndFunc ;==>_HexToDec()
; #FUNCTION# ============================================================== ; Function Name..: _DecToHex ( expression [, length] ) ; Description ...: Returns a string representation of an integer converted to hexadecimal. ; Parameters ....: expression - The integer to be converted to hexadecimal. ; - [optional] Number of characters to be returned (no limit). ; If no length specified, leading zeros will be stripped from Value. ; Return Values .: Success - Returns a string of length characters representing a hexadecimal expression, zero-padded if necessary. ; Failure - Returns "" (blank string) and sets @error to 1 if expression is not an integer. ; Author ........: jennico (jennicoattminusonlinedotde) ; Remarks .......: Output format "FFFF". ; The function will also set @error to 1 if requested length is not sufficient - the returned string will be left truncated. ; Be free to modify the function to be working with binary type input - I did not try it though. ; current AutoIt Hex() limitation: 0xFFFFFFFF (4294967295). ; Related .......: Hex(), Dec(), _HexToDec() ; ======================================================================= Func _DecimalToHex($hx_dec, $hx_length = 21)
If IsInt($hx_dec) = 0 Then SetError(1) MsgBox(0,"Error","Wrong input, try again ...") Return "" EndIf Local $ret = "", $Ii, $hx_tmp, $hx_max If $hx_dec < 4294967296 Then If $hx_length < 9 Then Return Hex($hx_dec, $hx_length) If $hx_length = 21 Then $ret = Hex($hx_dec) While StringLeft($ret, 1) = "0" $ret = StringMid($ret, 2) WEnd Return $ret EndIf EndIf For $Ii = $hx_length - 1 To 0 Step -1 $hx_max = 16 ^ $Ii - 1 If $ret = "" And $hx_length = 21 And $hx_max > $hx_dec Then ContinueLoop $hx_tmp = Int($hx_dec/($hx_max+1)) If $ret = "" And $hx_length = 21 And $Ii > 0 And $hx_tmp = 0 Then ContinueLoop $ret &= StringMid($HX_REF, $hx_tmp+1, 1) $hx_dec -= $hx_tmp * ($hx_max + 1) Next $ret=String($ret) If $hx_length < 21 And StringLen($ret) < $hx_length Then SetError(1) Return $ret EndFunc ;==>_DecToHex()
; ---------------------------------------------------------------- ; Hex to Decimal Conversion ; Correct till Decimal 65789 ?! Func _HexToDecimal_NotCorrect($Input) Local $Temp, $i, $Pos, $Ret, $Output
If StringRegExp($input,'[[:xdigit:]]') then $Temp = StringSplit($Input,"")
For $i = 1 to $Temp[0] $Pos = $Temp[0] - $i $Ret = Dec (Hex ("0x" & $temp[$i] )) * 16 ^ $Pos $Output &= $Ret Next return $Output Else MsgBox(0,"Error","Wrong input, try again ...") Return EndIf EndFunc
; Decimal To Hex Conversion Func _DecimalToHex_NotCorrect($Input) local $Output, $Ret
If StringRegExp($input,'[[:digit:]]') then Do $Ret = Int(mod($Input,16)) $Input = $Input/16 $Output = $Output & StringRight(Hex($Ret),1) Until Int(mod($Ret,16))= 0
; Binary To Hex Func _BinaryToHexString($BinaryValue) Local $test, $Value = '',$numbytes,$nb
If StringRegExp($BinaryValue,'[0-1]') then
if $BinaryValue = '' Then SetError(-2) Return endif
Local $bits = "0000|0001|0010|0011|0100|0101|0110|0111|1000|1001|1010|1011|1100|1101|1110|1111" $bits = stringsplit($bits,'|') #region check string is binary
$test = stringreplace($BinaryValue,'1','') $test = stringreplace($test,'0','') if $test <> '' Then SetError(-1);non binary character detected Return endif #endregion check string is binary
#region make binary string an integral multiple of 4 characters While 1 $nb = Mod(StringLen($BinaryValue),4) if $nb = 0 then exitloop $BinaryValue = '0' & $BinaryValue WEnd #endregion make binary string an integral multiple of 4 characters
$numbytes = Int(StringLen($BinaryValue)/4);the number of bytes
Dim $bytes[$numbytes],$Deci[$numbytes] For $j = 0 to $numbytes - 1;for each byte ;extract the next byte $bytes[$j] = StringMid($BinaryValue,1+4*$j,4)
;find what the dec Value of the byte is for $k = 0 to 15;for all the 16 possible hex Values if $bytes[$j] = $bits[$k+1] Then $Deci[$j] = $k ExitLoop EndIf next Next
;now we have the decimal Value for each byte, so stitch the string together again $Value = '' for $l = 0 to $numbytes - 1 $Value &= Hex($Deci[$l],1) Next return $Value Else MsgBox(0,"Error","Wrong input, try again ...") Return EndIf EndFunc
; Hex To Binary Func _HexToBinaryString($HexValue) Local $Allowed = '0123456789ABCDEF' Local $Test,$n Local $Value = '' if $hexValue = '' then SetError(-2) Return EndIf
$hexValue = StringSplit($hexValue,'') for $n = 1 to $hexValue[0] if not StringInStr($Allowed,$hexValue[$n]) Then SetError(-1) return 0 EndIf Next
Local $bits = "0000|0001|0010|0011|0100|0101|0110|0111|1000|1001|1010|1011|1100|1101|1110|1111" $bits = stringsplit($bits,'|') for $n = 1 to $hexValue[0] $Value &= $bits[Dec($hexValue[$n])+1] Next
Return $Value
EndFunc
Func _GUICtrlCreateGradient($nStartColor, $nEndColor, $nX, $nY, $nWidth, $nHeight) Local $color1R = _ColorGetRed($nStartColor) Local $color1G = _ColorGetGreen($nStartColor) Local $color1B = _ColorGetBlue($nStartColor)
Local $nStepR = (_ColorGetRed($nEndColor) - $color1R) / $nHeight Local $nStepG = (_ColorGetGreen($nEndColor) - $color1G) / $nHeight Local $nStepB = (_ColorGetBlue($nEndColor) - $color1B) / $nHeight
mhm ich fänd mal son metin toll viel geiler wo man aus ner tabelle farben auswählen kann und dann sagt der einem den zahlencode den metin verwendet also dieses 1.000000 0.887766 0.23975 das wäre mal richtig geil praktisch
Ich finde überhaupt nicht, dass es überflüssig ist.
Der Taschenrechner ist da doch sehr umständlich und ein gutes und umfangreiches Konvertierungs-Tool für die verschiedenen Daten hat mir bis vor kurzem auch lange gefehlt (zu faul selbst eins zu schreiben ;O)
Allerdings ist das hier nun nicht wirklich umfangreich und wie du schon selbst sagst, nur eine kleine Übung.
[Release] DBC Converter Source 12/13/2012 - CO2 Exploits, Hacks & Tools - 21 Replies Right, the majority of this works, however i decided in the end that it would just be best to dump the source of the project here and people can make changes and modify it as they need to.
To start off you will need some .dbc files to decode to .txt files, and then you can convert them back again. Make sure you update the Count at the top of the file if you make changes, and ensure that the layout is correct, if something is placed in the wrong place or missing, then it wont work, this is...
[RELEASE]mob_proto SQL to XML Converter 04/11/2011 - Metin2 PServer Guides & Strategies - 13 Replies heyho,
ich hatte gerade nichts zutun und bin dann im Thread http://www.elitepvpers.com/forum/metin2-pserver-gui des-strategies/1064242-release-mob_proto-xml-sql-c onverter.html auf den Post von Saaja gestossen
also dachte ich mir, dass ich das in die Tat umsetze^^
[Release]DDS-Converter 01/20/2011 - Metin2 PServer Guides & Strategies - 22 Replies Hey ich habe heute mal mein Desktop aufgeräumt :P und da fand ich plötzlich eine komische Datei. Aufeinmal stellte sich raus das es ein DDS-Converter war. Er wandelt DDS Dateien in jpg und png dateien um.
Da das für manche Client´s nützlich ist dachte ich ich stell es mal hier rein.
Virustotal Screen
http://img3.fotos-hochladen.net/uploads/virrustot al0t16k9zq.png
Screen vom Programm
http://img3.fotos-hochladen.net/uploads/programmn gw8demb.png
MfG Fun-Zocker
[RELEASE] DDS converter 08/18/2009 - EO PServer Guides & Releases - 9 Replies Well, because this is a tool, i post it here and not on another section :bandit:
People were complaining they cant open or edit a dds file..
This tool, can convert the dds file to jpg,png,bmp,tga
and it can convert "to" dds :handsdown: