SRL Archive - OSR Help

why am i getting this error when compiling...


Steingraber

2012-05-25 18:48:12

[Error] C:\Simba\Includes\srl/srl/misc/smart.simba(2:20): 'BEGIN' expected at line 1
Compiling failed.

i put a begin in there and then another error occurs and I keep getting errors that I have no idea what they mean I have only been programing for 1 week and wow I am winging it.

Working on a script for almost 3 days now and fucking get it done and this error comes up idk what to do help… fustrated…

YoHoJo

2012-05-25 18:50:58

Post the code, put it in simba tags.

Runaway

2012-05-25 18:51:39

After all of your global vars, global consts, functions, and procedures you need a main loop.


begin

end. // the final end has a period.

Steingraber

2012-05-25 19:02:31

program WalktoSANDPITYANILLE;
{$include srl/srl/misc/smart.simba}
{$I SRL/SRL.simba}
{$I srl/srl/misc/debug.simba}

procedure DeclarePlayers;
begin



HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Active := True;
Players[0].Pin := '';
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;// declare players
procedure SetupLogin;
begin
ClearDebug;
Smart_Server := 87;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
end;

var
x, y, i: Integer;
Q: Array [0..1] of Integer;//DTM Declaring procedure.

Procedure SetDTM;
begin
Q[0] := DTMFromString('mbQAAAHicY2VgYGADYiEglmKAAGYo3wrKB4lzAHFxXgZDUowsQ22BKUOwnxJDXIg6AzbAiAWDAQBPnQWQ');
Q[1] := DTMFromString('mggAAAHicY2NgYBAAYi0glmKAAA4glgRiMSBWBmI9qLgiELMCcXFeBkNUhCpDnBEbw6kKQYa4cGmG8nxlBlyAEQeGAAD6uwbx');



begin

SetupLogin;
DeclarePlayers;
LoginPlayer;
SetDTM;
if FindDTM(Q[0], x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 3, 3, True);
FFlag(6);
repeat
Wait(50 + Random(25));
until FindDTM(Q[1], x, y, MMX1, MMY1, MMX2, MMY2);
end;
if FindDTM(Q[1], x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 3, 3, True);
FFlag(6);

end;

All I want to do is make the Script walk.. Tell me whats wrong I know there is a lot of mistakes but remember only 1week…

kevin33

2012-05-25 19:06:25

Needs to end with a end. not a end;

YoHoJo

2012-05-25 19:08:03

Procedure SetDTM; has not end for it.

Your need another end. (with a period) at the very bottom of sccript.

Also post scripts in SIMBA tags not Quote tags.
Also make sure you have good standards so your code is nicer/easier to read!

Steingraber

2012-05-25 19:10:27

From: kevin33
Needs to end with a end. not a end;


THanks. but still doesnt answer my problem of why when I try to compile I opens another Tab and tells me I have an error in another Script.

{$DEFINE SRL_SMART};
{$DEFINE SMART}
{.loadlib libsmart}

function IsKeyDown(C:Byte): Boolean;
begin
Result := SmartIsKeyDown(C);
end;

procedure MoveMouse(x, y: Integer);
begin
SmartMoveMouse(x, y);
end;

procedure HoldMouse(x, y: Integer; button : integer);
begin
if button = mouse_left then
SmartHoldMousePlus(x,y,1)
else if button = mouse_middle then
SmartHoldMousePlus(x,y,2)
else if button = mouse_right then
SmartHoldMousePlus(x,y,3)
else
raiseexception(ercustomerror,'Unknown mouse button in SmartHoldMousePlus');
end;

procedure ReleaseMouse(x, y: Integer; button : integer);
begin
if button = mouse_left then
SmartReleaseMousePlus(x,y,1)
else if button = mouse_middle then
SmartReleaseMousePlus(x,y,2)
else if button = mouse_right then
SmartReleaseMousePlus(x,y,3)
else
raiseexception(ercustomerror,'Unknown mouse button in SmartReleaseMousePlus');
end;

procedure KeyUp(key: Byte);
begin
If Key = 13 Then
Key := 10;
SmartReleaseKey(key);
end;

procedure KeyDown(key: Byte);
begin
If Key = 13 Then
Key := 10;
SmartHoldKey(key);
end;

