Log in

View Full Version : Help/Ideas on PaintonSmart?



laakerules
02-05-2012, 09:45 PM
Okay, currently it flashes like crazy. All i want is it to be near 100% always bieng updated with it not flashing white? How do i do this. Here are my methods.

The PaintOnSmart:
procedure SMART_DrawBitmapWithTextMulti(Clear: Boolean; Bitmap: Integer; BmpPlacement: TPoint; TP: TStringArray; Shadow: Boolean; TxtPlacement: TPoint; Font: string; Colour: TColor);
var
I, B, H, Pic, TPH, Numb: Integer;
Offset: TPoint;
TTP: TPointArray;
Canvas: TCanvas;
begin

if (not SMART_DebugSetup) then
SMART_SetupDebug();


TPH := High(TP);

Offset := IntToPoint(TxtPlacement.x - BmpPlacement.x, TxtPlacement.y - BmpPlacement.y);

Pic := CopyBitmap(Bitmap);

for I := 0 to TPH do
begin

TTP := LoadTextTPA(TP[i], SmallChars, H);

for B := 0 to High(TTP) do
begin

Numb := ((I + 1) * 13);

if Shadow then
try

FastSetPixel(Pic, TTP[b].x + 1 + Offset.x , TTP[b].y + Numb + 1 + Offset.y,131072);
except
end;

try

FastSetPixel(Pic, TTP[b].x + Offset.x, TTP[b].y + Numb + Offset.y, Colour);
except
end;
end;
end;

Canvas := TCANVAS.Create;
Canvas.Handle := SmartGetDebugDC;
DrawBitmap(Pic, Canvas, BmpPlacement.x, BmpPlacement.y);
FreeBitmap(Pic);
end;

Here is the Actualy Paining on the client.
Procedure DoThePainting;
begin
XPhour;
LoadBMP;
SMART_DrawBitmap(False, BMP, Point(0, 337));
SMART_DrawText(130, 395, UpCharsEx, '' +IntToStr(Kills)+ '', clRed);
SMART_DrawText(130, 420, UpCharsEx, '' +IntToStr(Exp)+ '', clRed);
SMART_DrawText(130, 445, UpCharsEx, ''+IntToStr(XPH)+'', clRed);
SMART_DrawText(325, 395, UpCharsEx,''+TimeRunning+' ', clRed);
SMART_DrawText(440, 420, UpCharsEx, ''+IntToStr(Charms)+'', clRed);
FreeBitmap(BMP);
end;
And if its some simple little thing please dont hate i just got back from a long trip and cant think straight atm! :/


Edit: NVM Figured it out, i was calling a different way to paint on smart in my NPC finding so that was a big issue! :P

Er1k
02-06-2012, 12:43 AM
Just curious, why would you want it to be always updated? AFAIK SMART draw is resource demanding.

laakerules
02-06-2012, 12:59 AM
Always updated so that the stats are constantly correct.

Er1k
02-06-2012, 04:19 AM
I think it's not worth the effort as it will be a resource hog. I know paintsmart proggies look lovely, but close to realtime update seems unnecessary to me. You won't be (and probably shouldn't be) staring your bot all the time looking at the stats report.

I used paintsmart back then but now I just tend to think that console output is just as good.

YoHoJo
02-06-2012, 04:47 AM
I've got live painted porgies on two of my scripts, haven't checked but I don't think it's too resource demanding and especially if you're just running one?

I had euphemism create a blend of text/bitmap paintsmart functions for me and use them to create some pretty snazzy live painted progs:
Example:
http://www.youtube.com/watch?v=bSdcF_ToiyQ

On phone now I'll paste the code later, you could also PM and ask him about it too.

laakerules
02-06-2012, 04:59 AM
Ya YoHo, i see what you did on that script. The only issue im at is that the text sort of flashes/scrolls to the rite everytime it updates. What you did is you had the DoThePainting;
Or whatever you called it to be done at every possible thing done correct?

Er1k
02-06-2012, 12:01 PM
I agree one that instance is fine :D But as you get more, things will start to slow down...