SRL Archive - Help and Support

Crafting Guild Miner and bank- ideifier expected


oliver1205

2007-04-11 12:38:52

its late here, i just got finished messing with walking from the bank to the guild. And when i try to run it i get a idenfier expected. i tried everything i could think of. Its prlly a nooby error, but its late here and im half asleep. I get the error in the 4rth block of walking. like 118


program Crafting_Guild_Miner_And_Banker;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Mining.scar}

var
A1,B1: Integer;
RunDire1: Integer;
OreMined: Integer;
Loads: Integer;
Tries: Integer;




const
OreWait = 5; // Maxium Time To Wait Between Clicking Ore.
Load = 10; // How Many Loads Before Switching Players
SilverOre = 485950; // Color Of The Silver Ore
GoldOre = 102939; // Color Of The Gold Ore
StartPlayer = 0; // Player That You Want To Start
RunDire = 'W'; // Direction To Run In For Randoms
OllieDebug = True; // Use My Debug?
DoorColor = 85858; // Color Of Door On The Guild
DoorTolerance = 10; // Tol For Find Door. Better To Leave Alone
WaterColor1 = 12095356; // You Can Leave This =)

//**********************************************************************//

procedure DeclarePlayers;
begin
HowManyPlayers := 4;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := StartPlayer;


Players[0].Name := 'YourName';
Players[0].Pass := 'YourPass';
Players[0].Nick := 'Yoo';
Players[0].Active := True;
Players[0].Boolean1 := True; // Is Your Pick Equipped??
Players[0].String1 := 'Silver'; // Ore To Mine? (Note The Capital Letter)

Players[1].Name := 'YourName';
Players[1].Pass := 'YourPass';
Players[1].Nick := 'Yoo';
Players[1].Active := True;
Players[1].Boolean1 := True; // Is Your Pick Equipped??
Players[1].String1 := 'Silver'; // Ore To Mine? (Note The Capital Letter)

Players[2].Name := 'YourName';
Players[2].Pass := 'YourPass';
Players[2].Nick := 'Yoo';
Players[2].Active := True;
Players[2].Boolean1 := True; // Is Your Pick Equipped??
Players[2].String1 := 'Silver'; // Ore To Mine? (Note The Capital Letter)

Players[3].Name := 'YourName';
Players[3].Pass := 'YourPass';
Players[3].Nick := 'Yoo';
Players[3].Active := True;
Players[3].Boolean1 := True; // Is Your Pick Equipped??
Players[3].String1 := 'Silver'; // Ore To Mine? (Note The Capital Letter)
end;
//***********************************************************************//

procedure SetUp;
begin
SetupSRL;
SetupSRLMining;
DeclarePlayers;
CurrentPlayer:=StartPlayer;
if (not(LoggedIn)) then NextPlayer(True);
FindPickHeadColor;
MouseSpeed:=20;
ClearDebug;
end;
//**********************************************************************//

procedure RunAway;// Got this from charmz miner. Modded a lil bit
begin
case (Random(9+1)) of
0 : begin TypeSend('not again'); end
1 : begin TypeSend('owned random'); end
2 : begin TypeSend('hah'); end
3 : begin TypeSend('cant beat me'); end
4 : begin TypeSend('-.-'); end
5 : begin TypeSend('sucka!'); end
6 : begin TypeSend('0o0o'); end
7 : begin TypeSend('wat now!'); end
8 : begin TypeSend('!!!!'); end
9 : begin TypeSend('whoa close one'); end
10 : begin TypeSend('=/'); end
end
RunAwayDirection(RunDire);
Wait(8000+Random(2000));
RunBack;
if OllieDebug then Writeln('Ran Away From Random')
end;
//**********************************************************************//

procedure WalkToGuild;
var cd,cc:Integer;
begin
MakeCompass('N');

MarkTime(Mark);
repeat
if not(Loggedin) then Logout;
Mouse(745, 237, 5, 5,True);

Wait(5000+Random(2000))
RadialRoadWalk(1664358,170,0,55,3,3);
FindNormalRandoms;
until FindColor(cd, cc, WaterColor, MMX1+5, MMX1+10, MMX2+10, MMX2-10);

if(TimeFromMark(Mark)>90000) then begin exit; end;
RadialRoadWalk(1862251,175,0,59,3,3);
I GET THE ERROR HERE until FindColor(cd, cc, 65536, MMX1+10, MMX1-5, MMX2+10, MMX2-7);
if(TimeFromMark(Mark)>120000) then begin exit; end;

