SRL Archive - OSR Help

Unknown identifier


kenddy3

2012-12-17 14:36:12

[Error] (60:3): Unknown identifier 'monkfish' at line 59
Compiling failed.
This is what i have
Procedure LoadDTMS;
begin
monkfish := DTMFromString('mggAAAHicY2NgYBBmZmCQB2JJIOYDYi4gVgficEYGBj8gjgVifyCOguJsD2ugLiYMzM+AHTDiwBAAAFOTA7s=');
end;
I keep getting this everysingle time!!!
Someone help me

DannyRS

2012-12-17 14:59:48

Procedure LoadDTMS;
Var Monkfish: Integer;
Begin
Monkfish := DTMFromString('mggAAAHicY2NgYBBmZmCQB2JJIOYDYi4gVgficEYGBj8gjgVifyCOguJsD2ugLiYMzM+AHTDiwBAAAFOTA7s=');
End;

Procedure FreeDTMS;
Begin
FreeDTM(Monkfish);
End;


but use


Var Monkfish: Integer; // at top of script below red defines/inside program

Procedure LoadDTMS;
Begin
Monkfish := DTMFromString('mggAAAHicY2NgYBBmZmCQB2JJIOYDYi4gVgficEYGBj8gjgVifyCOguJsD2ugLiYMzM+AHTDiwBAAAFOTA7s=');
End;

Procedure FreeDTMS;
Begin
FreeDTM(Monkfish);
End;


if you plan to actually use the dtm in other functions, must be a global variable :)

kenddy3

2012-12-18 00:34:08

now i get this error
[Error] C:\Simba\Scripts\Ken'sMonkFisher.simba(71:5): Duplicate identifier 'Monkfish' at line 70

Var Monkfish: Integar;
Procedure LoadDTMS;
Begin
monkFish := DTMFromString('mggAAAHicY2NgYBBmZmCQB2JJIOYDYi4gVgficEYGBj8gjgVifyCOguJsD2ugLiYMzM+AHTDiwBAAAFOTA7s=');
end;

Wardancer

2012-12-18 13:45:23

Can you post the whole script please? You might have Monkfish as a global variable.

DannyRS

2012-12-18 13:49:56

From: Wardancer
Can you post the whole script please? You might have Monkfish as a global variable.


^ this


[Error]: Duplicate identifier 'Monkfish'

read the error, it tells you whats wrong most of the time

The Killer

2012-12-18 13:56:51

From: kenddy3
now i get this error
[Error] C:\Simba\Scripts\Ken'sMonkFisher.simba(71:5): Duplicate identifier 'Monkfish' at line 70

Var Monkfish: Integar;
Procedure LoadDTMS;
Begin
monkFish := DTMFromString('mggAAAHicY2NgYBBmZmCQB2JJIOYDYi4gVgficEYGBj8gjgVifyCOguJsD2ugLiYMzM+AHTDiwBAAAFOTA7s=');
end;


its Integer not "integar" :D, change that. Post results. :D
edit: failed to read dup identifier. Clue: duplicate means more than one.

kenddy3

2012-12-18 14:39:45

