SRL Archive - OSR Help

Identifier expected


cradlefatal

2013-02-27 13:29:29

okay I am having trouble with my pathwalking I have my variables and constants at the top and I keep getting this


[Error] C:\Simba\Scripts\dragonkiller.simba(27:1): Identifier expected at line 26
Compiling failed.



this is what I have so far

program DragonKiller;
{$DEFINE SMART8}
{$i SRL\SRL.simba}
{$i SPS/sps.simba}







var
x,y,kills,z,count,count2,t,waitTime,CurrentHp,TotalHp :Integer;
todragons: tpointarray;
ColorString : String;
Skills :Array of String;
FightMode,EatAt:Array of Integer;
Xp :Array of Array [0..1] of Array [0..3] of Integer;
{delcare the sps variable}





const
begin
todragons: =[(RUNESCAPE_SURFACE,['8_7', '0_0', '1_1' )];
todragons: =[Point(3297, 2931), Point(3305, 2929), Point(3316, 2928),
Point(3324, 2930), Point(3330, 2934), Point(3336, 2938),
Point(3341, 2942), Point(3347, 2944), Point(3355, 2945),
Point(3363, 2946), Point(3372, 2946), Point(3380, 2942),
Point(3392, 2944), Point(3400, 2943), Point(3406, 2951),
Point(3406, 2959), Point(3406, 2969), Point(3400, 2972),
Point(3390, 2978), Point(3376, 2983), Point(3364, 2983),
Point(3354, 2987), Point(3347, 2994), Point(3337, 3001),
Point(3333, 3009), Point(3248, 3011), Point(3248, 2889),
Point(3425, 2885), Point(3421, 2996), Point(3340, 3008),
Point(3393, 2976), Point(3328, 3005), Point(326, 321),
Point(326, 312), Point(326, 305), Point(327, 296),
Point(330, 280), Point(328, 266), Point(328, 255),
Point(329, 242), Point(330, 230), Point(330, 215),
Point(329, 201), Point(330, 190), Point(330, 177),
Point(330, 157), Point(335, 143), Point(344, 128),
Point(355, 118), Point(374, 110), Point(390, 112),
Point(411, 113), Point(427, 113), Point(452, 113),
Point(464, 114), Point(478, 119), Point(490, 130),
Point(501, 141), Point(509, 146), Point(519, 158),
Point(525, 172), Point(540, 182), Point(540, 198),
Point(540, 208), Point(545, 222), Point(543, 239),
Point(545, 256), Point(548, 267), Point(550, 280),
Point(556, 294), Point(565, 305), Point(569, 316),
Point(576, 326), Point(584, 328), Point(597, 331),
Point(600, 342), Point(600, 351), Point(600, 359),
Point(600, 368), Point(601, 380), Point(602, 400),
Point(597, 410), Point(564, 408), Point(545, 402),
Point(533, 407), Point(531, 418), Point(531, 426),
Point(531, 434), Point(531, 444), Point(531, 458),
Point(531, 467), Point(527, 480), Point(518, 485),
Point(505, 491), Point(488, 490), Point(481, 473),
Point(490, 457), Point(495, 438), Point(503, 427),
Point(512, 418), Point(515, 388), Point(525, 370),
Point(527, 356), Point(522, 339), Point(522, 323),
Point(513, 309), Point(499, 300), Point(492, 299),
Point(475, 297), Point(459, 300), Point(440, 300),
Point(427, 300), Point(412, 300)];
todragons;
end.


procedure DeclarePlayers;
begin
HowManyPlayers := 1; // This is set to the total amount of players (more on multiplayer later ;)), for now, just keep it set as 1
NumberOfPlayers(HowManyPlayers); // This is a procedure in SRL which sets up player arrays (also, more on that later), this will always be the same
CurrentPlayer := 0; // This is the player to start with; the first player will always be 0 (you'll find out when you learn all about arrays)
SetLength(Xp,HowManyPlayers);
SetLength(FightMode,HowManyPlayers);
SetLength(PercentEat,HowManyPlayers);

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
FightMode[0] := 4; // 1 Attack 2 Strength 3 Controlled 4 Defence
// 0 if using your own preset Ex. range or magic
PercentEat[0] := 25; // Percentage to Eat at whole numbers only
//(Health to eat at divided by total health multiplied by 100)
end;




procedure todragons;
begin
todragons := [Point(3297, 2931), Point(3305, 2929), Point(3316, 2928),
Point(3324, 2930), Point(3330, 2934), Point(3336, 2938),
Point(3341, 2942), Point(3347, 2944), Point(3355, 2945),
Point(3363, 2946), Point(3372, 2946), Point(3380, 2942),
Point(3392, 2944), Point(3400, 2943), Point(3406, 2951),
Point(3406, 2959), Point(3406, 2969), Point(3400, 2972),
Point(3390, 2978), Point(3376, 2983), Point(3364, 2983),
Point(3354, 2987), Point(3347, 2994), Point(3337, 3001),
Point(3333, 3009), Point(3248, 3011), Point(3248, 2889),
Point(3425, 2885), Point(3421, 2996), Point(3340, 3008),
Point(326, 321), Point(326, 312), Point(326, 305),
Point(327, 296), Point(330, 280), Point(328, 266),
Point(328, 255), Point(329, 242), Point(330, 230), Point(330, 215),
Point(329, 201), Point(330, 190), Point(330, 177),
Point(330, 157), Point(335, 143), Point(344, 128),
Point(355, 118), Point(374, 110), Point(390, 112),
Point(411, 113), Point(427, 113), Point(452, 113),
Point(464, 114), Point(478, 119), Point(490, 130),
Point(501, 141), Point(509, 146), Point(519, 158),
Point(525, 172), Point(540, 182), Point(540, 198),
Point(540, 208), Point(545, 222), Point(543, 239),
Point(545, 256), Point(548, 267), Point(550, 280),
Point(556, 294), Point(565, 305), Point(569, 316),
Point(576, 326), Point(584, 328), Point(597, 331),
Point(600, 342), Point(600, 351), Point(600, 359),
Point(600, 368), Point(601, 380), Point(602, 400),
Point(597, 410), Point(564, 408), Point(545, 402),
Point(533, 407), Point(531, 418), Point(531, 426),
Point(531, 434), Point(531, 444), Point(531, 458),
Point(531, 467), Point(527, 480), Point(518, 485),
Point(505, 491), Point(488, 490), Point(481, 473),
Point(490, 457), Point(495, 438), Point(503, 427),
Point(512, 418), Point(515, 388), Point(525, 370),
Point(527, 356), Point(522, 339), Point(522, 323),
Point(513, 309), Point(499, 300), Point(492, 299),
Point(475, 297), Point(459, 300), Point(440, 300),
Point(427, 300), Point(412, 300)];
end;
procedure todragon;
var
status: string;
begin
if todragons then
status := 'walking to the dragons'
else begin
status :='failed walking to the dragons';
writeln(status + ' + time running:' +timerunning);
writeln(status + ' + time running:' +timerunning);
end;
end;
end;



Procedure Main ();
Begin
if not(FightMode[CurrentPlayer] = 0) then
SetFightMode (FightMode[CurrentPlayer]);
for count := 0 to 3 do
Begin
Xp[CurrentPlayer][0][count]:= getXP (Skills[count]);
Xp[CurrentPlayer][1][count]:=Xp[CurrentPlayer][0][count];
End;
Marktime(T);
repeat
RunEnergy(25);
TotalHp:= Max(1, GetSkillInfo('hitpoints', False))*10;
if FindObjCustom(x,y,['ttack','Blu', 'Att', 'lue'],[8410698, 4473370, 4401698, 3354644, 3618325, 3218712, 4012317, 3350297, 9670715, 3218712, 10511185,4275482], 2) then
Begin
ClickMouse2(True);
markTime (t);
repeat
Wait(5);
if (TimeFromMark(t) >= 5000) then Break;
until (not FlagPresent) and srl_InFight;
if (srl_Infight) then
begin
Marktime(T);
waitTime := 1000+RandomRange(300,600);
repeat
wait (100+random (200));
AntiBAM;
CurrentHp:= GetMMLevels('hp', ColorString);
if (z>200) then begin
writeln('Hp: '+ToStr(CurrentHp)+' / '+ToStr(TotalHp));
writeln ('Hp: %'+ToStr(CurrentHp*100/TotalHp));
for count := 0 to 3 do
Begin
Xp[CurrentPlayer][1][count]:= getXP (Skills[count]);
End;
z:=0;
end;
Eat(Round(CurrentHp*100/TotalHp),PercentEat[CurrentPlayer]);
z:= z+1;
If srl_InFight Then Marktime(T);
until (TimeFromMark(T) >= waitTime)
Marktime(T)
Kills := Kills +1;
Proggy;
End;
End;
until (not LoggedIn or (TimeFromMark(T) > 80000))
Players[CurrentPlayer].Active := False;
LogOut;
if not(CurrentPlayer+1 = HowManyPlayers) then
CurrentPlayer := CurrentPlayer + 1;
End;










// SpiralOut: Basic Antiban Mouse Spiral
Procedure SpiralOut ();
var
z,x,y, endpoint : Integer;
begin
z := 0;
endpoint := randomRange (50,150);
repeat
x := Round(z*Cos(0.5*z)+260);
y := Round(z*Sin(0.5*z)+224);
z := z + 1;
MMouse (x,y,20,20);
until (z >= endpoint)
end;


// Basic Antiban, exmain inventory, Spiral Mouse, Check Level, and Reset View
Procedure AntiBAM ();
begin
FindNormalRandoms;
case random(1000) of
25: examineInv;
30: SpiralOut;
50: begin gameTab (23);
LevelUpEX(False,True);
hoverSkill (Skills[Random(1)],false);
gameTab(25);
wait (100+Random(random(500))) end;
70: MMouse (365, 275,100,100);
99: ClickNorth(0);
end;
end;
Function Eat(HPP, PercentEat:Integer): Boolean;
var
I: Integer;
begin
Result := False;
If Not LoggedIn then Exit;
if (HPP < PercentEat) then
for i := 1 to 28 do
begin
if (ExistsItem(i)) then
begin
InvMouse(I, 3);
if IsUpText('Eat') then
begin
ClickMouse2(True);
Wait(RandomRange(350, 525));
Result := True;
Exit;
end;
end else
if (i = 28) then
Logout;
end;
end;
Procedure Proggy;
Begin
ClearDebug;
writeln('----------------------------------------------------------------');
For count2 := 0 to CurrentPlayer do
Begin
writeln(Players[count2].Name+' has gained the following xp');
for count := 0 to 3 do
begin
if not(Xp[count2][1][count]-Xp[count2][0][count] = 0) then
writeln (Skills[count]+' gained ~ '+ToStr (Xp[count2][1][count]-Xp[count2][0][count])+' XP');
end;
End;
writeln ('You have killed '+ToStr(Kills)+'Blue dragon');
writeln (Players[CurrentPlayer].Name+' has '+ToStr(InvCount)+' Pieces of Food Left');
writeln('----------------------------------------------------------------');
End;




begin
activateClient;
SetupSRL;
DeclarePlayers;
LoginPlayer;
ClickNorth(0);
todragon;
Kills := 0;
//{Mistake I see a lot only call the map once, Not in the procedure}
//{If using multiple accounts it will always give an error when trying to pull the map}
repeat
Main;
until (AllPlayersInactive)
end.

Jake

2013-02-27 13:33:45

Identifier expected at line 26

You're missing something/have something not needed on line 26

Can you point out where line 26 is?

cradlefatal

2013-02-27 13:35:53

but I have a procedure for it line 26 starts at begin

begin
todragons: =[(RUNESCAPE_SURFACE,['8_7', '0_0', '1_1' )];
todragons: =[Point(3297, 2931), Point(3305, 2929), Point(3316, 2928),
Point(3324, 2930), Point(3330, 2934), Point(3336, 2938),
Point(3341, 2942), Point(3347, 2944), Point(3355, 2945),
Point(3363, 2946), Point(3372, 2946), Point(3380, 2942),
Point(3392, 2944), Point(3400, 2943), Point(3406, 2951),
Point(3406, 2959), Point(3406, 2969), Point(3400, 2972),
Point(3390, 2978), Point(3376, 2983), Point(3364, 2983),
Point(3354, 2987), Point(3347, 2994), Point(3337, 3001),
Point(3333, 3009), Point(3248, 3011), Point(3248, 2889),
Point(3425, 2885), Point(3421, 2996), Point(3340, 3008),
Point(3393, 2976), Point(3328, 3005), Point(326, 321),
Point(326, 312), Point(326, 305), Point(327, 296),
Point(330, 280), Point(328, 266), Point(328, 255),
Point(329, 242), Point(330, 230), Point(330, 215),
Point(329, 201), Point(330, 190), Point(330, 177),
Point(330, 157), Point(335, 143), Point(344, 128),
Point(355, 118), Point(374, 110), Point(390, 112),
Point(411, 113), Point(427, 113), Point(452, 113),
Point(464, 114), Point(478, 119), Point(490, 130),
Point(501, 141), Point(509, 146), Point(519, 158),
Point(525, 172), Point(540, 182), Point(540, 198),
Point(540, 208), Point(545, 222), Point(543, 239),
Point(545, 256), Point(548, 267), Point(550, 280),
Point(556, 294), Point(565, 305), Point(569, 316),
Point(576, 326), Point(584, 328), Point(597, 331),
Point(600, 342), Point(600, 351), Point(600, 359),
Point(600, 368), Point(601, 380), Point(602, 400),
Point(597, 410), Point(564, 408), Point(545, 402),
Point(533, 407), Point(531, 418), Point(531, 426),
Point(531, 434), Point(531, 444), Point(531, 458),
Point(531, 467), Point(527, 480), Point(518, 485),
Point(505, 491), Point(488, 490), Point(481, 473),
Point(490, 457), Point(495, 438), Point(503, 427),
Point(512, 418), Point(515, 388), Point(525, 370),
Point(527, 356), Point(522, 339), Point(522, 323),
Point(513, 309), Point(499, 300), Point(492, 299),
Point(475, 297), Point(459, 300), Point(440, 300),
Point(427, 300), Point(412, 300)];
todragons;
end.

Kevin

2013-02-27 13:37:04



const
begin
todragons: =[(RUNESCAPE_SURFACE,['8_7', '0_0', '1_1' )];
todragons: =[Point(3297, 2931), Point(3305, 2929), Point(3316, 2928),
Point(3324, 2930), Point(3330, 2934), Point(3336, 2938),
Point(3341, 2942), Point(3347, 2944), Point(3355, 2945),
Point(3363, 2946), Point(3372, 2946), Point(3380, 2942),
Point(3392, 2944), Point(3400, 2943), Point(3406, 2951),
Point(3406, 2959), Point(3406, 2969), Point(3400, 2972),
Point(3390, 2978), Point(3376, 2983), Point(3364, 2983),
Point(3354, 2987), Point(3347, 2994), Point(3337, 3001),
Point(3333, 3009), Point(3248, 3011), Point(3248, 2889),
Point(3425, 2885), Point(3421, 2996), Point(3340, 3008),
Point(3393, 2976), Point(3328, 3005), Point(326, 321),
Point(326, 312), Point(326, 305), Point(327, 296),
Point(330, 280), Point(328, 266), Point(328, 255),
Point(329, 242), Point(330, 230), Point(330, 215),
Point(329, 201), Point(330, 190), Point(330, 177),
Point(330, 157), Point(335, 143), Point(344, 128),
Point(355, 118), Point(374, 110), Point(390, 112),
Point(411, 113), Point(427, 113), Point(452, 113),
Point(464, 114), Point(478, 119), Point(490, 130),
Point(501, 141), Point(509, 146), Point(519, 158),
Point(525, 172), Point(540, 182), Point(540, 198),
Point(540, 208), Point(545, 222), Point(543, 239),
Point(545, 256), Point(548, 267), Point(550, 280),
Point(556, 294), Point(565, 305), Point(569, 316),
Point(576, 326), Point(584, 328), Point(597, 331),
Point(600, 342), Point(600, 351), Point(600, 359),
Point(600, 368), Point(601, 380), Point(602, 400),
Point(597, 410), Point(564, 408), Point(545, 402),
Point(533, 407), Point(531, 418), Point(531, 426),
Point(531, 434), Point(531, 444), Point(531, 458),
Point(531, 467), Point(527, 480), Point(518, 485),
Point(505, 491), Point(488, 490), Point(481, 473),
Point(490, 457), Point(495, 438), Point(503, 427),
Point(512, 418), Point(515, 388), Point(525, 370),
Point(527, 356), Point(522, 339), Point(522, 323),
Point(513, 309), Point(499, 300), Point(492, 299),
Point(475, 297), Point(459, 300), Point(440, 300),
Point(427, 300), Point(412, 300)];
todragons;
end.
is your problem. You don't need to put constants in between a begin…end statement. AND this begin…end has a "." after the end, which signifies that section as the "main loop" which is where the program initializes it's run. All other begin…end statements should end with a ";" anyway like you seem to normally do.

You also have a lot of instances where you call methods (such as your ANTIBAM and Eat) prior to them being declared. That will cause later issues as Pascalscript can't determine what methods exist, unless they are declared BEFORE they are used.

Edit: Also, you can't name your procedures the same as your variables, and you shouldn't call your procedures recursively (within itself) unless you have some manner of exiting it, otherwise it will simply be an infinite loop.

cradlefatal

2013-02-27 13:41:18

when I do that I get a duplicate identifier at todragons: =[(RUNESCAPE_SURFACE,['8_7', '0_0', '1_1' )]; and thats where I've been stuck at it should look like this right


[simba]

const
todragons: =[(RUNESCAPE_SURFACE,['8_7', '0_0', '1_1' )];
todragons: =[Point(3297, 2931), Point(3305, 2929), Point(3316, 2928),
Point(3324, 2930), Point(3330, 2934), Point(3336, 2938),
Point(3341, 2942), Point(3347, 2944), Point(3355, 2945),
Point(3363, 2946), Point(3372, 2946), Point(3380, 2942),
Point(3392, 2944), Point(3400, 2943), Point(3406, 2951),
Point(3406, 2959), Point(3406, 2969), Point(3400, 2972),
Point(3390, 2978), Point(3376, 2983), Point(3364, 2983),
Point(3354, 2987), Point(3347, 2994), Point(3337, 3001),
Point(3333, 3009), Point(3248, 3011), Point(3248, 2889),
Point(3425, 2885), Point(3421, 2996), Point(3340, 3008),
Point(3393, 2976), Point(3328, 3005), Point(326, 321),
Point(326, 312), Point(326, 305), Point(327, 296),
Point(330, 280), Point(328, 266), Point(328, 255),
Point(329, 242), Point(330, 230), Point(330, 215),
Point(329, 201), Point(330, 190), Point(330, 177),
Point(330, 157), Point(335, 143), Point(344, 128),
Point(355, 118), Point(374, 110), Point(390, 112),
Point(411, 113), Point(427, 113), Point(452, 113),
Point(464, 114), Point(478, 119), Point(490, 130),
Point(501, 141), Point(509, 146), Point(519, 158),
Point(525, 172), Point(540, 182), Point(540, 198),
Point(540, 208), Point(545, 222), Point(543, 239),
Point(545, 256), Point(548, 267), Point(550, 280),
Point(556, 294), Point(565, 305), Point(569, 316),
Point(576, 326), Point(584, 328), Point(597, 331),
Point(600, 342), Point(600, 351), Point(600, 359),
Point(600, 368), Point(601, 380), Point(602, 400),
Point(597, 410), Point(564, 408), Point(545, 402),
Point(533, 407), Point(531, 418), Point(531, 426),
Point(531, 434), Point(531, 444), Point(531, 458),
Point(531, 467), Point(527, 480), Point(518, 485),
Point(505, 491), Point(488, 490), Point(481, 473),
Point(490, 457), Point(495, 438), Point(503, 427),
Point(512, 418), Point(515, 388), Point(525, 370),
Point(527, 356), Point(522, 339), Point(522, 323),
Point(513, 309), Point(499, 300), Point(492, 299),
Point(475, 297), Point(459, 300), Point(440, 300),
Point(427, 300), Point(412, 300)];
todragons;

Kevin

2013-02-27 13:47:19

That was part of my edit to my post, you are using the same name to do multiple things. "todragons" is your path variable as well as your procedure you're using to fill it, you can't do that. They need to be different names.

Also,

todragons: =[(RUNESCAPE_SURFACE,['8_7', '0_0', '1_1' )];
is incorrect. You need to do
SPS_Setup(RUNESCAPE_SURFACE, ['8_7', '0_0', '1_1']);
to setup the map, and the following todragon:= will be the path you will call to follow it later.

And even still, you can't declare them as a "const" as you already declared it as a "var".

cradlefatal

2013-02-27 13:53:07

how did I declare it as a var?

cradlefatal

2013-02-27 13:59:24

my bad I caught onto that now I got my script looking like this and I'm getting an unknown type starting at ColorString


program DragonKiller;
{$DEFINE SMART8}
{$i SRL\SRL.simba}
{$i SPS/sps.simba}







var
x,y,kills,z,count,count2,t,waitTime,CurrentHp,TotalHp :Integer;
tpointarray:
ColorString: String;
Skills :Array of String;
FightMode,EatAt:Array of Integer;
Xp :Array of Array [0..1] of Array [0..3] of Integer;
{delcare the sps variable}




const


SPS_Setup: =[(RUNESCAPE_SURFACE,['8_7', '0_0', '1_1']);
todragons: =[Point(3297, 2931), Point(3305, 2929), Point(3316, 2928),
Point(3324, 2930), Point(3330, 2934), Point(3336, 2938),
Point(3341, 2942), Point(3347, 2944), Point(3355, 2945),
Point(3363, 2946), Point(3372, 2946), Point(3380, 2942),
Point(3392, 2944), Point(3400, 2943), Point(3406, 2951),
Point(3406, 2959), Point(3406, 2969), Point(3400, 2972),
Point(3390, 2978), Point(3376, 2983), Point(3364, 2983),
Point(3354, 2987), Point(3347, 2994), Point(3337, 3001),
Point(3333, 3009), Point(3248, 3011), Point(3248, 2889),
Point(3425, 2885), Point(3421, 2996), Point(3340, 3008),
Point(3393, 2976), Point(3328, 3005), Point(326, 321),
Point(326, 312), Point(326, 305), Point(327, 296),
Point(330, 280), Point(328, 266), Point(328, 255),
Point(329, 242), Point(330, 230), Point(330, 215),
Point(329, 201), Point(330, 190), Point(330, 177),
Point(330, 157), Point(335, 143), Point(344, 128),
Point(355, 118), Point(374, 110), Point(390, 112),
Point(411, 113), Point(427, 113), Point(452, 113),
Point(464, 114), Point(478, 119), Point(490, 130),
Point(501, 141), Point(509, 146), Point(519, 158),
Point(525, 172), Point(540, 182), Point(540, 198),
Point(540, 208), Point(545, 222), Point(543, 239),
Point(545, 256), Point(548, 267), Point(550, 280),
Point(556, 294), Point(565, 305), Point(569, 316),
Point(576, 326), Point(584, 328), Point(597, 331),
Point(600, 342), Point(600, 351), Point(600, 359),
Point(600, 368), Point(601, 380), Point(602, 400),
Point(597, 410), Point(564, 408), Point(545, 402),
Point(533, 407), Point(531, 418), Point(531, 426),
Point(531, 434), Point(531, 444), Point(531, 458),
Point(531, 467), Point(527, 480), Point(518, 485),
Point(505, 491), Point(488, 490), Point(481, 473),
Point(490, 457), Point(495, 438), Point(503, 427),
Point(512, 418), Point(515, 388), Point(525, 370),
Point(527, 356), Point(522, 339), Point(522, 323),
Point(513, 309), Point(499, 300), Point(492, 299),
Point(475, 297), Point(459, 300), Point(440, 300),
Point(427, 300), Point(412, 300)];
todragons;

Kevin

2013-02-27 14:17:29


var
x,y,kills,z,count,count2,t,waitTime,CurrentHp,TotalHp :Integer;
tpointarray:
ColorString: String;
Your issue lies before ColorString due to an unfinished line, can you see it?

cradlefatal

2013-02-27 14:50:55

yeah I found that tpointarry and now I'm getting an Identifier expected this is what the script looks like now and sorry i've only been doing this for about 2 or 3 days and its hard but its cool when u finally get it to do something

[Error] C:\Simba\Scripts\dragonkiller.simba(27:11): Identifier expected at line 26
Compiling failed.

program DragonKiller;
{$DEFINE SMART8}
{$i SRL\SRL.simba}
{$i SPS/sps.simba}







var
x,y,kills,z,count,count2,t,waitTime,CurrentHp,TotalHp :Integer;
todragons: tpointarray;
ColorString: String;
Skills :Array of String;
FightMode,EatAt:Array of Integer;
Xp :Array of Array [0..1] of Array [0..3] of Integer;
//delcare the sps variable






todragon: =[(RUNESCAPE_SURFACE,['8_7', '0_0', '1_1']);
todragons: =[Point(3297, 2931), Point(3305, 2929), Point(3316, 2928),
Point(3324, 2930), Point(3330, 2934), Point(3336, 2938),
Point(3341, 2942), Point(3347, 2944), Point(3355, 2945),
Point(3363, 2946), Point(3372, 2946), Point(3380, 2942),
Point(3392, 2944), Point(3400, 2943), Point(3406, 2951),
Point(3406, 2959), Point(3406, 2969), Point(3400, 2972),
Point(3390, 2978), Point(3376, 2983), Point(3364, 2983),
Point(3354, 2987), Point(3347, 2994), Point(3337, 3001),
Point(3333, 3009), Point(3248, 3011), Point(3248, 2889),
Point(3425, 2885), Point(3421, 2996), Point(3340, 3008),
Point(3393, 2976), Point(3328, 3005), Point(326, 321),
Point(326, 312), Point(326, 305), Point(327, 296),
Point(330, 280), Point(328, 266), Point(328, 255),
Point(329, 242), Point(330, 230), Point(330, 215),
Point(329, 201), Point(330, 190), Point(330, 177),
Point(330, 157), Point(335, 143), Point(344, 128),
Point(355, 118), Point(374, 110), Point(390, 112),
Point(411, 113), Point(427, 113), Point(452, 113),
Point(464, 114), Point(478, 119), Point(490, 130),
Point(501, 141), Point(509, 146), Point(519, 158),
Point(525, 172), Point(540, 182), Point(540, 198),
Point(540, 208), Point(545, 222), Point(543, 239),
Point(545, 256), Point(548, 267), Point(550, 280),
Point(556, 294), Point(565, 305), Point(569, 316),
Point(576, 326), Point(584, 328), Point(597, 331),
Point(600, 342), Point(600, 351), Point(600, 359),
Point(600, 368), Point(601, 380), Point(602, 400),
Point(597, 410), Point(564, 408), Point(545, 402),
Point(533, 407), Point(531, 418), Point(531, 426),
Point(531, 434), Point(531, 444), Point(531, 458),
Point(531, 467), Point(527, 480), Point(518, 485),
Point(505, 491), Point(488, 490), Point(481, 473),
Point(490, 457), Point(495, 438), Point(503, 427),
Point(512, 418), Point(515, 388), Point(525, 370),
Point(527, 356), Point(522, 339), Point(522, 323),
Point(513, 309), Point(499, 300), Point(492, 299),
Point(475, 297), Point(459, 300), Point(440, 300),
Point(427, 300), Point(412, 300)];
todragons;



procedure DeclarePlayers;
begin
HowManyPlayers := 1; // This is set to the total amount of players (more on multiplayer later ;)), for now, just keep it set as 1
NumberOfPlayers(HowManyPlayers); // This is a procedure in SRL which sets up player arrays (also, more on that later), this will always be the same
CurrentPlayer := 0; // This is the player to start with; the first player will always be 0 (you'll find out when you learn all about arrays)
SetLength(Xp,HowManyPlayers);
SetLength(FightMode,HowManyPlayers);
SetLength(PercentEat,HowManyPlayers);

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
FightMode[0] := 4; // 1 Attack 2 Strength 3 Controlled 4 Defence
// 0 if using your own preset Ex. range or magic
PercentEat[0] := 25; // Percentage to Eat at whole numbers only
//(Health to eat at divided by total health multiplied by 100)
end;




procedure todragons;
begin
todragons := [Point(3297, 2931), Point(3305, 2929), Point(3316, 2928),
Point(3324, 2930), Point(3330, 2934), Point(3336, 2938),
Point(3341, 2942), Point(3347, 2944), Point(3355, 2945),
Point(3363, 2946), Point(3372, 2946), Point(3380, 2942),
Point(3392, 2944), Point(3400, 2943), Point(3406, 2951),
Point(3406, 2959), Point(3406, 2969), Point(3400, 2972),
Point(3390, 2978), Point(3376, 2983), Point(3364, 2983),
Point(3354, 2987), Point(3347, 2994), Point(3337, 3001),
Point(3333, 3009), Point(3248, 3011), Point(3248, 2889),
Point(3425, 2885), Point(3421, 2996), Point(3340, 3008),
Point(326, 321), Point(326, 312), Point(326, 305),
Point(327, 296), Point(330, 280), Point(328, 266),
Point(328, 255), Point(329, 242), Point(330, 230), Point(330, 215),
Point(329, 201), Point(330, 190), Point(330, 177),
Point(330, 157), Point(335, 143), Point(344, 128),
Point(355, 118), Point(374, 110), Point(390, 112),
Point(411, 113), Point(427, 113), Point(452, 113),
Point(464, 114), Point(478, 119), Point(490, 130),
Point(501, 141), Point(509, 146), Point(519, 158),
Point(525, 172), Point(540, 182), Point(540, 198),
Point(540, 208), Point(545, 222), Point(543, 239),
Point(545, 256), Point(548, 267), Point(550, 280),
Point(556, 294), Point(565, 305), Point(569, 316),
Point(576, 326), Point(584, 328), Point(597, 331),
Point(600, 342), Point(600, 351), Point(600, 359),
Point(600, 368), Point(601, 380), Point(602, 400),
Point(597, 410), Point(564, 408), Point(545, 402),
Point(533, 407), Point(531, 418), Point(531, 426),
Point(531, 434), Point(531, 444), Point(531, 458),
Point(531, 467), Point(527, 480), Point(518, 485),
Point(505, 491), Point(488, 490), Point(481, 473),
Point(490, 457), Point(495, 438), Point(503, 427),
Point(512, 418), Point(515, 388), Point(525, 370),
Point(527, 356), Point(522, 339), Point(522, 323),
Point(513, 309), Point(499, 300), Point(492, 299),
Point(475, 297), Point(459, 300), Point(440, 300),
Point(427, 300), Point(412, 300)];
end;
procedure todragon;
var
status: string;
begin
if todragons then
status := 'walking to the dragons'
else begin
status :='failed walking to the dragons';
writeln(status + ' + time running:' +timerunning);
writeln(status + ' + time running:' +timerunning);
end;
end;
end;



Procedure Main ();
Begin
if not(FightMode[CurrentPlayer] = 0) then
SetFightMode (FightMode[CurrentPlayer]);
for count := 0 to 3 do
Begin
Xp[CurrentPlayer][0][count]:= getXP (Skills[count]);
Xp[CurrentPlayer][1][count]:=Xp[CurrentPlayer][0][count];
End;
Marktime(T);
repeat
RunEnergy(25);
TotalHp:= Max(1, GetSkillInfo('hitpoints', False))*10;
if FindObjCustom(x,y,['ttack','Blu', 'Att', 'lue'],[8410698, 4473370, 4401698, 3354644, 3618325, 3218712, 4012317, 3350297, 9670715, 3218712, 10511185,4275482], 2) then
Begin
ClickMouse2(True);
markTime (t);
repeat
Wait(5);
if (TimeFromMark(t) >= 5000) then Break;
until (not FlagPresent) and srl_InFight;
if (srl_Infight) then
begin
Marktime(T);
waitTime := 1000+RandomRange(300,600);
repeat
wait (100+random (200));
AntiBAM;
CurrentHp:= GetMMLevels('hp', ColorString);
if (z>200) then begin
writeln('Hp: '+ToStr(CurrentHp)+' / '+ToStr(TotalHp));
writeln ('Hp: %'+ToStr(CurrentHp*100/TotalHp));
for count := 0 to 3 do
Begin
Xp[CurrentPlayer][1][count]:= getXP (Skills[count]);
End;
z:=0;
end;
Eat(Round(CurrentHp*100/TotalHp),PercentEat[CurrentPlayer]);
z:= z+1;
If srl_InFight Then Marktime(T);
until (TimeFromMark(T) >= waitTime)
Marktime(T)
Kills := Kills +1;
Proggy;
End;
End;
until (not LoggedIn or (TimeFromMark(T) > 80000))
Players[CurrentPlayer].Active := False;
LogOut;
if not(CurrentPlayer+1 = HowManyPlayers) then
CurrentPlayer := CurrentPlayer + 1;
End;










// SpiralOut: Basic Antiban Mouse Spiral
Procedure SpiralOut ();
var
z,x,y, endpoint : Integer;
begin
z := 0;
endpoint := randomRange (50,150);
repeat
x := Round(z*Cos(0.5*z)+260);
y := Round(z*Sin(0.5*z)+224);
z := z + 1;
MMouse (x,y,20,20);
until (z >= endpoint)
end;


// Basic Antiban, exmain inventory, Spiral Mouse, Check Level, and Reset View
Procedure AntiBAM ();
begin
FindNormalRandoms;
case random(1000) of
25: examineInv;
30: SpiralOut;
50: begin gameTab (23);
LevelUpEX(False,True);
hoverSkill (Skills[Random(1)],false);
gameTab(25);
wait (100+Random(random(500))) end;
70: MMouse (365, 275,100,100);
99: ClickNorth(0);
end;
end;
Function Eat(HPP, PercentEat:Integer): Boolean;
var
I: Integer;
begin
Result := False;
If Not LoggedIn then Exit;
if (HPP < PercentEat) then
for i := 1 to 28 do
begin
if (ExistsItem(i)) then
begin
InvMouse(I, 3);
if IsUpText('Eat') then
begin
ClickMouse2(True);
Wait(RandomRange(350, 525));
Result := True;
Exit;
end;
end else
if (i = 28) then
Logout;
end;
end;
Procedure Proggy;
Begin
ClearDebug;
writeln('----------------------------------------------------------------');
For count2 := 0 to CurrentPlayer do
Begin
writeln(Players[count2].Name+' has gained the following xp');
for count := 0 to 3 do
begin
if not(Xp[count2][1][count]-Xp[count2][0][count] = 0) then
writeln (Skills[count]+' gained ~ '+ToStr (Xp[count2][1][count]-Xp[count2][0][count])+' XP');
end;
End;
writeln ('You have killed '+ToStr(Kills)+'Blue dragon');
writeln (Players[CurrentPlayer].Name+' has '+ToStr(InvCount)+' Pieces of Food Left');
writeln('----------------------------------------------------------------');
End;




begin
activateClient;
DeclarePlayers;
LoginPlayer;
SetupSRL
ClickNorth(0);
todragon;
Kills := 0;
//{Mistake I see a lot only call the map once, Not in the procedure}
//{If using multiple accounts it will always give an error when trying to pull the map}
repeat
Main;
until (AllPlayersInactive)
end.

Kevin

2013-02-27 15:09:21

I already mentioned how
todragon: =[(RUNESCAPE_SURFACE,['8_7', '0_0', '1_1']);
is incorrect and how to fix it (must be done inside a method). Also, you don't need
todragons;
ever because it doesn't do anything.

Whitefangz

2013-02-28 16:54:09

I'm very new to this. How do I fix this error.


[Error] C:\Users\Christopher\Downloads\TheAutoCurser v1.2.simba(57:5): Unknown identifier 'P07_CastSpell' at line 56
Compiling failed.