SRL Archive - Help

What is a variable?


tiggerred

2012-12-25 16:15:16

Okay So This Is My Code
program MoneyMaker;

procedure ClickGuy;
var
x, y: Integer;
begin
if (FindColorSpiralTolerance(224, 76, 10272165, 0, 0,0 ,500,10)) then
ClickMouse(224, 76, mouse_Right);
end;
begin
ClickGuy;
end.

procedure BuyRings;
begin
MoveMouse(332, 294);
ClickMouse(332, 294, mouse_Left);
ReleaseMouse(332, 294);
MoveMouse(334, 324);
ClickMouse(334, 324);
ReleaseMouse(334,324);
MoveMouse(459, 60);
ClickMouse(459, 60);
ReleaseMouse(459, 600);
end.

procedure findtriballweponseller;
begin
if (FindColorSpiralTolerance (127, 333, 2512751, 0, 0,0 ,500,10);
ClickMouse(127, 333, mouse_right);
And this is my error
[Error] C:\Simba\Scripts\Ring Buying and Seller.simba(8:32): Variable Expected at line 7
Compiling failed.

What is a variable might be a nub question, but I am a nub.

J J

2012-12-25 16:32:36

You are declaring variables here
var
x, y: Integer;
Wikipedia: http://en.wikipedia.org/wiki/Variable_%28computer_science%29
An easy way to explain a variable would be something you can store one or more values in.

Your problem is here:
 if FindColorSpiralTolerance(224, 76, 10272165, 0, 0, 0 , 500, 10) then 
It is asking for two Integer variables

You need to put in X on the spot of 224 and Y on the spot of 76. The result will get stored in X & Y.

tiggerred

2012-12-25 16:47:36

From: J J
You are declaring variables here
var
x, y: Integer;
Wikipedia: http://en.wikipedia.org/wiki/Variable_%28computer_science%29
An easy way to explain a variable would be something you can store one or more values in.

Your problem is here:
 if FindColorSpiralTolerance(224, 76, 10272165, 0, 0, 0 , 500, 10) then 
It is asking for two Integer variables

You need to put in X on the spot of 224 and Y on the spot of 76. The result will get stored in X & Y.


if (FindColorSpiralTolerance(X, Y, 10272165, 0, 0,0 ,500,10)) then 
Exception: Range check error at line 7

Gucci

2012-12-25 17:21:12

From: tiggerred
if (FindColorSpiralTolerance(X, Y, 10272165, 0, 0,0 ,500,10)) then 
Exception: Range check error at line 7


Compiles fine if you replace those as J J said.

This should be at the very end of the script:

begin
ClickGuy;
end.

tiggerred

2012-12-25 17:50:20

From: Gucci
Compiles fine if you replace those as J J said.

This should be at the very end of the script:

begin
ClickGuy;
end.


Now everytime i do something i get this error
Unexpected end of file at line 16
Compiling failed.
program MoneyMaker;

procedure ClickGuy;
var
x, y: Integer;
begin
if (FindColorSpiralTolerance(x, y, 10272165 , 111, 4, 241, 89, 10)) or
(FindColorSpiralTolerance(x, y, 9217174 , 111, 4, 241, 89, 10)) or
(FindColorSpiralTolerance(x, y, 9085588 , 111, 4, 241, 89, 10)) or
(FindColorSpiralTolerance(x, y, 10403495 , 111, 4, 241, 89, 10)) Then
Begin
MoveMouse(x, y)
ClickMouse(x, y, 1)
End;
end;

Gucci

2012-12-25 17:59:44

From: tiggerred
Now everytime i do something i get this error
Unexpected end of file at line 16
Compiling failed.
program MoneyMaker;

procedure ClickGuy;
var
x, y: Integer;
begin
if (FindColorSpiralTolerance(x, y, 10272165 , 111, 4, 241, 89, 10)) or
(FindColorSpiralTolerance(x, y, 9217174 , 111, 4, 241, 89, 10)) or
(FindColorSpiralTolerance(x, y, 9085588 , 111, 4, 241, 89, 10)) or
(FindColorSpiralTolerance(x, y, 10403495 , 111, 4, 241, 89, 10)) Then
Begin
MoveMouse(x, y)
ClickMouse(x, y, 1)
End;
end;


Problem is your missing the mainloop.

program MoneyMaker;

procedure ClickGuy;
var
x, y: Integer;
begin
if (FindColorSpiralTolerance(x, y, 10272165 , 111, 4, 241, 89, 10)) or
(FindColorSpiralTolerance(x, y, 9217174 , 111, 4, 241, 89, 10)) or
(FindColorSpiralTolerance(x, y, 9085588 , 111, 4, 241, 89, 10)) or
(FindColorSpiralTolerance(x, y, 10403495 , 111, 4, 241, 89, 10)) Then
Begin
MoveMouse(x, y)
ClickMouse(x, y, 1)
End;
end;

begin //This
ClickGuy;
end. // And this