SRL Archive - OSR Help

Unknown Identifier


cradlefatal

2013-02-27 06:33:58

[Error] C:\Simba\Scripts\dragonkiller.simba(17:1): Unknown identifier 'todragons' at line 16

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








begin
SetupSRL;
SPS_Setup(RUNESCAPE_SURFACE,['8_7']);
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)];
todragons;
end.


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

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 paths;
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)];
end;
procedure todragon;
var
status: string;
begin
if sps_walkpath(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}
sps_setup(runescape_other,['todragons']);
repeat

Main;
until (AllPlayersInactive)
end.

Sjoe

2013-02-27 06:38:43

put your var's and const in the beginning of the script

cradlefatal

2013-02-27 06:40:38

okay i'll check it out when I wake up i'm going to sleep stayed up all night again learning this stuff so goodnight all