procedure SendKeys(S: String; keywait{$IFNDEF SIMBAMAJOR980}, keymodwait{$ENDIF}: integer);
begin
SmartSendKeys(S);
end;

function FindAndSetTarget(TitlePrefix: String; SetAsTarget: Boolean): Boolean;
var
T : TSysProcArr;
I : Integer;
begin
T := GetProcesses;
for I := High(T) downto 0 do
if Pos(TitlePrefix, T[I].Title) <> 0 then
begin
Result := True;
if SetAsTarget then SetTarget(T[I]);
Exit;
end;
end;

procedure GetRealMousePos(var X, Y : Integer);
var
KMTarget, ITarget : Integer;
begin
KMTarget := GetKeyMouseTarget;
ITarget := GetImageTarget;
FindAndSetTarget('Public SMART', True);
GetTClient.IOManager.GetMousePos(X, Y);
FreeTarget(GetImageTarget);
SetKeyMouseTarget(KMTarget);
SetImageTarget(ITarget);

// These are not universial offsets, but works somewhat for some Windows themes.
X := X - 8;
Y := Y - 25;
end;

procedure GetMousePos(var x, y: Integer);
begin
SmartGetMousePos(x, y);
end;

function IsRealMouseInBox(B : TBox): Boolean;
var
P : TPoint;
begin
GetRealMousePos(P.X, P.Y);
Result := PointInBox(P, B);
end;

function GetColor(x, y: Integer): Integer;
begin
result:= SmartGetColor(x, y);
end;

procedure SmartSetTarget;
begin
SetTargetArray(SmartImageArray, 765,503);
end;

function FindWindow(Title: String): Boolean;
begin
result:= true;
end;

procedure ActivateClient;
begin
end;

function FindWindowBySize(Width, Height: Integer): Boolean;
begin
result:= true;
end;

{procedure SmartSaveSettings(v: TVariantArray);
var
i: Integer;
ts: TStringArray;
begin
ts := ['server', 'members', 'signed', 'sd', 'DC', IncludePath + 'SRL/SRL/misc/smartINI.ini'];
for i := 0 to 4 do
WriteINI('SMART', ts[i], v[i], ts[5]);
end; }

procedure SmartSetupEx(Server: integer; members, signed, superdetail: boolean);
var
prefix: string;
begin
prefix := ReadINI('World' + IntToStr(Server), 'Prefix', IncludePath + 'SRL/SRL/misc/worlds.ini');
if(prefix = '')then
begin
writeln('Invalid world number or corrupted world list. Please review your settings');
TerminateScript;
end;
SmartSetup('http://'+prefix+'.runescape.com/', 'plugin.js?param=o0,a' + IntToStr((Integer(not(Signed)) + 1) * Integer(not((SuperDetail and Signed)))) + ',m' + IntToStr(Integer(Members)), 765, 503, 's');
//SmartSaveSettings([Server, Members, Signed, SuperDetail, SmartGetDC]);
end;

{function SmartLastSettings: TStringArray;
var
i: Integer;
ts: TStringArray;
begin
ts := ['server', 'members', 'signed', 'sd', 'DC', IncludePath + 'SRL/SRL/Misc/smartINI.ini'];
SetLength(Result, 5);
for i := 0 to 4 do
Result[i] := ReadINI('SMART', ts[i], ts[5]);
end; }

This tab opens up when I compile and gives same error.

From: YoHoJo
Procedure SetDTM; has not end for it.

Your need another end. (with a period) at the very bottom of sccript.

Also post scripts in SIMBA tags not Quote tags.
Also make sure you have good standards so your code is nicer/easier to read!


Thanks. Still getting error :(
Is there an easier way to walk I have read literally every guide… I can't figure out walking…

kevin33

2012-05-25 19:14:53

Semi colon after the very top $DEFINE
{$DEFINE SRL_SMART};
No semi colon and try that.

Steingraber

2012-05-25 19:17:36

From: kevin33
Semi colon after the very top $DEFINE
{$DEFINE SRL_SMART};
No semi colon and try that.


THANKS YOU SO MUCH!!! No more error!!!

kevin33

2012-05-25 19:18:34

Lo your welcome. Happy to help. If you ever have any problems feel free to PM me or make a thread about it. You can be sure I will at least read it :)

Oh and dont compile that second tab. Compile your first tab and be sure to save both to prevent the problem in the future.