Log in

View Full Version : [I'm a newbiie] Locating Npc's and clicking on them



0wned2death1
05-01-2012, 05:44 AM
Alright, sorry if this sounds stupid as hell but I'm pretty new at this stuff.

I've seen a few tutorials but they're all mainly involve clicking on a tree which I know is FindObj. I'm pretty sure a npc is not an object so here I am..

How would I make it locate a nearby npc and click on it?


If anyone could be helpful or link me to a tutorial on that, I'll greatly appreciate it c:

Thanks

Abu
05-01-2012, 05:50 AM
You can find a lot of tutorials in the Tutorial Island (http://villavu.com/forum/forumdisplay.php?f=28)

However for what you are looking for:
http://villavu.com/forum/showthread.php?t=76005

0wned2death1
05-01-2012, 05:55 AM
You can find a lot of tutorials in the Tutorial Island (http://villavu.com/forum/forumdisplay.php?f=28)

However for what you are looking for:
http://villavu.com/forum/showthread.php?t=76005

Thanks for your help; I'v searched on tutorial island and haven't found one. In fact, the only one I did find was the one that you suggested and for some reason, it gives me errors :\

YoHoJo
05-01-2012, 06:09 AM
This should also help a lot.
http://www.youtube.com/watch?v=98wVrr6GwyU&feature=youtu.be

Abu
05-01-2012, 06:11 AM
Thanks for your help; I'v searched on tutorial island and haven't found one. In fact, the only one I did find was the one that you suggested and for some reason, it gives me errors :\

You should follow tutorials more carefully. As well as copying the procedures (just fine), you should try and learn in the process. :)

johnbrown8976
05-01-2012, 06:24 AM
Alright, sorry if this sounds stupid as hell but I'm pretty new at this stuff.

I've seen a few tutorials but they're all mainly involve clicking on a tree which I know is FindObj. I'm pretty sure a npc is not an object so here I am..

How would I make it locate a nearby npc and click on it?


If anyone could be helpful or link me to a tutorial on that, I'll greatly appreciate it c:

Thanks

I believe, NPC is also an object. Everything is an object. The function FindObj() finds anything with the given color, tolerance and upText.
A rough example to find Banker would be

var
x, y, color, tolerance: Integer;

Function findBanker:Boolean;
begin
Result := FindObj(x, y, 'anker', color, tolerance);
end;

0wned2death1
05-01-2012, 06:34 AM
This should also help a lot.
http://www.youtube.com/watch?v=98wVrr6GwyU&feature=youtu.be

I already know how to use that :p


And to everyone else, thanks heaps for the support x3 Specially Johnny, thanks for that info!


Edit: By the way, that just means the bot puts the mouse over the banker but doesn't actually click on him, right?

Abu
05-01-2012, 06:42 AM
Edit: By the way, that just means the bot puts the mouse over the banker but doesn't actually click on him, right?

In the example John gave, it won't do that either. It simply send back the co-ordinates the object/npc was found at. You then have to move the mouse yourself via MMouse or Mouse.

0wned2death1
05-01-2012, 06:46 AM
In the example John gave, it won't do that either. It simply send back the co-ordinates the object/npc was found at. You then have to move the mouse yourself via MMouse or Mouse.

I'm so confused.. Is it okay if I post my code so far and you can check why I'm getting an error?

It says:

SRL Compiled in 0 msec
SMART Initialized.
Loaded: Server 41, Members: False, Signed: True, Super Detail: False.
Error: Exception: Access violation at line 142
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]

Abu
05-01-2012, 06:47 AM
I'm so confused.. Is it okay if I post my code so far and you can check why I'm getting an error?


Sure. :)

0wned2death1
05-01-2012, 06:49 AM
Thanks heaps :3


program RuneSpan_Soul;
{$DEFINE SMART}
{$DEFINE SMART}
//{$I SRL/SRL.scar}
{$i srl/srl.simba}
//{$I MyFunc.scar}
{$i sps/sps.simba}


Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :=''; //username
Players[0].Pass :=''; //password
Players[0].Nick :=''; //nick
Players[0].Active:=True;
end;



function EsswraithColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.07, 1.73);

if not (FindColorsTolerance(arP, 13283397, MSX1, MSY1, MSX2, MSY2, 25)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;



begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
end.

Abu
05-01-2012, 06:51 AM
lol!

Don't mean to laugh but you had your slash's (/) the wrong way round :p

Should be this way:
{$i srl\srl.simba
{$i sps\sps.simba}

Now compiles :D

0wned2death1
05-01-2012, 06:56 AM
lol!

Don't mean to laugh but you had your slash's (/) the wrong way round :p

Should be this way:
{$i srl\srl.simba
{$i sps\sps.simba}

Now compiles :D

Lmfaoo, just did and still got same error haha. Do you have msn or somethingg?

Abu
05-01-2012, 06:59 AM
Sorry but I have to go now :(

Are you sure this doesn't compile?

{$DEFINE SMART}
{$DEFINE SMART}
{$i srl\srl.simba}
{$i sps\sps.simba}


Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :=''; //username
Players[0].Pass :=''; //password
Players[0].Nick :=''; //nick
Players[0].Active:=True;
end;



function EsswraithColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.07, 1.73);

if not (FindColorsTolerance(arP, 13283397, MSX1, MSY1, MSX2, MSY2, 25)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;



begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
end.

0wned2death1
05-01-2012, 07:02 AM
Sorry but I have to go now :(

Are you sure this doesn't compile?

{$DEFINE SMART}
{$DEFINE SMART}
{$i srl\srl.simba}
{$i sps\sps.simba}


Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :=''; //username
Players[0].Pass :=''; //password
Players[0].Nick :=''; //nick
Players[0].Active:=True;
end;



function EsswraithColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.07, 1.73);

if not (FindColorsTolerance(arP, 13283397, MSX1, MSY1, MSX2, MSY2, 25)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;



begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
end.



Yeah, heres a screenshot

http://screensnapr.com/v/oetx0l.jpg

Element17
05-01-2012, 01:01 PM
{$i srl\srl.simba}
{$i sps\sps.simba}


{$DEFINE SMART}
{$i srl\srl.simba}
{$i sps\sps.simba}


Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :=''; //username
Players[0].Pass :=''; //password
Players[0].Nick :=''; //nick
Players[0].Active:=True;
end;



function EsswraithColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.07, 1.73);

if not (FindColorsTolerance(arP, 13283397, MSX1, MSY1, MSX2, MSY2, 25)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;



begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
end.

Works for me, also you do no this is just giving you the color.