Chapi Posted January 8, 2009 Share Posted January 8, 2009 Hi, this is how i do it. Its a simple script, maybe is useless for most of you, but for bootings purpose is really usefull. By using this you can read hp, mp, cp bars and any bar that has a constant color. ;~ ====================================================================== ;~ Controlo el mp mediante la lectura de los pixeles de la barra de MP ;~ la unica coordenada que varia es X. La coordenada Y queda fija en 55 ;~ ====================================================================== Func ControlMP() Local $Cor = 19 ;Punto inicial de la barra de mana (En X). Local $CantMP = 0 ;Se usa para incrementar el porcentaje a medida que lee la barra. Local $Negro ;Contiene el valor del pixel leido (valor numerico que representa el color) Local $PorcenMP = 11 ;Es la variable de retorno donde se almacena el porcentaje calculado While $Cor < 160 $Negro = PixelGetColor($Cor, 55) if $Negro > 30000 then if $CantMP < $PorcenMP Then $PorcenMP = $CantMP $Cor = 160 EndIf EndIf $CantMP = $CantMP + 0.5 $Cor = $Cor + 7 WEnd If $PorcenMP = 11 Then $PorcenMP = 10 EndIf $PorcenMP = $PorcenMP * 10 Return $PorcenMP EndFunc Link to comment Share on other sites More sharing options...
au3scr Posted January 8, 2009 Share Posted January 8, 2009 (edited) For what game you made it? What must be screen resolution? What must be bar width? Where it shows valuse? How to use this function? How it gets value? In what color must be life bar? How u getvalues with out reading game memory? for example my bar with is 5 cm long and life can be between 0 and 6730 and after I get my char next level this bar can have value between 0 and 8321, Then how I get that value? Can you also add comments in english please? Edited January 8, 2009 by au3scr Link to comment Share on other sites More sharing options...
Chapi Posted January 8, 2009 Author Share Posted January 8, 2009 For what game you made it?What must be screen resolution?What must be bar width?Where it shows valuse?How to use this function?How it gets value?In what color must be life bar?How u getvalues with out reading game memory?for example my bar with is 5 cm long and life can be between 0 and 6730 and after I get my char next level this bar can have value between 0 and 8321, Then how I get that value?Can you also add comments in english please?- For Lineage 2 C4- Lineage 2 is 3D but the status bars, skills and everything in the hud is 2d. A change in the resoludtion dosn't affect how many pixels are in the hud.- In the example script the bar begin in pixel (19, 55) and end in (159, 55) - The value of the bar is returned by the function in percentage. To now the actual number yo need to do the maths whit the maximun value of the bar.- For example maximun value of the bar is 4444 then: $Max = 4444 $Percen = ControlMP() $Current = ($Max * $Percen) / 100- In the example the bar is blue and the backgorund (when is empty) black. This is controled by (if $Negro > 30000 then)- The values aren't exacts, they are an approximation. To obtein more acurete values yo need to do more reads. In the example the bar is separated in 20 parts.160 - 19 = 141141 / 7 = 20.14Then you have 20 parts.Sorry for my bad english, i hope you understand something Link to comment Share on other sites More sharing options...
ynbIpb Posted May 7, 2009 Share Posted May 7, 2009 (edited) Chapi, There are some ideas of how to read the status bar in the Gracia final? The problem is that color is not homogeneous and the numbers are high, closing the entire strip.In Interlude, I made this function:; The function of the control strips MP returns the value as a percentage %; $MPx - coordinate X, $MPy - coordinate Y, $len - length of line, $color - the color of the first pixelFunc ControlMP($MPx, $MPy, $len, $color)Local $color2 = $colorLocal $MPx2 = $MPxWhile $color = $color2 ; cycle turning, until the color is equal$MPx2 += 1 ; on each cycle adds 1 to the coordinate$color2 = Hex(PixelGetColor($MPx2, $MPy), 6); checking whether the color has not changedWEnd$MPx2 -= 1 ; 1 discards the last turn of the cycle, because the color will not match.$MPx2 -= $MPx ; subtract the initial coordinates to get the number of covered pixels.$Percent = $MPx2 * 100 / $len ; calculate the percentage of$Percent = Ceiling ($Percent) ; rounded off to whole numberReturn $PercentEndFunc Edited May 7, 2009 by ynbIpb Link to comment Share on other sites More sharing options...
Cyber Posted May 8, 2009 Share Posted May 8, 2009 Good but donìt use With Punkbuster, It can ban Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key 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