Originally Posted by
Citrus
I saw that you used pixelshift but I didn't look thoroughly enough to see exactly what it was doing. I figured you must have been doing something like this. What are the advantages of bitmaps? I was a little confused when I looked at some of the functions in Simba.
I've been running a 150-line combat script with this all day and it can compete with my 1k line auto-color script. It kinda feels wrong..
I'll probably start a new auto-color script using SRL-6 CTS2 functions once I mess with this a bit more.
It's two ways of getting at the same data. I guess it would come down to performance. getcolors is looking at the screen bitmap too. To get best performance, which may be needed, a plugin would be best. That way it can work outside the interpreter.
The problem with motion is it requires the npc to move! And you need to filter out the false results like streams or lights.
For best motion detection you need to look at multiple snaps and keep merging things into a background image. See how cool slacky's demo was in that other thread. That's what you get from background analysis. But of course the second you move it all goes out the window.
Let me know what problems you're having with bitmaps. Here's a bitmap version of your snip. Start it when already logged in:
Simba Code:
program motion;
{$DEFINE SMART}
{$include_once srl-6/srl.simba}
var
orig, current, diff, w, h, x, y: integer;
begin
smartPlugins := ['d3d9.dll'];
smartEnableDrawing := true;
SetupSRL();
GetClientDimensions(w, h);
SmartSetEnabled(__smartCurrentTarget, false);
while (true) do
begin
orig := BitmapFromClient(0, 0, w-1, h-1);
wait(60);
current := BitmapFromClient(0, 0, w-1, h-1);
diff := CreateBitmap(w, h);
for x := 0 to w-1 do
for y := 0 to h-1 do
if (FastGetPixel(orig, x, y) <> FastGetPixel(current, x, y)) then
FastSetPixel(diff, x, y, 255);
smartImage.drawBitmap(diff, point(0, 0));
FreeBitmap(orig);
FreeBitmap(current);
FreeBitmap(diff);
end;
end.