Log in

View Full Version : Help Clicking



Littellj
03-06-2012, 06:44 AM
Hi guys, this is my first post :)
I've been reading through tut's and using some scripts and looking at the code trying to get a feel for the scripting thing. I think i'm on to something. ;)
I'm trying to make a bandit theiver, i got the right colors and when i start this up it logs in and everything. Then the mouse moves over the spot where the color is, but won't right click. I'm puzzled as to why? Any thoughts? Also i'm trying to set the angle to high i tried "SetAngle(Set_Angle_High)" but it didn't work so if you could help me with that also. If i could get it to pickpocket the I can move on to eating ;)


Edit: if in wrong section move to first script? plz

program testbandit;
{$DEFINE SMART}
{$i srl/srl.simba}


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

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
End;



function Bandit: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.18, 0.21);

if not (FindColorsTolerance(arP, 1976886, MSX1, MSY1, MSX2, MSY2, 7)) 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;




Procedure Pickpocket;
var
x, y: integer;
begin
if(not(LoggedIn))then
Exit;

x:=MSCX;
y:=MSCY;

If FindObjTPA(x, y, Bandit, 5, 2, 5, 10, 20,['atta'])then

begin
WriteLn('Found Bandit');

GetMousePos(x, y);
Mouse(x, y, 2, 2, False);
Wait(100 + Random(100));
ChooseOption('pick');

end;

Wait(3000);
end;





begin
Smart_Server := 0;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;

SetUpSRL;
DeclarePlayers;
LoginPlayer;
repeat
FindNormalRandoms;
Pickpocket;
Until(false);

end.

begginer
03-06-2012, 11:20 AM
* * Mouse(x, y, 2, 2, True);
* * Wait(100 + Random(100));

Try this. This will only left click on them

masterBB
03-06-2012, 12:31 PM
How odd, the code you used is fine. Could you use ClickMouse? To see how that would work out. Also before setAngle you might want to try ActivateClient.

Ashaman88
03-06-2012, 02:05 PM
Yeah I would think it would work...try increasing

Wait(100 + Random(100));

to Wait(1000);

And if it works then, keep decreasing it to the 300 range or so?

masterBB
03-06-2012, 02:12 PM
You left your pass in the script. Changed pass and pm'd it to you.