• Log in or sign up for an account here: https://www.sythe.org/login

can you draw with scar?

BillSnow

Newcomer
Joined
Mar 27, 2009
Sythe Gold
0
Messages
12
is it possible to have scar draw a fake layer over a game window....

can you make it draw a line from a designated point to (or even through) another point.... overlaid on top of the window?...

an example for the use of this would be for a pool game that doesn't draw the path built in... you could make it draw a line extending out from the queue ball through the cursor.... or visa versa depending on the game.... you get the point

is it possible?...

clearly it would have to display it on some kinda fake window above the game screen... and be able to be clicked through... so that could complicate things...
 
Yes, SCAR can draw on most things (even on the game client!), the only downside is, as soon as the screen changes, it disappears..

~Sandstorm
 
what functions do the drawing?...

i searched a number of things in the F1 list of functions and nothing really seemed to match....

i can figure out how to use them and bend them to my will... i just need to know what they are first :P....

edit: anyone have like an example script i can look at and see how the stuff is related... being fairly new to this i'm guessing it's going to involve a lot of stuff i haven't seen yet... looking forward to the fun of the challenge :P

strangely addictive... just finished my first script... a 3000 line bot LOL.... and it works flawlessly...
 
so i found this thread http://freddy1990.com/forums/index.php?topic=2659.0 on how to make your own game with scar....

that goes into a bit about drawing and the like... but it seems purely focused around the debug image window...

how would you make it display on top of the targeted game window...

do you resize the debug and move it on top and somehow make it a transparent background and let you click through it?... or is there some kind of command to use the targeted client instead of the debug image window?...
 
Code:
    FindColorsTolerance(T, 16777215, 544, 485, w - 1, h - 1, 150);
    ClientBMP := BitmapFromString(w - 544, h - 485, '');
    CopyClientToBitmap(ClientBMP, 544, 485, w, h);
    For I := 0 To High(T) Do
      FastSetPixel(ClientBMP, T[I].x - 544, T[I].y - 485, 0);
    Repeat
      SafeDrawBitmap(ClientBMP, GetClientCanvas, 544, 485);
    Until(IsFkeyDown(9))
    FreeBitmap(ClientBMP);

That's basically how you would do it, but of course you would need to do some changing based on what you want it to do.

~Sandstorm
 
wow thanks a ton... this will help a lot... sorry for the late response... moved... lol...
 
ok... i've got MOST of it working... but when it comes to drawing the line from point a to cursor, i'm hitting a bit of a wall...

i am able to make it put up a picture and resize it so that it KIND of works... but it doesn't really make a solid line after the pic has been deformed enough...

so i need to figure out a way to make a tpoint array that i could set pixel along...

but i have no clue how to make a toint array in a line other than vertical horizontal or diagonal......

anyone have any tips?
 
ok... so i have the script working... it shows the lines properly

HOWEVER... it blinks... a LOT...

i know the underlying cause... it's the fact that i'm needing to overlay a BITMAP over the game screen

bitmaps don't have transparencies....

the settransparentcolor won't make the overall bitmap transparent... and when you overlay it on the screen it's a black box (or whatever color you tell it it is)... but never transparent...

so far the way around it that hey321 pointed out is to change the bitmap's base file to copy the portion of the client screen... it WORKS.... just not well

with a game window that changes a lot it's almost fighitng with the game on what is displayed and ends up spamming a picture from a second back or so...

is there any way to just draw dirrectly on the client canvas?... or have a transparent canvas even?...

the changepixel stuff (at least the documented ones) change the pixels on bitmaps only... so when i try to copy a canvas over onto the client i have to first rip a bitmap off onto the canvas which then just adds in the background....

if anyone is following my nonsense?... please help...

i know that scar is used almost exclusively for runescape but it has lots of potential elsewhere that i'm trying to make use of...
 
i've found another slight workaround...

where i had been drawing with setpixel then pasting the bitmap ontop...
i've now just made a pixel sized bitmap and pasted it all over the game screen... lol...

it works... better than the other options...

but it's still not what i'm looking for... blinks alot...

i really would like a way to draw on an otherwise transparent picture... so i can let it sit with full lines up and not have to recalculate every run and thus maintain a solid line...
 
wow...

ok i'm re-writing my script entirely...

three lines that completely do what i want and make me want to /wrist for the wasted time making my own line drawing functions...

getclientcanvas.Pen.Color := clRed;
getclientcanvas.MoveTo(331, 275);
getclientcanvas.LineTo(703, 823)

that example will draw a red line on the screen from 331,275 to 703,823
 
Runescape Gamblingrunescape gambling
Back
Top