SRL Archive - Discussions & Debates

SMART Cursor


Lucidity

2014-07-05 01:22:15

Is it possible to change the cursor that's loaded with SMART? The red dot? Would be cool if we can change the cursor to our customization :p

Brandon

2014-07-05 01:58:58

From: xevo1
Is it possible to change the cursor that's loaded with SMART? The red dot? Would be cool if we can change the cursor to our customization :p


You have four choices yeah..

You can:

  • Modify the OpenGL plugin
  • Modify the DirectX plugin
  • Modify Smart itself
  • Modify the SRL mouse function to paint on top of the mouse when it moves

The last one is by far the easiest to do.

Lucidity

2014-07-05 02:28:44

Dang, want to help me? I like the p-bot mouse cursor with the tracer

KeepBotting

2014-07-05 08:59:39

From: xevo1
Dang, want to help me? I like the p-bot mouse cursor with the tracer
I believe an old Gnome Agility script had mouse trails. Dig around in the outdated RS3 script section and see what you can learn, pretty sure it was by DannyRS

Lucidity

2014-07-05 16:28:06

From: KeepBotting
I believe an old Gnome Agility script had mouse trails. Dig around in the outdated RS3 script section and see what you can learn, pretty sure it was by DannyRS


Thanks, will take a look. I mean, if we're going to use the bot might as well make it look nice :)

CRASH_OVERRIDE

2014-07-07 05:11:57

Been looking through RS3 outdated, no cursor methods by DannyRS is their, he has a Wildy agility but it doesn't have the custom cursor, checked a few other agility courses as well with no luck, their was something maybe of use in DannyRS's Fletcher, but still not what xevo1 is after, i will keep looking. I remeber a long time ago a member by the name of "jeffrey" had one in his ash collector script back in 2012.

This might help for an idea of using directx/opengl: https://villavu.com/forum/showthread.php?t=107256&highlight=cursor

Maybe try looking into some of Brandons older work:
https://villavu.com/forum/showthread.php?t=108229

He talks to a guy about it here:
https://villavu.com/forum/showthread.php?t=108599&highlight=cursor

-CRASH.

The Mayor

2014-07-07 06:22:24

From: xevo1
Dang, want to help me? I like the p-bot mouse cursor with the tracer


From: CRASH_OVERRIDE
Been looking through RS3 outdated, no cursor methods by DannyRS is their, he has a Wildy agility but it doesn't have the custom cursor, checked a few other agility courses as well with no luck, their was something maybe of use in DannyRS's Fletcher, but still not what xevo1 is after, i will keep looking. I remeber a long time ago a member by the name of "jeffrey" had one in his ash collector script back in 2012.

This might help for an idea of using directx/opengl: https://villavu.com/forum/showthread.php?t=107256&highlight=cursor

-CRASH.


Like 3 lines edited in the mouse.simba include file:

E: new gif:


KeepBotting

2014-07-07 07:14:34

From: The Mayor
Like 3 lines edited in the mouse.simba include file:

E: new gif:


That's the one I was thinking of :P

CRASH_OVERRIDE

2014-07-07 07:52:13

Nice, didn't even think to check mouse.simba!

Lucidity

2014-07-07 09:52:51

From: The Mayor
Like 3 lines edited in the mouse.simba include file:

E: new gif:



Sweet, wish it was more customized though :p, Mind sharing how you did it?


Would be cool if we could get this in there

CRASH_OVERRIDE

2014-07-08 02:48:49

Would is use much of the CPU?

bestplox

2014-07-12 02:31:55

From: CRASH_OVERRIDE
Would is use much of the CPU?


I don't think so. It is simple mouse trail.

CRASH_OVERRIDE

2014-07-12 02:39:39

I think a few of these would help, imagine if it was visible if disabledebug=false in all scripts?

We can make scripts and see the trail and make it more human like, sort of how jagex does with their screensweeper to ban players.

Clarity

2014-07-12 03:23:37

