Log in

View Full Version : Really need help.



spin3x
05-27-2012, 08:12 PM
Guys I'm watching every single video tutorial and I just cant get it :@:@:@

I've wasted around 5 hours now trying to do something and I have accomplished NOTHING! I'm really pissed off atm.

I just cant understand it. Sometimes its basic things. I do "ClickMouse...." and I get an error....

Can someone trusted like add me on skype, msn or tv me.

Thank you.

Code:

function Thiev: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 0.32);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 10066600, MSX1, MSY1, MSX2, MSY2, 3);
if (Length(arP) = 0) 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
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 30.97) and (X <= 35.82) and (Y >= 31.29) and (Y <= 36.17) and (Z >= 32.40) and (Z <= 37.45) then
begin
Result := arC[i];
//Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;

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

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


I get over 10 errors, 1st error is :

[Error] (9:13): Unknown identifier 'GetColorToleranceSpeed' at line 8
Compiling failed.

Google
05-27-2012, 08:29 PM
Program Yourthiever;
{$i SRL/srl.simba} // < you forgot to call this

function Thiev: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 0.32);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 10066600, MSX1, MSY1, MSX2, MSY2, 3);
if (Length(arP) = 0) 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
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 30.97) and (X <= 35.82) and (Y >= 31.29) and (Y <= 36.17) and (Z >= 32.40) and (Z <= 37.45) then
begin
Result := arC[i];
//Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;

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

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

Begin
end.

There you go.

Raskolnikov
05-27-2012, 08:35 PM
First off, you should put these in simba tags ([*simba]code here[/*simba] remove stars). It makes it easier to read.

Additionally,

program new;
always goes at the very top of the script.

Now the biggest problem here is forgetting to include SRL. You need to do this in order to gain access to the functions in SRL (which a majority of them are SRL functions that you are using).

How you include SRL is by:

{$i srl/srl.simba}

This should go directly under your program new; which will be at the very top.

That should solve a few of your problems.

Also, GOOGLE up there fixed your standards. That will also help us read it (indenting lines and such).

spin3x
05-27-2012, 08:55 PM
THANK YOU VERY MUCH, No errors :):):):)

But I'm a missing something? At first I just thought this is the whole script which does everything, but then I realised I have to make it, click on the stall. Im a bit confused :S Can anyone explain to me what else I need to add in order for the script to click on the stall?

Im sorry If Im too much of a hassle, but can anyone hit me up with a tutorial so that I can add the click stall etc

Raskolnikov
05-27-2012, 09:12 PM
OK. What you did up there was get the color for the theiving. It's an autocolor function because the color changes, so you need to find the correct color. Now you need to put the color the auto color function gets and put it through an actual finding function and click it.

spin3x
05-27-2012, 09:20 PM
(Program Thiev;
{$i SRL/srl.simba} // < you forgot to call this

function Thiev: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 0.32);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 10066600, MSX1, MSY1, MSX2, MSY2, 3);
if (Length(arP) = 0) 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
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 30.97) and (X <= 35.82) and (Y >= 31.29) and (Y <= 36.17) and (Z >= 32.40) and (Z <= 37.45) then
begin
Result := arC[i];
//Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;

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

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

Begin
end.

program Thiev;
begin
procedure StealStall;
var x, y: integer;
begin
if FindObj(x, y,'teal', 10461359, 35) then
begin
Mouse(x, y, 2, 2 true);
end;
end
end. )

Is that any good? I'm running it and getting no errors, I'm so happy :) But it isn't doing anything?

Raskolnikov
05-27-2012, 09:35 PM
You only need one mainloop begin end. (only one end with a period after it).

This usually goes at the end of the script.

You also only need one program whatever; this goes at the beginning.

Also, you need to call the autocolor function in the actual stealing function or else you created it for nothing. You also need to call the actual stealing function in the mainloop or, as you said, it won't do anything!

Here's it fixed:

Program Thiev;
{$i SRL/srl.simba} // < you forgot to call this

function Thiev: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 0.32);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 10066600, MSX1, MSY1, MSX2, MSY2, 3);
if (Length(arP) = 0) 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
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 30.97) and (X <= 35.82) and (Y >= 31.29) and (Y <= 36.17) and (Z >= 32.40) and (Z <= 37.45) then
begin
Result := arC[i];
//Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;

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

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

procedure StealStall;
var x, y, AutoColor: integer;
begin
AutoColor := Thiev;
if FindObj(x, y,'teal', AutoColor, 35) then
begin
Mouse(x, y, 0, 0, true);
end;
end;
begin
StealStall;
end.

Oh and you don't need the parentheses for the simba tags, just [*simba]code[/*simba] with no stars.