Well im a total noob to scripting but what do these errors mean
Code:Line 14: [Error] (14:1): Identifier expected in script
Line 8: [Error] (8:19): Semicolon (';') expected in script
Hope somebody can help me.
Printable View
Well im a total noob to scripting but what do these errors mean
Code:Line 14: [Error] (14:1): Identifier expected in script
Line 8: [Error] (8:19): Semicolon (';') expected in script
Hope somebody can help me.
The first one means you have a begin that doesn't have a corresponding end. Usually, the second one means you're missing a semicolon on the line indicated.
Thank you very much, Now i have these problem when i use including and a identifier problem which i cant seem to fix.
Include file C:\Program Files\SCAR 3.20\includes\Mining.Scar does not exist.
Failed when compiling
Line 13: [Error] (13:1): Identifier expected in script C:\Users\M. Giesing\Desktop\SRL Scripts\Marco40 Gold_Digga_0.1.scar
Whats this ? i got the Mining.Scar in my includes.
Code:Program Gold_Digga_0_1;
{.include Mining.Scar}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
/////////////////////////////Gold Digga V.01//////////////////////////
///////////////////////////// By Marco 40/////////////////////////////
/////////////////////////////Enjoy and get////////////////////////////
////////////////////////////////GP!!!!!!!/////////////////////////////
Procedure Wheresmymine;
begin
Const
MineColor=1343130;
Findcolor(x,y,MineColor,661,482)then
begin
Mouse(x,y,true)
end;
End;
I get this error also
Line 13: [Error] (13:1): Identifier expected in script C:\Users\M. Giesing\Desktop\SRL Scripts\Marco40 Gold_Digga_0.1.scar
Try this:
SCAR Code:Program Gold_Digga_0_1;
{.include SRL\SRL.scar}
{.include SRL\SRL\Skill\Mining.scar}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
/////////////////////////////Gold Digga V.01//////////////////////////
///////////////////////////// By Marco 40/////////////////////////////
/////////////////////////////Enjoy and get////////////////////////////
////////////////////////////////GP!!!!!!!/////////////////////////////
Const //constants must be declared outside of any procedures
MineColor = 1343130;
Procedure Wheresmymine;
begin
Findcolor(x,y,MineColor,661,482)then
begin
Mouse(x,y,3,3,true); //mouse requires a value for x randomness and y randomness
end;
End;
//you need a main section of code
begin
SetupSRL;
Wheresmymine;
end.
Thanks you very much, I will post if i have more problems btw repp++ for you.
Then what do you mean with Mouse(x,y,3,3,true) (Why 3,3 ? and when does it got to be 4,4 (This is a example)
And what do you mean with //you need a main section of code
Edit:
I actually gained a new error with yours
Line 15: [Error] (17551:11): Unknown identifier 'x' in script C:\Users\M. Giesing\Desktop\SRL Scripts\Marco40 Gold_Digga_0.1.scar
3,3 was an arbitrary number I picked. The bigger the numbers you use, the more randomness in the clicking.
As for the "you need a main section of code", one of the problems I fixed up was that you didn't have a begin...end. block. You just had a procedure. You need a final section of code that begins with a begin, and ends with an end. (note the period. That's important).
Thanks you very much cleared up alot of things, I get better in scripter every post you make,
Then i get a kinda weird error (Well i think it is)
Line 15: [Error] (17551:11): Unknown identifier 'x' in script C:\Users\M. Giesing\Desktop\SRL Scripts\Marco40 Gold_Digga_0.1.scar
What could be the problem there?Code:Findcolor(x,y,MineColor,661,482)then
Above const add this:
SCAR Code:var
x, y: Integer;
So it should look like this:
SCAR Code:Program Gold_Digga_0_1;
/////////////////////////////////////////////////////////
////////////////////////////////////////////////////////
/////////////// Gold Digga V.01 ///////////////////////
/////////////// By Marco 40 /////////////////////////
/////////////// Enjoy and get ///////////////////////
////////////////// GP!!!!!!! //////////////////////////
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Skill\Mining.Scar}
var
x, y: Integer;
const
MineColor = 1343130;
Procedure Wheresmymine;
begin
if FindColor(x, y, MineColor, 661, 482)then
begin
Mouse(x, y, 3, 3, True);
end;
end;
begin
SetupSRL;
WheresMyMine;
end.
Whoops, I forgot to declare x and y as variables. Below the line:Add this:SCAR Code:procedure Wheresmymine;
SCAR Code:var
x, y : Integer;
Edit: Dark Arcana, you should really avoid using Global variables unless you absolutely have to.
So before any X,Y things you should always use that line ?,
Now i get another error
(Sorry for all those errors but you probaly got explain one time for every error as you tell me how to fix them so i can do it myself)
Line 17: [Error] (17553:33): Invalid number of parameters in script C:\Users\M. Giesing\Desktop\SRL Scripts\Marco40 Gold_Digga_0.1.scar
[CodeFindcolor(x,y,MineColor,661,482)[/Code]
Error with the same line again.
Change that line into:
SCAR Code:if FindColor(x, y, MineColor, MSX1, MSY1, MSX2, MSY2) then
MS looks for the color in the main screen.
Hope this works.
Again sorry for so much questions,
But those MS1 MS 2 Etc, Why a 1 and a 2 not just all ones for example, And for every color searching should i use these ?.
Then it works thanks alot, No more errors,
Now repp for you.
MSX1 is the X Coordinate of the top left of the RS main screen. MSX2 is the X Coordinate of the bottom right of the RS main screen.
I see anyway,
The script should actually mine right ? Well i try'd it but it does nothing.Code:Program Gold_Digga_0_1;
{.include SRL\SRL.scar}
{.include SRL\SRL\Skill\Mining.scar}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
/////////////////////////////Gold Digga V.01//////////////////////////
///////////////////////////// By Marco 40/////////////////////////////
/////////////////////////////Enjoy and get////////////////////////////
////////////////////////////////GP!!!!!!!/////////////////////////////
////////////////////////////////Like it?//////////////////////////////
////////////////////////////////Rep+++++//////////////////////////////
////////////////////////////////Marco40///////////////////////////////
////////////////////////////////For Script////////////////////////////
////////////////////////////////Senrath///////////////////////////////
////////////////////////////////For help//////////////////////////////
////////////////////////////////Without him///////////////////////////
////////////////////////////////No script/////////////////////////////
Const
MineColor = 1343130;
Procedure Wheresmymine;
var
x, y : Integer;
begin
if FindColor(x, y, MineColor, MSX1, MSY1, MSX2, MSY2) then
begin
Mouse(x,y,3,3,true);
Wait(5000)
end;
End;
//you need a main section of code
begin
SetupSRL;
Wheresmymine;
end.
If you properly selected the Runescape window before running the code, it means that it's not finding the color. Try picking a new one. The colors in Runescape change quite often.
Good, Got it working. Anyway if i run it 2 seconds later it stops again, Just gets enough time to click once on the rock, It just stops after the first time clickign the rock, The whole script stops,
And how to make it mine more then one rock ?
(Sorry for double post)
Nobody knows why it stops after some time?,
How to make things a loop ? so it keeps doing it.
Here this is a simple mine section. I know it can result in a infinite loop but it is a base you can work off of.
SCAR Code:Program Gold_Digga_0_1;
{.include SRL\SRL.scar}
{.include SRL\SRL\Skill\Mining.scar}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
/////////////////////////////Gold Digga V.01//////////////////////////
///////////////////////////// By Marco 40/////////////////////////////
/////////////////////////////Enjoy and get////////////////////////////
////////////////////////////////GP!!!!!!!/////////////////////////////
////////////////////////////////Like it?//////////////////////////////
////////////////////////////////Rep+++++//////////////////////////////
////////////////////////////////Marco40///////////////////////////////
////////////////////////////////For Script////////////////////////////
////////////////////////////////Senrath///////////////////////////////
////////////////////////////////For help//////////////////////////////
////////////////////////////////Without him///////////////////////////
////////////////////////////////No script/////////////////////////////
Const
MineColor = 1343130;
function Wheresmymine : Boolean;
var
x, y : Integer;
begin
if FindColor(x, y, MineColor, MSX1, MSY1, MSX2, MSY2) then
begin
GetMousePos(x, y);
MMouse(x, y, 0, 0);
Result := True;
end;
end;
procedure mineOre;
var
x, y : Integer;
begin
if(Wheresmymine)then
repeat
Wait(2000 + Random(500));
Mouse(x, y, 3, 3, True);
until(InvFull);
end;
begin
SetupSRL;
mineOre;
end.
~Camo
Thanks alot!.
Only thing is why did you delete the SETUPSRL of WhereIsMyMine
and the Result := True;
what is it for ?
Is it like if he finds the colors result clicking on it ?
(Once again sorry for doublepost)
I run and it stops instantly just like the other script
I need this fixed so i can continue, Scripting.
He deleted the "SetupSRL" in the function because you only want SRL to load once per player. There is no need to set up srl every time it tries to find the mine.
Here's the new version
Hope this helps. Look at This Thread. This is the one script that helped me out ALOT, and I still look at it now.SCAR Code:Program Gold_Digga_0_1;
{.include SRL\SRL.scar}
{.include SRL\SRL\Skill\Mining.scar}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
/////////////////////////////Gold Digga V.01//////////////////////////
///////////////////////////// By Marco 40/////////////////////////////
/////////////////////////////Enjoy and get////////////////////////////
////////////////////////////////GP!!!!!!!/////////////////////////////
////////////////////////////////Like it?//////////////////////////////
////////////////////////////////Rep+++++//////////////////////////////
////////////////////////////////Marco40///////////////////////////////
////////////////////////////////For Script////////////////////////////
////////////////////////////////Senrath///////////////////////////////
////////////////////////////////For help//////////////////////////////
////////////////////////////////Without him///////////////////////////
////////////////////////////////No script/////////////////////////////
Const
MineColor = 1343130;
function Wheresmymine : Boolean;
var
x, y : Integer;
begin
if FindColor(x, y, MineColor, MSX1, MSY1, MSX2, MSY2) then
begin
GetMousePos(x, y);
MMouse(x, y, 0, 0);
Result := True; //This tells the script that it has found the color (True).
end;
end;
procedure mineOre;
var
x, y : Integer;
begin
if(Wheresmymine = True)then //Since "Wheresmymine" is a boolean, we have to make it equal to true or false (We want true cause, if it doesn't find the mine then it will log out, that's good)
repeat
Wait(2000 + Random(500));
Mouse(x, y, 3, 3, True);
until(InvFull);
end;
begin
repeat //A simple repeat, can be changed later
SetupSRL;
Wheresmymine; //Include it in the main loop
mineOre;
until(False); // and since you have a repeat you need to tell it when to stop until(False)
end.
How to set it to like 6 hours ? for example?. Or how to set it to run till i make it stop manually or when it fucks up?,
And i keep using this topic for problems,
Anyway tommorow if (After i tested this everything works fine) i take on the banking/walking.
If you got any guids (On banking/walking) who you think is the best please post a linky.
Everyone here thanks for helping this big noob, Hope in the future to make this a nice script, And to release more.
Take a look at this.
SCAR Code:Program Gold_Digga_0_1;
{.include SRL\SRL.scar}
{.include SRL\SRL\Skill\Mining.scar}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
/////////////////////////////Gold Digga V.01//////////////////////////
///////////////////////////// By Marco 40/////////////////////////////
/////////////////////////////Enjoy and get////////////////////////////
////////////////////////////////GP!!!!!!!/////////////////////////////
////////////////////////////////Like it?//////////////////////////////
////////////////////////////////Rep+++++//////////////////////////////
////////////////////////////////Marco40///////////////////////////////
////////////////////////////////For Script////////////////////////////
////////////////////////////////Senrath///////////////////////////////
////////////////////////////////For help//////////////////////////////
////////////////////////////////Without him///////////////////////////
////////////////////////////////No script/////////////////////////////
Const
MineColor = 1343130;
Var //Var= variable(Put all your Letters that represent numbers under here)
x, y, MyTime: Integer; // (Like This. x, y, are both Integers(Numbers) in this script) Edit: Added MyTime because that is another variable that represents a number, this one is time, instead of coords. x, y.)
function Wheresmymine : Boolean;
begin
if FindColor(x, y, MineColor, MSX1, MSY1, MSX2, MSY2) then
begin
GetMousePos(x, y);
MMouse(x, y, 0, 0);
Result := True; //This tells the script that it has found the color (True).
end;
end;
procedure mineOre;
begin
if(Wheresmymine = True)then //Since "Wheresmymine" is a boolean, we have to make it equal to true or false (We want true cause, if it doesn't find the mine then it will log out, that's good)
repeat
Wait(2000 + Random(500));
Mouse(x, y, 3, 3, True);
until(InvFull);
end;
begin
repeat //A simple repeat, can be changed later
SetupSRL;
MarkTime(MyTime) // I wouldn't do this but you get the idea. This Marks the time for the variable (MyTime) and starts counting in miliseconds. (So we can call it later)
Wheresmymine;
mineOre;
until(TimeFromMark(MyTime) > 3500000) or (False); //This tells it to wait until the Variable, MyTime, is greater than 3,500 seconds (About 6 Hours), or Until (false) it "f**ks up".
end.
Hope it helps.
Use these guides they helped me out ALOT "Getting started to learn how to script If you don't understand what's on there then you won't be able to make it walk. But when you do understand it then use this forum Map Waling - The Basics to the Advanced I STRONGLY suggest that you look at the first guide, and make sure you understand it before you try to Walk.
Rep++?( If this helped press here and hit the button "Add To Reputation" )
Thanks! :)
Oke thank you very much!, And how to run it for infinite ?
Then just remove thethen remove theSCAR Code:MarkTime(MyTime);
and you're left with..SCAR Code:(TimeFromMark(MyTime) >3500000) orRead the tuts. ;)SCAR Code:Until(False);