From: xevo1
Sweet, wish it was more customized though :p, Mind sharing how you did it?


Would be cool if we could get this in there

Wow those trails actually would be incredibly useful to me for trying to see how human-like my script's mouse movements are.

CRASH_OVERRIDE

2014-07-12 05:00:07

Yeah! I reckon if we had a few Constants of trails made, in mouse.simba and then had a new function that would let you select one of the trail constants i reckon we could all improve our mouse functions.

Olly

2014-07-12 13:17:52

From: bestplox
I don't think so. It is simple mouse trail.


Wrong, would take the exact same CPU as drawing the whole entire SMART image, so in simple terms it's a damn lot more cpu wasted for a simple mouse trail.

Sin

2014-07-12 16:00:34

From: Olly
Wrong, would take the exact same CPU as drawing the whole entire SMART image, so in simple terms it's a damn lot more cpu wasted for a simple mouse trail.


From: bestplox
I don't think so. It is simple mouse trail.


Exactly, it's drawing the entire image AGAIN with the trail as a paint. What the mouse trail is, is it's basically a paint progress kinda thing ONLY for the mouse.

CRASH_OVERRIDE

2014-07-12 21:08:38

^ kinda thought that:(

acow

2014-07-12 22:04:00

From: The Mayor
Like 3 lines edited in the mouse.simba include file:

E: new gif:


that is REALLY sexy.

Sin

2014-07-12 23:37:58

From: The Mayor
Like 3 lines edited in the mouse.simba include file:

E: new gif:



I'd like to know how to do this too :D

Turpinator

2014-07-13 03:21:38

From: Sin
I'd like to know how to do this too :D


modify mouse.simba? (for locally)
or just do a…
procedure _brakeWindMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait,
targetArea: extended; double: boolean); override;
var
veloX,veloY,windX,windY,veloMag,dist,randomDist,lastDist,D: extended;
lastX,lastY,MSP,W,TDist,T: integer;
sqrt2,sqrt3,sqrt5,PDist,maxStep,dModA,dModB,nModA,nModB: extended;
begin
MSP := mouseSpeed;
sqrt2:= sqrt(2);
sqrt3:= sqrt(3);
sqrt5:= sqrt(5);
//////////////////////////////////////////////////////////////////////////////
smartImage.clear();

TDist := distance(round(xs), round(ys), round(xe), round(ye));
if (TDist < 1) then
TDist := 1;

dModA := 0.88; //.80
dModB := 0.95; //.90

if (TDist > 220) then
begin
nModA := 0.08;
nModB := 0.04;
end else if (TDist <= 220) then
begin
nModA := 0.20;
nModB := 0.10;
end;

t := getSystemTime() + 5000;
repeat
if (getSystemTime() > t) then
break;

dist:= hypot(xs - xe, ys - ye);
wind:= minE(wind, dist);
if (dist < 1) then
dist := 1;
PDist := (dist/TDist);
if (PDist < 0.01) then
PDist := 0.01;

if double then
begin
if (PDist <= dModA) then
begin
D := (round((round(dist)*0.3))/5);
if (D < 20) then
D := 20;

end else if (PDist > dModA) then
begin
if (PDist < dModB) then
D := randomRange(5, 8)
else if (PDist >= dModB) then
D := randomRange(3, 4);
end;
end;

if (PDist >= nModA) then
begin
D := (round((round(dist)*0.3))/5);
if (D < 20) then
D := 20;
end else if (PDist < nModA) then
begin
if (PDist >= nModB) then
D := randomRange(5, 8)
else if (PDist < nModB) then
D := randomRange(3, 4);
end;

if (D <= round(dist)) then
maxStep := D
else
maxStep := round(dist);

if dist >= targetArea then
begin
windX:= windX / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
windY:= windY / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
end else
begin
windX:= windX / sqrt2;
windY:= windY / sqrt2;
end;

veloX:= veloX + windX;
veloY:= veloY + windY;
veloX:= veloX + gravity * (xe - xs) / dist;
veloY:= veloY + gravity * (ye - ys) / dist;