Mouse(775,258,5,5,True);
Wait(5000);
RadialRoadWalk(1994613,200,400,60,3,3);
RadialRoadWalk(RoadColor, 150, 400, 60, 3, 3);

until FindColor(cd, cc, 57788503, MMX1+10, MMX1-5, MMX2+15, MMX2-10);
MakeCompass('W');
Wait(2000);
if(TimeFromMark(Mark)>110000) then begin exit; end;

RadialRoadWalk(RoadColor, 400, 200, 60, 3,3);
Mouse(445, 289, 5, 5, True);
until FindColor(cd, cc, 5065280, MMX1+10, MMX1-5, MMX2+15, MMX2-10);
if(TimeFromMark(Mark)>90000) then begin exit; end;

RadialRoadWalk(RoadColor, 400, 200, 60, 3, 3);
RadialRoadWalk(RoadColor, 400, 200, 60, 3, 3);
Wait(5000);
if(TimeFromMark(Mark)>100000) then begin exit; end;

RadialRoadWalk(RoadColor, 450, 200, 60, 3, 3);
until FindColor(cd, cc, 6579290, MMX1+10, MMX1-5, MMX2+15, MMX2-10);
Wait(2000);
Mouse(285, -168, 3, 3, True);

MakeCompass('S');
Wait(3000);
Mouse(320, -255, 5, 5, True);
end;
//**********************************************************************//

Function FindMineSymbolColor: Boolean; // Used From Charmz Miner
Begin
Repeat
MineSymbolColor:= GetSymbolColor(x, y, 'mining spot')
SymbolAccuracy:= SymbolAccuracy-0.1;
Until(SymbolAccuracy= 0.4) or (MineSymbolColor > 0);
If(MineSymbolColor > 0)then
Begin
WriteLn('MineSymbolColor - '+IntToStr(MineSymbolColor));
SymbolAccuracy:= 0.8;
Result:= True;
End else
Begin
WriteLn('Couldn''t find mine symbol color!');
SymbolAccuracy:= 0.8;
End;
End;
end;
//**********************************************************************//
Procedure ClickMine; // Also Used From Charmz Miner
Begin
FindMineSymbolColor;
If (FindColorSprilaTolerance(x,y,MineSymbolColor,MMX1,MMX1,MMX2,MMX2,5)) or (FindSymbol(x, y, 'mining site'))Then
Mouse(x,y,3,3,True);
Flag;
End;
End;
//************************************************************************//

Function FindFastRandoms: Boolean; // By WT-Fakawi.

Var
i: Integer;

Begin
For I := 1 To 11 Do
Begin
Case I Of
1: If FindDead Then
Result := True;

2: If FindMod Then
Result := True;

3: If FindMime Then
Result := True;

4: If FindMaze Then
Result := True;

5: If FindQuiz Then
Result := True;

6: If FindDemon Then
Result := True;

7: Begin
If NoGameTab Then
Begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
End;
End;

8 : If RC Then
Result := True;

9 : If FindFight Then
Begin
Result := True;
RunTo(RunDir, True);
End;

10: If FindTalk Then
Result := True;

11: If HandleTrade Then
Result := True;
End;
Wait(1);
End;
End;
//**********************************************************************//

Function CheckGas(S: String; CheckForGas: Boolean; cx, cy: Integer): Boolean; // Taken From Star's Power Skills
Var
Mark, c: Integer;
Begin
If (CheckForGas) then
begin
If GasCheck(cx, cy-20) or FindGas(cx, cy-20)then
Begin
Repeat
c := c + 1;
Result := True;
Mouse(648, 83, 2, 2, True);
Wait(400 + Random(400));
until(c >= 2)
MarkTime(Mark);
end;
end else
Begin
Repeat
c := c + 1;
Result := True;
Mouse(648, 83, 2, 2, True);
Wait(400 + Random(400));
until(c >= 2)
MarkTime(Mark);
end;
If (Result) then
Begin
Case Lowercase(S) of
'gas' : ReportVars[2] := ReportVars[2] + 1;
'ent' : ReportVars[3] := ReportVars[3] + 1;
end;
While (TimeFromMark(Mark) < 15000) do
begin
StarDebug(Capitalize(S) + ' Found!', 4);
SleepAndMoveMouse(1000);
Randoms('');
end;
end;
end;
//*********************************************************************//
Procedure ChangeGasPixels (Var Gasx,GasY:Integer); // Thank You Wizzup?
Var
TempX, TempY: Integer;
Begin
If FlagPresent Then
Begin
If FindColorSpiralTolerance(x,y,rockcolor,MSX1,MSY1,MSX2,MSY2,4) Then
Begin
x := TempX;
y := TempY;
If CheckOre(x,y,rockcolor,4) > 2 Then
Begin
If Distance(MSCX,MSCY,TempX,Tempy) < 40 Then
Begin
GasX := x;
GasY := y;
End;
End;
End;
End;
End;
//**********************************************************************//

