SRL Archive - OSR Help

Anyone willing to show me some pascal?


Nations_collapse

2013-02-25 03:24:10

Having issues with first script.

program new;
{$I SRL/SRL.Simba}
{$I P07Include.Simba}
{$i sps/sps.simba}
Procedure P07_DeclarePlayer;
Begin
P07_PlayerName:='Booyah';
P07_PlayerPass:='444343';
End;

Procedure StatsGuise(wat:String);
begin
Status(wat);
Disguise(wat);
End;

Function ChopDown:Boolean;
Var
cx, cy, PlusOne, TreeCounter: Integer;
begin
PlusOne:= InvCount +1;
cX := MSCX;
cY :=MSCY;
IF P07_FindObj(2704472, 20, 15, ['chop','down'],5)then
begin
StatsGuise('We found the tree');
GetMousePos(cx, cy);

Case Random(2) Of
0:Mouse(cx, cy, 5, 5, True);
1:begin
Mouse(cx, cy, 5, 5, False);
P07_ChooseOptionMulti('Hop','ree'); //WaitOption('Chop', 500);
End;
End;
Repeat
MarkTime(TreeCounter);
Wait(1000);
If InvCount=PlusOne then
WriteLn('We got one');
Until (InvCount=PlusOne) Or (TimeFromMark(TreeCounter) > 7000)
end;
end;

Begin
SetupSRL;
P07_DeclarePlayer;
Repeat
ChopDown;
until(false);
end.
I get this error -
[Error] C:\Users\ElvisB\Desktop\Simba Scripts\test1.simba(34:36): Type mismatch at line 33
Compiling failed.
[Error] C:\Users\ElvisB\Desktop\Simba Scripts\test1.simba(34:42): Invalid number of parameters at line 33
Compiling failed.
[Error] C:\Users\ElvisB\Desktop\Simba Scripts\test1.simba(34:47): Invalid number of parameters at line 33
Compiling failed.
[Error] C:\Users\ElvisB\Desktop\Simba Scripts\test1.simba(34:42): Invalid number of parameters at line 33
Compiling failed.

Le Jingle

2013-02-25 03:32:10

I'm guessing that's the line where you call, 07_FindObj. I think you should add x, y to your variables in that procedure; use those instead of the 20, 15 filled out in the 07_FindObj method call. Then MMouse, getMousePos, and choose the random case of right or left clicking.

Nations_collapse

2013-02-25 04:43:22

From: Le Jingle
I'm guessing that's the line where you call, 07_FindObj. I think you should add x, y to your variables in that procedure; use those instead of the 20, 15 filled out in the 07_FindObj method call. Then MMouse, getMousePos, and choose the random case of right or left clicking.


Its actually the P07_ChooseOptionMulti('Hop','ree'); method.

Le Jingle

2013-02-25 04:55:03

From: Nations_collapse
Its actually the P07_ChooseOptionMulti('Hop','ree'); method.


Err, well, for that error, assuming the Multi is a TSA, placing brackets to allow the argument to shift from 2 strings to 1 TSA should work. Ex. …(['Hop', 'ree'])

Nations_collapse

2013-02-25 07:19:26

I dont think the if P07_GetUpText = ('hop') works correctly. I gave it a test, and it would hover over the color perfectly but it couldnt get past reading the up-text