if (hypot(veloX, veloY) > maxStep) then
begin
randomDist:= maxStep / 2.0 + random(round(maxStep) div 2);
veloMag:= sqrt(veloX * veloX + veloY * veloY);
veloX:= (veloX / veloMag) * randomDist;
veloY:= (veloY / veloMag) * randomDist;
end;

lastX:= round(xs);
lastY:= round(ys);
xs:= xs + veloX;
ys:= ys + veloY;

////////////////////////////////////////////////////////////////////////////////
if (lastX <> round(xs)) or (lastY <> round(ys)) then
begin
moveMouse(round(xs), round(ys));
smartImage.drawCircle(point(round(xs), round(ys)), random(1, 6), true, random(10000, 20000));
end;
////////////////////////////////////////////////////////////////////////////////

W := (random((round(100/MSP)))*6);
if (W < 5) then
W := 5;
if double then
if (PDist > dModA) then
W := round(W*2.5)
else
W := round(W*1.2);
wait(W);
lastdist:= dist;
until(hypot(xs - xe, ys - ye) < 1)

////////////////////////////////////////////////////////////////////////////////
if (round(xe) <> round(xs)) or (round(ye) <> round(ys)) then
begin
moveMouse(round(xe), round(ye));
smartImage.drawCircle(point(round(xe), round(ye)), random(1, 6), true, random(10000, 20000));
end;
////////////////////////////////////////////////////////////////////////////////

mouseSpeed := MSP;
end;
and then do the same for _humanWindMouse. (for a per-script basis)

PS: code not tested.

PPS: Started attempting to write one that dynamically updated the line earlier today. left. came back drunk, contemplated doing it. meh. whatever.

Olly

2014-07-13 11:47:44

Put this together in a couple of mins http://tinypic.com/player.php?v=15n3xo4%3E&s=8#.U8KqCfldWaq

Clarity

2014-07-13 12:04:03

From: Olly
Put this together in a couple of mins http://tinypic.com/player.php?v=15n3xo4%3E&s=8#.U8KqCfldWaq

Is that via updated plugin aka not a big cost to CPU?

Olly

2014-07-13 13:24:24

From: Clarity
Is that via updated plugin aka not a big cost to CPU?


Nop, Did it in Simba.

I could probs do it if @Brandon's DXI (pascal) plugin worked.. but it has some dumb bug which sucks.

Brandon

2014-07-13 14:34:29

From: Olly
Nop, Did it in Simba.

I could probs do it if @Brandon's DXI (pascal) plugin worked.. but it has some dumb bug which sucks.


What bug? :S

Olly

2014-07-13 15:06:53

From: Brandon
What bug? :S


https://villavu.com/forum/showthread.php?t=108536&p=1290061#post1290061

Right?

If you fixed it you didnt update the repo :p

Hoodz

2014-07-13 16:30:44

[video=youtube;ouugxzczaEM]https://www.youtube.com/watch?v=ouugxzczaEM[/video]

isnt that good, also forgot here to remove the trail after a few seconds

Brandon

2014-07-13 17:41:09

From: Olly
https://villavu.com/forum/showthread.php?t=108536&p=1290061#post1290061

Right?

If you fixed it you didnt update the repo :p



That pascal plugin doesn't have anything to do with the current one. In fact, I might remove that Repo to get rid of confusion. The C++ ones already work. The pascal one was just there in case someone wanted "Pascal" only code after seeing how much C++ hate goes on around villavu..

But again, DXI works fine: https://github.com/Brandon-T/DXI/tree/master/DXI https://github.com/Brandon-T/DXI/releases

Olly

2014-07-13 17:47:15

From: Brandon
That pascal plugin doesn't have anything to do with the current one. In fact, I might remove that Repo to get rid of confusion. The C++ ones already work. The pascal one was just there in case someone wanted "Pascal" only code after seeing how much C++ hate goes on around villavu..