Function FindTheOres1; // Modded A Bit From Charmz Thanks
Var za,zb: Integer;
Begin
If(FindColorSpiralTolerance(za,zb,SilverOre,MSX1,MSX1,MSX2,MSX2,5)) Then
Begin
Result:=True;
End Else
Begin
Result:=False;
If OllieDebug Then ('Cannot Find Ore, Will Relocate Thanks To Charmz');
RelocateToMine;
End;
End;
//*********************************************************************//

Function FindTheOres2; // Modded A Bit From Charmz Thanks
Var zx,zy: Integer;
Begin
If(FindColorSpiralTolerance(zx,zy,GoldOre,MSX1,MSX1,MSX2,MSX2,5)) Then
Begin
Result:=True;
End Else
Begin
Result:=False;
If OllieDebug Then ('Cannot Find Ore, Will Relocate Thanks To Charmz');
RelocateToMine;
End;
End;
//********************************************************************//

Procedure OreMine1;
Var cx,cy,ab,ac: Integer;
Begin
If OllieDebug Then Writeln (' Time To Mine!');
Repeat
If String1 = 'Silver' Then
Begin
If(FindTheOres1)Then
Begin
If ( Not CheckGas(cx,cy)) Then
Begin
Mouse(cx,cy,5,5,True);
ChangeGasPixels(x,y);
If OllieDebug Then Writeln (' Avoided Gas ');
End
Else
Begin
Mouse(ab,ac,0,0,False);
ChooseOption(x,y,'ine');
OreMined := OreMined + 1;
End;
Begin
If Not FindPick Then
FindPickHead;
Until (InvFull);
End;
//**********************************************************************//

procedure OreMine2;
Var cx,cy,ab,ac: Integer;
Begin
If OllieDebug Then Writeln (' Time To Mine!');
Repeat
If String1 = 'Silver' Then
Begin
If(FindTheOres1)Then
Begin
If ( Not CheckGas(cx,cy)) Then
Begin
Mouse(cx,cy,5,5,True);
ChangeGasPixels(x,y);
If OllieDebug Then Writeln (' Avoided Gas ');
End
Else
Begin
Mouse(ab,ac,0,0,False);
ChooseOption(x,y,'ine');
OreMined := OreMined + 1;
End;
Begin
If Not FindPick Then
FindPickHead;
Until (InvFull);
End;
//**********************************************************************//

function OpenDoor; // Modded Dont Panic's Door Opening Function
var de,dc integer;
begin
result := False;
if(FindObjMultiText,de,dc,'pen','pen', DoorColor,DoorTolerance)) then
begin
if IsUpText('lose') then
begin
Result :=True;
exit;
end;
if IsUpText('pen') then
begin
Mouse(de, dc, 0, 0, True);
Result := True;
exit;
end;
end;
end;
//*******************************************************************//

procedure DoorToMine;
begin
repeat
Mouse(592,300,5,5,True);
FindMineSymbolColor;
ClickMine;
end;
//*******************************************************************//

procedure MineToBank;



























begin
end.

Pentti

2007-04-11 13:58:07

Error is because you dont have "Repeat" before "until FindColor(cd, cc, 65536, MMX1+10, MMX1-5, MMX2+10, MMX2-7);"

Bam Bam

2007-04-11 19:09:46

From: Pentti
Error is because you dont have "Repeat" before "until FindColor(cd, cc, 65536, MMX1+10, MMX1-5, MMX2+10, MMX2-7);"


Petti is right.

When asking for help try to use proper coding standards, they help us find your problem sooner.

Coding Standard Tutorial:
http://wiki.srl-forums.com/index.php/Scripting_Standards

oliver1205

2007-04-11 19:21:36

thanks guys =) im adding stards to the script im just getting the basics down first