Duplicate identifier 'Monkfish' at line 70 still the same issue
Heres the whole script go ahead start making me feel dumd of my script :(
program KensMonkfisher;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

////////////////// Instructions: //////////////////
///////// Start in the Piscatoris Bank ///////////
///// Have a small fishing net in your toolbelt /
////////////// Enter how many loads ////////////
/// Enter the World you would like to fish in /
/// Enter Account Info ///////////////////////
/////////////////////////////////////////////

Var
f, k, g, count:integer; //failsafes
x, y, MonkfishFished, XpGained, monkfish: integer; //other
MiddleWalk, spot1, spot2, spot3, EastWalk, WestWalk:TPointArray;
items: TIntegerArray;
aFound: extended;
PBox: TBox;

const
Loads = 10000; // Amounts of Loads you want
World = 91; // What World do you want to be in

Procedure DeclarePlayers;
begin
HowManyPlayers := 1; // Don't Touch This
NumberOfPlayers(HowManyPlayers); // Don't Touch This
CurrentPlayer := 0; // Don't Touch This
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Active := True; // Don't Touch This
Players[0].Pin := ''; // Bank Pin, Leave Blank If You Dont have one
end;

{----- Don't Touch Anything Past this line or you'll die --------------------}

Procedure Antiban;
begin
Wait(RandomRange(600,800));
Case random (75) of
1: Mouse(531, 62, 11, 11, true);
2: begin
HoverSkill('Fishing', false);
Wait(RandomRange(2000, 3000));
Gametab(Tab_Inv);
end;
3: begin
Gametab(Tab_Stats);
Wait(randomrange(750, 2400));
Gametab(Tab_Inv);
end;
4: MakeCompass(RandomRange(0,20));
5: MouseBox(0, 0, 753, 492, 2);
6: MakeCompass(RandomRange(340, 360));
7: SetAngle(RandomRange(0,30));
8: PickUpMouse;
9: PickUpMouse;
10: SetAngle(RandomRange(0,30));
11: MakeCompass(RandomRange(0,20));
12: MakeCompass(RandomRange(340, 360));
13: MakeCompass('N');
14: MakeCompass('N');
15: MouseSpeed := RandomRange(15,20);
16: MouseSpeed := RandomRange(15,20);
end;
end;

Var Monkfish: Integer;
Procedure LoadDTMS;
Begin
monkFish := DTMFromString('mggAAAHicY2NgYBBmZmCQB2JJIOYDYi4gVgficEYGBj8gjgVifyCOguJsD2ugLiYMzM+AHTDiwBAAAFOTA7s=');
end;

Procedure Beginning;
begin
MakeCompass ('N');
SetAngle(0);
Writeln('done with beginning');
GameTab(Tab_Inv);
end;

Procedure WalkBankFromMiddle;
begin
MiddleWalk := [Point(1185, 1858), Point(1180, 1870), Point(1176, 1883), Point(1158, 1882)];
SPS_WalkPath(MiddleWalk);
end;

Procedure WalkFishingSpot1;
begin
spot1 := [Point(1180, 1835)];
SPS_WalkPath(spot1);
end;

Procedure WalkFishingSpot2;
begin
spot2 := [Point(1220, 1838)];
SPS_WalkPath(spot2);
end;

Procedure WalkFishingSpot3;
begin
spot3 := [Point(1145, 1841)];
SPS_WalkPath(spot3);
end;

Procedure WalkBankFromEast;
begin
WestWalk := [Point(1096, 1842), Point(1110, 1846), Point(1125, 1849), Point(1142, 1851), Point(1158, 1853), Point(1174, 1857), Point(1176, 1885), Point(1158, 1883)];
SPS_WalkPath(WestWalk);
end;

Function StartFishing: Boolean;
begin
if not findnormalrandoms then
begin
count := 1
f := 0
repeat
inc(count);
x := MSCX;
y := MSCY;
WriteIn('Searching');
Wait(randomrange(300,500));
If (FindObjTPA(x, y, 11379098, 10, 1, 20, 20, 2,['Harpoon'])) then
begin
writeIn('Found possible spot');
Mouse(x, y, 4, 4, False);
If (WaitOption('Net', 3000)) then
begin
writeln('found spot');
result :=true
Break;
end;
end;
until((Count>4) or (true));
If (count>4) then
begin
result := false
end;
end false
begin
WriteIn('found random');
Logout;
TerminateScript;
end;
end;

Procedure WhileFishing;
begin
wait(randomrange(2000,2500));
repeat
PBox := IntToBox(245, 130, 285, 195);
repeat
if (AveragePixelShift(PBox, 1, 2500)>=4) then
AntiBan;
until ((AveragePixelShift(PBox, 1, 2500)<3) or (InvFull));
Writeln('pixelshift A done');
if (Invfull) then
begin
writeIn('Inv is full');
break;
end else
begin
if (AveragePixelShift(PBox, 250, 2500)<550) then
begin
Writeln('PixelShift B done');
wait(randomrange(10,150));
if not startfishing then
break;
end;
end;
until(InvFull);
end else
begin
writeln('found random event');
Logout;
TerminateScript;
end;
end;

Procedure WalkToBank;
var
P : TPoint;
Begin
SPS_GetMyPos;
Writeln(ToStr(SPS_GetMyPos));
P := SPS_GetMyPos;
if (P.x>1200) then
begin
writeln('Walking East Path');
WalkBankFromEast;
end else
if (P.x<1166) then
begin
writeln('Walking Wast Path');
WalkBankFromWest;
end else
begin
writeln('Walking Middle Path');
WalkBankFromMiddle;
end;
end;

Procedure Banking;
var
nn: integer;
zz: TPoint;
begin
if not FindNormalRandoms then
begin
nn := 0;
f := 0;
MouseSpeed := RandomRange(14,22);
repeat
Wait(RandomRange(250, 600));
if FindObjTPA(x, y, 3840441, 15, 1, 4, 5, 4, ['k-to']) then
begin
Mouse(x, y, 5, 5, false);
if (WaitOption('ank Ar', 600)) then
begin
Writeln('we found bank');
g := 0;
repeat
Inc(g);
Wait(RandomRange(45, 55))
until((BankScreen)or(g>60)or(PinScreen));
If PinScreen then
InPin(Players[CurrentPlayer].Pin);
end;
end else
begin
Writeln('going to rotate screen');
Inc(f);
MakeCompass(RandomRange(90, 270));
end
if (f>5) then
begin
Writeln('trying some walking');
f := 0;
Inc(nn);
ClickNorth(0);
SPS_WalkPath([Point(RandomRange(1160, 1170), RandomRange(1870, 1885))]);
end;
if (nn>5) then
begin
Writeln('failed to bank');
Wait(10000);
// Logout;
TerminateScript;
end;
until(BankScreen);
begin
DepositAll;
Wait(randomRange(400, 800));
IncEx(MonkfishFished, 27);
IncEx(XpGained, 3240);
if (random(12)=5) then
CloseBank;
WalkToShore;
end;
end;
end;

Procedure MakeProggy;
begin
ClearDebug;
TimeGone := (GetTimeRunning/1000);
CurrentXP := GetXPBar(1);
XPGain := (CurrentXP - OriginalXP);
XPPerhour :=(3600*(XPGain))/((TimeGone));
LoadsPerhour :=(3600*(LoadsDone))/((TimeGone));
RunesPerHour := (3600*(Runes))/((TimeGone));
begin
Writeln('******************************************************************');
Writeln('*/////////----------Kens Monkfisher Version 1.0 -----\\\\\\\\\\\\*');
Writeln('*/////////----------____________________________----------\\\\\\\*');
Writeln('');
Writeln('*/////////--------- Proggy for the player: ' + Players[0].Nick + ' --------\\\\\\\\\*');
Writeln('*/////////We have done: ' + IntToStr(LoadsDone) + ' Loads / Thats ' + IntToStr(LoadsPerHour) + ' loads per hour');
Writeln('*/////////We have gained: ' + IntToStr(XPGain) + ' xp / Thats ' + IntToStr(XPPerHour) + ' xp per hour');
Writeln('*/////////We have fished' + IntToStr(Rawmonkfish) + ' Monkfish / Thats ' + IntToStr(MonkFishPerHour) + ' Monkfish Per Hour');
Writeln('');
end;
end;

Procedure FreeDTMMs;
begin
FreeDTM(monkfish);
end;

begin
MouseSpeed := RandomRange(15,20);
ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
Beginning;
writeln('Starting');
MakeProggy;
SPS_Setup(RUNESCAPE_SURFACE,['2_4']);
repeat
repeat
repeat
SPS_GetMyPos;
if (invfull) then
break
else
if not Startfishing then
begin
MouseSpeed := RandomRange(15,20);
WalkFishingSpot1;
wait(RandomRange(600,1200));
if not Startfishing then
begin
MouseSpeed := RandomRange(15,20);
WalkFishingSpot2;
wait(RandomRange(600,1200));
if not Startfishing then
begin
MouseSpeed := RandomRange(15,20);
WalkFishingSpot1;
wait(RandomRange(600,1200));
if not Startfishing then
begin
end;
end;
end;
end;
end;
until (true);
WhileFishing;
until(InvFull);
if (InvFull) then
begin
Wait(Randomrange(1300,4000));
WalkToBank;
LoadDTMS;
Banking;
MakeProggy;
inc(k);
Writeln('Done!');
FreeDTMMs;
MouseSpeed := RandomRange(15,20);
end;
until (k=loads);
end.

Dynamite

2012-12-18 14:45:07

Thats because you have it at the top of the script as a global and above the procedure as a global. Delete the one above the procedure

-Boom

DannyRS

2012-12-18 14:45:36

Remove line 70

From: Dynamite
Thats because you have it at the top of the script as a global and above the procedure as a global. Delete the one above the procedure

-Boom

___

2012-12-18 14:53:08

program KensMonkfisher;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

////////////////// Instructions: //////////////////
///////// Start in the Piscatoris Bank ///////////
///// Have a small fishing net in your toolbelt /
////////////// Enter how many loads ////////////
/// Enter the World you would like to fish in /
/// Enter Account Info ///////////////////////
/////////////////////////////////////////////

Var
f, k, g, count:integer; //failsafes
x, y, MonkfishFished, XpGained, monkfish: integer; //other
MiddleWalk, spot1, spot2, spot3, EastWalk, WestWalk:TPointArray;
items: TIntegerArray;
aFound: extended;
PBox: TBox;

const
Loads = 10000; // Amounts of Loads you want
World = 91; // What World do you want to be in

Procedure DeclarePlayers;
begin
HowManyPlayers := 1; // Don't Touch This
NumberOfPlayers(HowManyPlayers); // Don't Touch This
CurrentPlayer := 0; // Don't Touch This
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Active := True; // Don't Touch This
Players[0].Pin := ''; // Bank Pin, Leave Blank If You Dont have one
end;

{----- Don't Touch Anything Past this line or you'll die --------------------}

Procedure Antiban;
begin
Wait(RandomRange(600,800));
Case random (75) of
1: Mouse(531, 62, 11, 11, true);
2: begin
HoverSkill('Fishing', false);
Wait(RandomRange(2000, 3000));
Gametab(Tab_Inv);
end;
3: begin
Gametab(Tab_Stats);
Wait(randomrange(750, 2400));
Gametab(Tab_Inv);
end;
4: MakeCompass(RandomRange(0,20));
5: MouseBox(0, 0, 753, 492, 2);
6: MakeCompass(RandomRange(340, 360));
7: SetAngle(RandomRange(0,30));
8: PickUpMouse;
9: PickUpMouse;
10: SetAngle(RandomRange(0,30));
11: MakeCompass(RandomRange(0,20));
12: MakeCompass(RandomRange(340, 360));
13: MakeCompass('N');
14: MakeCompass('N');
15: MouseSpeed := RandomRange(15,20);
16: MouseSpeed := RandomRange(15,20);
end;
end;

Procedure LoadDTMS;
Begin
monkFish := DTMFromString('mggAAAHicY2NgYBBmZmCQB2JJIOYDYi4gVgficEYGBj8gjgVifyCOguJsD2ugLiYMzM+AHTDiwBAAAFOTA7s=');
end;

Procedure Beginning;
begin
MakeCompass ('N');
SetAngle(0);
Writeln('done with beginning');
GameTab(Tab_Inv);
end;

Procedure WalkBankFromMiddle;
begin
MiddleWalk := [Point(1185, 1858), Point(1180, 1870), Point(1176, 1883), Point(1158, 1882)];
SPS_WalkPath(MiddleWalk);
end;

Procedure WalkFishingSpot1;
begin
spot1 := [Point(1180, 1835)];
SPS_WalkPath(spot1);
end;

Procedure WalkFishingSpot2;
begin
spot2 := [Point(1220, 1838)];
SPS_WalkPath(spot2);
end;

Procedure WalkFishingSpot3;
begin
spot3 := [Point(1145, 1841)];
SPS_WalkPath(spot3);
end;

Procedure WalkBankFromEast;
begin
WestWalk := [Point(1096, 1842), Point(1110, 1846), Point(1125, 1849), Point(1142, 1851), Point(1158, 1853), Point(1174, 1857), Point(1176, 1885), Point(1158, 1883)];
SPS_WalkPath(WestWalk);
end;

Function StartFishing: Boolean;
begin
if not findnormalrandoms then
begin
count := 1
f := 0
repeat
inc(count);
x := MSCX;
y := MSCY;
WriteIn('Searching');
Wait(randomrange(300,500));
If (FindObjTPA(x, y, 11379098, 10, 1, 20, 20, 2,['Harpoon'])) then
begin
writeIn('Found possible spot');
Mouse(x, y, 4, 4, False);
If (WaitOption('Net', 3000)) then
begin
writeln('found spot');
result :=true
Break;
end;
end;
until((Count>4) or (true));
If (count>4) then
begin
result := false
end;
end false
begin
WriteIn('found random');
Logout;
TerminateScript;
end;
end;

Procedure WhileFishing;
begin
wait(randomrange(2000,2500));
repeat
PBox := IntToBox(245, 130, 285, 195);
repeat
if (AveragePixelShift(PBox, 1, 2500)>=4) then
AntiBan;
until ((AveragePixelShift(PBox, 1, 2500)<3) or (InvFull));
Writeln('pixelshift A done');
if (Invfull) then
begin
writeIn('Inv is full');
break;
end else
begin
if (AveragePixelShift(PBox, 250, 2500)<550) then
begin
Writeln('PixelShift B done');
wait(randomrange(10,150));
if not startfishing then
break;
end;
end;
until(InvFull);
end else
begin
writeln('found random event');
Logout;
TerminateScript;
end;
end;

Procedure WalkToBank;
var
P : TPoint;
Begin
SPS_GetMyPos;
Writeln(ToStr(SPS_GetMyPos));
P := SPS_GetMyPos;
if (P.x>1200) then
begin
writeln('Walking East Path');
WalkBankFromEast;
end else
if (P.x<1166) then
begin
writeln('Walking Wast Path');
WalkBankFromWest;
end else
begin
writeln('Walking Middle Path');
WalkBankFromMiddle;
end;
end;

Procedure Banking;
var
nn: integer;
zz: TPoint;
begin
if not FindNormalRandoms then
begin
nn := 0;
f := 0;
MouseSpeed := RandomRange(14,22);
repeat
Wait(RandomRange(250, 600));
if FindObjTPA(x, y, 3840441, 15, 1, 4, 5, 4, ['k-to']) then
begin
Mouse(x, y, 5, 5, false);
if (WaitOption('ank Ar', 600)) then
begin
Writeln('we found bank');
g := 0;
repeat
Inc(g);
Wait(RandomRange(45, 55))
until((BankScreen)or(g>60)or(PinScreen));
If PinScreen then
InPin(Players[CurrentPlayer].Pin);
end;
end else
begin
Writeln('going to rotate screen');
Inc(f);
MakeCompass(RandomRange(90, 270));
end
if (f>5) then
begin
Writeln('trying some walking');
f := 0;
Inc(nn);
ClickNorth(0);
SPS_WalkPath([Point(RandomRange(1160, 1170), RandomRange(1870, 1885))]);
end;
if (nn>5) then
begin
Writeln('failed to bank');
Wait(10000);
// Logout;
TerminateScript;
end;
until(BankScreen);
begin
DepositAll;
Wait(randomRange(400, 800));
IncEx(MonkfishFished, 27);
IncEx(XpGained, 3240);
if (random(12)=5) then
CloseBank;
WalkToShore;
end;
end;
end;

Procedure MakeProggy;
begin
ClearDebug;
TimeGone := (GetTimeRunning/1000);
CurrentXP := GetXPBar(1);
XPGain := (CurrentXP - OriginalXP);
XPPerhour :=(3600*(XPGain))/((TimeGone));
LoadsPerhour :=(3600*(LoadsDone))/((TimeGone));
RunesPerHour := (3600*(Runes))/((TimeGone));
begin
Writeln('******************************************************************');
Writeln('*/////////----------Kens Monkfisher Version 1.0 -----\\\\\\\\\\\\*');
Writeln('*/////////----------____________________________----------\\\\\\\*');
Writeln('');
Writeln('*/////////--------- Proggy for the player: ' + Players[0].Nick + ' --------\\\\\\\\\*');
Writeln('*/////////We have done: ' + IntToStr(LoadsDone) + ' Loads / Thats ' + IntToStr(LoadsPerHour) + ' loads per hour');
Writeln('*/////////We have gained: ' + IntToStr(XPGain) + ' xp / Thats ' + IntToStr(XPPerHour) + ' xp per hour');
Writeln('*/////////We have fished' + IntToStr(Rawmonkfish) + ' Monkfish / Thats ' + IntToStr(MonkFishPerHour) + ' Monkfish Per Hour');
Writeln('');
end;
end;

Procedure FreeDTMMs;
begin
FreeDTM(monkfish);
end;

begin
MouseSpeed := RandomRange(15,20);
ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
Beginning;
writeln('Starting');
MakeProggy;
SPS_Setup(RUNESCAPE_SURFACE,['2_4']);
repeat
repeat
repeat
SPS_GetMyPos;
if (invfull) then
break
else
if not Startfishing then
begin
MouseSpeed := RandomRange(15,20);
WalkFishingSpot1;
wait(RandomRange(600,1200));
if not Startfishing then
begin
MouseSpeed := RandomRange(15,20);
WalkFishingSpot2;
wait(RandomRange(600,1200));
if not Startfishing then
begin
MouseSpeed := RandomRange(15,20);
WalkFishingSpot1;
wait(RandomRange(600,1200));
if not Startfishing then
begin
end;
end;
end;
end;
end;
until (true);
WhileFishing;
until(InvFull);
if (InvFull) then
begin
Wait(Randomrange(1300,4000));
WalkToBank;
LoadDTMS;
Banking;
MakeProggy;
inc(k);
Writeln('Done!');
FreeDTMMs;
MouseSpeed := RandomRange(15,20);
end;
until (k=loads);
end.

That should do it.

kenddy3

2012-12-18 15:04:18

Thanks guys but now i got this problem
(124:9): Unknown identifier 'WriteIn' at line 123

Dynamite

2012-12-18 15:05:12

WriteLn

-Boom

Wardancer

2012-12-18 15:09:03

My gosh… I have no idea how you pinpointed that question considering everything that doesn't compile with your script. I strongly suggest you to run Compile over and over again until you have fixed the 30ish issues before continuing to code.