Log in

View Full Version : Need help



spin3x
05-27-2012, 04:52 PM
Guys Im new to Colour coding and would like some one to help, Im watching guides and I just cant seem to get the hang of it, I get errors like "Invalid number of parameters at line 6" (Line 6 was end" and I just have no idea what that means.

Im trying to code a simple auto clicker

CephaXz
05-27-2012, 04:54 PM
Post your whole script here.

And there a tutorial made by abu about common scripting errors, its very helpful for beginners.
http://villavu.com/forum/showthread.php?t=82793

spin3x
05-27-2012, 05:36 PM
program new;

var
Thiev, X, Y: Integer;
MSX1, MSY1, MSX2, MSY2 : Integer;



begin
Thiev := DTMFromString('mPwEAAHic42dgYBAEYmEg5gFiLiCWBWJ5IJ YEYhEg5gdibiBmYYAAViDmA2IpKM0MlWOHYpB5okAsAVUjhmQ+ G9QMkB4rNQ6G1lgNhrTERAZbdQ4GLSkeBh15YbAYCJfk5zOsXr IEzodhJ0NZBkoAIwUYDQAAl60Piw==');

If FindDTM(Thiev, X, Y, MSX1, MSY1, MSX2, MSY2); 'THEN'
Begin
WriteLn('Yay we found it!');
MMouse(x, y , 7, 7);
If IsUpText('General Stall') Then
Mouse(x, y, o, o, True);
End;

FreeDTM(Thiev);

end.

Thats my script and I get the error

[Error] (13:50): 'THEN' expected at line 12
Compiling failed.

Sin
05-27-2012, 05:38 PM
Mouse (x,y,0,0,true)
And
if FindDTM() then

spin3x
05-27-2012, 05:40 PM
Nevermind I got it :)

spin3x
05-27-2012, 05:44 PM
Code:

program new;

var
Thiev, X, Y: Integer;
MSX1, MSY1, MSX2, MSY2 : Integer;



begin
Thiev := DTMFromString('mPwEAAHic42dgYBAEYmEg5gFiLiCWBWJ5IJ YEYhEg5gdibiBmYYAAViDmA2IpKM0MlWOHYpB5okAsAVUjhmQ+ G9QMkB4rNQ6G1lgNhrTERAZbdQ4GLSkeBh15YbAYCJfk5zOsXr IEzodhJ0NZBkoAIwUYDQAAl60Piw==');

If FindDTM(Thiev, X, Y, MSX1, MSY1, MSX2, MSY2) Then
Begin
WriteLn('Yay we found it!');
MoveMouse(x, y, 0, 0);
If IsUpText('General Stall') Then
Mouse(x, y, 0, 0, True);
End;

FreeDTM(Thiev);

end.

I know get:

[Error] (16:26): Invalid number of parameters at line 15
Compiling failed.

CephaXz
05-27-2012, 05:52 PM
MSX1, MSY1, MSX2, MSY2 doesn't need to be declared in var.
Use MMouse instead of MoveMouse.

And you need to setupsrl for those to work I think.

spin3x
05-27-2012, 05:58 PM
Code:

program new;

var
Thiev, X, Y: Integer;




begin

SetupSRL;


Thiev := DTMFromString('mPwEAAHic42dgYBAEYmEg5gFiLiCWBWJ5IJ YEYhEg5gdibiBmYYAAViDmA2IpKM0MlWOHYpB5okAsAVUjhmQ+ G9QMkB4rNQ6G1lgNhrTERAZbdQ4GLSkeBh15YbAYCJfk5zOsXr IEzodhJ0NZBkoAIwUYDQAAl60Piw==');

If FindDTM(Thiev, X, Y, MSX1, MSY1, MSX2, MSY2) Then
Begin
WriteLn('Yay we found it!');
If IsUpText('General Stall') Then
Mouse(x, y, 0, 0, True);
End;

FreeDTM(Thiev);

end.

Errors:

[Error] (12:5): Unknown identifier 'SetupSRL' at line 11
Compiling failed.

[Error] (16:8): Unknown identifier 'IsUpText' at line 15
Compiling failed.

YoHoJo
05-27-2012, 06:06 PM
You need to include SRL at the top, re-watch my tutorial #2 (assuming that's what your are using, OR re-watch my DTM tutorial is that's what you are using).

Also never use MoveMouse/ClickMouse etc, ALWYAS use Mouse/MMouse, the first two are detectable and get you banned.

Also, are you using DTMs to find stuff on the main screen? I normally suggest against that and only use DTMs for inventory/bank/etc items just like I did in my tutorial.

spin3x
05-27-2012, 06:10 PM
Yh I was watching your DTM tut.

For the MMouse, I don't think it really matters as I'm not using it on real RS, its an Rsps

And for the last point, Yh I'm trying to make it find a stall and click it. If you don't suggest it, what should I use?

YoHoJo
05-27-2012, 06:13 PM
Okay for RSPS you can use whatever mouse function BUT in most cases text finding wont work, like IsUpText, ChooseOption, etc because runescape fonts change often and many time RSPS fonts don't match regular RS fonts.

As for what to do instead, check out my youtube channel for the tutorial about ACA (Auto Color Aid) that is what you will want to use. In fact though, on RSPS the colors MIGHT be static (meaning they never change) in which case you can just use FindColor/FindColorSpiral etc, but if they do change, then ACA is the way to go!

Good Luck

The Killer
05-27-2012, 06:20 PM
btw when posting a script use simba tags. makes it much easier to read.

YoHoJo
05-27-2012, 06:24 PM
E: Wrong thread again.... wtf is wrong with me today... sorry!

spin3x
05-27-2012, 06:42 PM
Im really having a lot of troubling trying to get it all to work, I took your advice and tried to do the ACA, But I get an error.

Code: program new;
begin
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.53);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 10987703, 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 >= 37.24) and (X <= 43.93) and (Y >= 37.62) and (Y <= 44.26) and (Z >= 38.99) and (Z <= 45.77) 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;
end.

Error: [Error] (4:1): Identifier expected at line 3
Compiling failed.

I will most probably get much more errors

Is this the most simplest thing to use?

All I want the scrip to do, is Find the stool, Click on it and just repeat. You get cash from it so you dont need to bank or anything. However I think its around every 60 clicks you get teleported a few squares away from the stall. What would be the easiest method to be able to do this?

YoHoJo
05-27-2012, 07:09 PM
Read my reply to your other thread, keep trying don't give up!

Remove the very first begin in the script, it's not needed.

spin3x
05-27-2012, 07:21 PM
All I want the scrip to do, is Find the stool, Click on it and just repeat. You get cash from it so you dont need to bank or anything. However every 40 clicks you get teleported a few squares away from the stall. What would be the easiest method to be able to do this?

ACA or something else? And can you post a link to the easiest one?