But again, DXI works fine: https://github.com/Brandon-T/DXI/tree/master/DXI https://github.com/Brandon-T/DXI/releases


I'm not saying the current one isn't fine.. I was just going to add some fancy mouse-trails to the plugin… Tho I would do it to the pascal plugin (if it worked).

Brandon

2014-07-13 18:10:06

From: Olly
I'm not saying the current one isn't fine.. I was just going to add some fancy mouse-trails to the plugin… Tho I would do it to the pascal plugin (if it worked).



Oh but why? You could just add it to the current one or override the Simba mouse functions?

Can't you do something like:


Procedure Mouse(....);
begin
inherited(....);
Paint(...);
end;

Or will inherited not work there? Or is it too slow?

Olly

2014-07-13 18:21:45

From: Brandon
Oh but why? You could just add it to the current one or override the Simba mouse functions?

Can't you do something like:


Procedure Mouse(....);
begin
inherited(....);
Paint(...);
end;

Or will inherited not work there? Or is it too slow?


That's what I did currently.. People were saying about extra cpu wasted when you only want to draw the mousetrails.. So i was gonna throw it in a plugin and have some fun.

Brandon

2014-07-13 18:26:27

From: Olly
That's what I did currently.. People were saying about extra cpu wasted when you only want to draw the mousetrails.. So i was gonna throw it in a plugin and have some fun.


But if you throw it in a plugin, it'd have to be recompiled every time you want to change it. Whether a plugin or Simba, CPU usage has to come from somewhere. The plugin would only do it once and would be faster but meh.. It's still going to have "some" CPU usage.

Olly

2014-07-13 18:28:58

From: Brandon
But if you throw it in a plugin, it'd have to be recompiled every time you want to change it. Whether a plugin or Simba, CPU usage has to come from somewhere. The plugin would only do it once and would be faster but meh.. It's still going to have "some" CPU usage.


Of course lol, but to end the discussion it was merely only a fun project I wanted to do… I don't even see the massive need for a mouse-trail.

Ian

2014-07-13 18:31:23

I don't think mousetrails would be something that people would use except for debugging maybe, or if they just wanted to see it for a little, so the extra CPU wouldn't be that big of an issue.

The Mayor

2014-07-13 18:32:21

From: Olly
Of course lol, but to end the discussion it was merely only a fun project I wanted to do… I don't even see the massive need for a mouse-trail.


But it would be nice to have an option. smartMouseTrails := true; or something

Brandon

2014-07-13 18:40:15

From: The Mayor
But it would be nice to have an option. smartMouseTrails := true; or something


Yeah but with options comes many other options. Being able to specify what the trail looks like (shape), the colours, the length, crosshairs, etc.. Not just a boolean. It can actually still be done via a plugin. Just map the same memory that SMART mapped and write to its image buffer but is it worth it? If done in Direct-X or OpenGL rather than through SMART's image buffer, it's going to require the translations and vertices of every trail.

TLDR: Write to SMART's image buffer. Can easily be passed to any plugin for more speed. Personally, I actually won't mind adding this to the plugins or to SMART since I haven't coded much in a long time, but I'm not sure why when it can be done in Simba or in a plugin.

Sin

2014-07-13 18:51:34

From: Brandon
Yeah but with options comes many other options. Being able to specify what the trail looks like (shape), the colours, the length, crosshairs, etc.. Not just a boolean. It can actually still be done via a plugin. Just map the same memory that SMART mapped and write to its image buffer but is it worth it? If done in Direct-X or OpenGL rather than through SMART's image buffer, it's going to require the translations and vertices of every trail.

TLDR: Write to SMART's image buffer. Can easily be passed to any plugin for more speed. Personally, I actually won't mind adding this to the plugins or to SMART since I haven't coded much in a long time, but I'm not sure why when it can be done in Simba or in a plugin.


Do it :D

Lucidity

2014-07-14 01:16:25

I'm glad I've brought this up, as many people have been wanting it as well. =)