Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 03:40

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Binary (toString) Problem

Discussion on Binary (toString) Problem within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1


 
Lawliet's Avatar
 
elite*gold: 2
Join Date: Jul 2009
Posts: 14,456
Received Thanks: 4,685
Binary (toString) Problem

Hallöchen,
meine Situation ist folgende:
Ich habe ein Script mit einem Binarycode:
Code:
$rezBinary = '0x262352657A4D67722056...'
$rezBinary &= '0100000000000...'
Ich habe einen RGB Farbcode den ich so in die einzelnen Farben auflöse:
Code:
$color1 = StringTrimLeft($color1, 2)
	$color2 = StringTrimLeft($color2, 2)
	$red1 = StringTrimRight($color1, 4)
	$red2 = StringTrimRight($color2, 4)
	$green1 = StringTrimLeft(StringTrimRight($color1, 2), 2)
	$green2 = StringTrimLeft(StringTrimRight($color2, 2), 2)
	$blue1 = StringTrimLeft($color1, 4)
	$blue2 = StringTrimLeft($color2, 4)
Und ich schreibe den Code so in ein File:

Code:
$string = BinaryToString($rezBinary)
if FileWrite($cagame & "\Game\TEXTUREEFFECTGROUPS.rez", $string) = False then
		MsgBox(0, "Error", "Unable to write file.")
		Exit
	EndIf
	MsgBox(0, "successful", "Colors set")
Jetzt zu meinem Problem:
Ich füge die einzelnen Farben an einer bestimmten stelle in dem Binary Code ein:
Code:
"...000" & $blue2 & $green2 & $red2 & "800000..."
Die drei Variablen enthalten Werte zwischen 00 und FF und sie ersetzen 6 Zeichen, die ich entfernt habe.

Leider scheitert das convertieren von Binary zum String (Es wird das gleiche Binary zurück gegeben). Allerdings nur, wenn ich die 3 Farbcodes einsetze. Wenn ich statt den drei Farbcodes "00FF00" lasse, funktioniert alles :/

MfG lawliet
Lawliet is offline  
Old 04/15/2012, 17:03   #2
 
lolkop's Avatar
 
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
warum schreibst du nicht das binary direkt ins file?
lolkop is offline  
Old 04/15/2012, 17:09   #3


 
Lawliet's Avatar
 
elite*gold: 2
Join Date: Jul 2009
Posts: 14,456
Received Thanks: 4,685
Weil es nicht zwingend Existieren muss Aber ich habs auch schon so versucht. Klappt auch nicht. Wenn ichs mit isBinary prüfe, ist es auch False Was sind die kriterien für ein Binary?
Lawliet is offline  
Old 04/15/2012, 17:10   #4
 
lolkop's Avatar
 
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
Quote:
Originally Posted by Lawliet! View Post
Weil es nicht zwingend Existieren muss Aber ich habs auch schon so versucht. Klappt auch nicht. Wenn ichs mit isBinary prüfe, ist es auch False Was sind die kriterien für ein Binary?
binarys sind in autoit strings, welche nur "hex zeichen" enthalten, und mit "0x" beginnen.
lolkop is offline  
Old 04/15/2012, 17:23   #5


 
Lawliet's Avatar
 
elite*gold: 2
Join Date: Jul 2009
Posts: 14,456
Received Thanks: 4,685
Problem gelöst:
Habe beim Binary zuweisen ' verwendet, aber beim Variablen einbauen ".
Kann zu gemacht werden.
Lawliet is offline  
Reply


Similar Threads Similar Threads
Problem of Msgserver Tq Binary 5065- 5095
05/10/2012 - CO2 Private Server - 6 Replies
Hey I have problem of CoAccountServer and Msgserver ; Link : http://img851.imageshack.us/img851/8691/errorck.pn g
[Relese]Tq Binary translation 98% + all Binary Files
07/07/2009 - CO2 Private Server - 20 Replies
#Removed
[Help]Donation problem in binary`s
04/24/2009 - CO2 Private Server - 2 Replies
When ppl donate then the server restart they back to earl... another question is there is way to let the GL of the winner guild get Cub auto Dont Flame Or ill report it just a question
[Guide] Fix Server.dat problem TQ binary !
04/24/2009 - CO2 PServer Guides & Releases - 2 Replies
i am bored of people who says and posts threads about this problem .. it's easy #Don't forget Multiclient # and loader Your shel.ini must be : ; حâ؟اإنضأ خؤ¼‏ ; 2002.10.23 MAPGROUP_SIZE = 5
I got a promotion problem on binary
04/01/2009 - CO2 Private Server - 0 Replies
the archers cant promote to master with mb..... dunno why... I think the source dont give them enought att points... is there any edit to change the att points for every lvl they got? Is hard to change in cq_user... because there are a lot.... and need a lot of work



All times are GMT +1. The time now is 03:40.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.