SRL Archive - OSR Help

Compiling Error


koolio718

2012-05-11 17:04:04

Before anything i want to thank Yohojo and Coh3n because i learned a lot from there tuts and especially Kyle Undefined because i copied a lot of his "your first script" tutorial because i understood almost all of it very well thanks to how well he explained everything, and i just changed parts of the script to work with what im doing.

So the problem with my script is that when i compile it says this:
[Hint] C:\Simba\Includes\SRL/SRL/core/animation.simba(257:3): Variable 'X' never used at line 256
[Hint] C:\Simba\Includes\SRL/SRL/core/animation.simba(257:3): Variable 'Y' never used at line 256
[Error] (110:13): Invalid number of parameters at line 109
Compiling failed.

im not so much concerned with the X and Y thing but idk how to fix the parameters one, and im sure the problem is because i copied the part that the error is coming from and use it differently. thanks!

program WheatPicker;
{$DEFINE SMART}
{$i srl/srl.simba}
{$IFDEF SMART}
{$i srl/srl/misc/paintsmart.simba}
{$ENDIF}

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

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

procedure Antiban;
begin
if(not(LoggedIn))then Exit;
begin
case Random(100) of
10: RandomRClick;
30: PickUpMouse;
50: RandomMovement;
70: BoredHuman;
89: ExamineInv;
end;
end;
end;

function FindWheat(var x, y : Integer) : Boolean;
var
a : Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
tmpCTS : Integer;
Box :TBox;
begin
if(not(LoggedIn))then Exit;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.06, 1.07);

FindColorsSpiralTolerance(MSCX, MSCY, TPA, 11119560, MSX1, MSY1, MSX2, MSY2, 9);
SortTPAFrom(TPA, Point(MSCX, MSCY));
ATPA := TPAtoATPAEx(TPA, 15, 15);

for a:= 0 to High(ATPA) do
begin
MP := MiddleTPA(ATPA[a]);
Box := IntToBox((MP.X - 20), (MP.Y - 20), (MP.X + 20), (MP.Y + 20));
{$IFDEF SMART}
SMART_DrawBoxEx(True, Box, clYellow);
{$ENDIF}
MMouse(MP.X, MP.Y, 3, 3);
if(WaitUptext('heat', 400 + Random(350))) then
begin
x := MP.X; y := MP.Y;
Result := True;
{$IFDEF SMART}
SMART_ClearCanvas;
{$ENDIF}
Break;
end
end;

ColorToleranceSpeed(tmpCTS);
SetColorspeed2Modifiers(0.2, 0.2);
end;

procedure PickWheat();
var
x, y : Integer;
Box : TBox;
begin
if(not(LoggedIn)) then Exit;
MakeCompass('N');
Box := IntToBox(MSCX - 10, MSCY - 25, MSCX + 15, MSCY + 15);
repeat
if (not(FindNormalRandoms)) then
begin
if(FindWheat(x, y))then
begin
Wait(RandomRange(100, 200));
Mouse(x, y, 2, 2, mouse_Left);
Wait(RandomRange(100, 300));
while(Animating(Box, 500, 30))do
begin
AntiBan;
Wait(RandomRange(100, 300));
end;
end else
Exit;
end;
until(InvFull or (not FindWheat(x, y)));
end;


begin
SetUpSRL;
ClearDebug;
DeclarePlayers;
LoginPlayer;
AntiBan;
FindWheat;
PickWheat;
end.

NexPB

2012-05-11 17:08:03

Its because instead of FindWheat(x, y); you have just FindWheat;

koolio718

2012-05-11 17:42:07

when i change it to FindWheat(x, y); i get:
[Error] (110:14): Unknown identifier 'x' at line 109
Compiling failed.

YoHoJo

2012-05-11 17:47:16

X and Y need to be actual coordinates, not just X and Y.
I think.

koolio718

2012-05-11 18:10:32

those variables change multiple times idk how or what coords to make them

Sin

2012-05-11 18:13:32

Remove the FindWheat in your main loop And it'll work.

koolio718

2012-05-11 18:27:10

From: Sin
Remove the FindWheat in your main loop And it'll work.

OMFGGG THANK YOU SOO FUCKING MUCH!!!!!!!!!!!!!!!!!!!!!
ahah i totally forgot that function was ment to be run by another one, after i fixed the script and thought about it i understood lol thank you very much!

Sin

2012-05-11 18:28:58

From: koolio718
OMFGGG THANK YOU SOO FUCKING MUCH!!!!!!!!!!!!!!!!!!!!!
ahah i totally forgot that function was ment to be run by another one, after i fixed the script and thought about it i understood lol thank you very much!


^.^