SRL Archive - Help

My first script,but,i have one problem.


Gaston7eze

2011-12-21 14:22:44

program New;
{.include srl/srl.scar}

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;
Procedure ChopTree;
Var x,y: Integer;
Begin
If FindObj(x,y,'hop',1785912, 35)Then
Mouse(x,y,0,0, False);
ChooseOption('Hop')
Repeat
Wait(1200+random(250));
Until not IsUpText('yew')or('InvFull')
End;
Procedure AntiBan;
Begin
If(Not LoggedIn))then
Exit;
Case;Random(8)of
0:
Begin
HoverSkill('Woodcutting'),false)
Wait(2453+random(432));
End
1:PickUpMouse;
2:
Begin
MakeCompass('N');
Wait(100)+random(133));
MakeCompass('S');
Wait(50+random(133));
MakeCompass('N')
End;
End;
End;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
ChopTree;
end.

There is the code
But where there is Red it gives me an error:
"[Error] (25:1): Type mismatch at line 24
Compiling failed."

sahibjs

2011-12-21 14:32:05

you posted your username and pass on there :P

remove that, even if it is a noob acc

no semi-colon after begin?

I think there might be other things wrong with it too, but thats the only thing that pertains to line 24.

Gaston7eze

2011-12-21 14:36:08

I will try out,its a noobish account so i dont care.!Thanks for the advice!

Gaston7eze

2011-12-21 14:37:54

Someone took it.LOL.Come on guys.

supersain

2011-12-21 14:42:40

check your inbox

Gaston7eze

2011-12-21 14:50:28

Thanks,
There correction that sahibis made dont solve the problem,someone ?

Jhangir

2011-12-21 14:54:48

Isnt this the script posted in the tutorial section?

RISK

2011-12-21 14:55:52

procedure ChopTree;
var x,y: Integer;
begin
if FindObj(x,y,'hop',1785912, 35)Then
begin
Mouse(x,y,0,0, False);
ChooseOption('Hop')
repeat
Wait(1200+random(250));
until not IsUpText('Yew')or('InvFull')
end;
end;

Please put your script in Simba tags from now on. :) It will make it easier to tell what's wrong.

YoHoJo

2011-12-21 14:59:07

Problem was here
Until not IsUpText('yew')or InvFull; 
You were making it like ('InvFull') which 1)it's not a string, and 2) it's not an uptext either.

After fixing that you also get error of too many parathensis so fix this line to be like this:
If (Not LoggedIn) then 
I can even just be
If Not LoggedIn then 
]

Then you put a ; after case which needs not be there so do this:
Case Random(8)of 

Then extra parathenses again here, so make it:
HoverSkill('Woodcutting',false) 

Then for your 2nd case (Case #1) you forgot a ; after the end.
End; 
Then for your 3rd case (Case #2) you didnt enter any command, so I just made it a wait:

1:PickUpMouse;
2: Wait(100);

Then after your case statement you need an end (even though there is no begin, cases need an end for them);
Case Random(8)of
0:Begin
HoverSkill('Woodcutting',false)
Wait(2453+random(432));
End;
1 :PickUpMouse;
2: wait(100);
End;

Then extra parathasis again:
Wait(100+random(133));

Then an extra end at end of AntiBan procedure, so remove it.

Then it compiles.

1) When posing code, use Simba tags around it.
2) When coding, standardize your code, meaning space it properly, go look at any popular script and see how they standardize(space out) their code nicely, it's much easier to read that way, search up a tutorial on scripting standards
3) AS YOU CODE keep pressing Ctrl+F9 every few lines or in simba doing Script>Compile, this will tell you if there are any errors so you can fix errors as you see them, not fix a million errors in the end.

Good Luck!

Gaston7eze

2011-12-21 15:13:35

Damn man!Thank you so much!You help me a lot!

Well i get an error in line 37 with "Begin" i dont know whats going on as it is ther same as all the other "Begins".

YoHoJo

2011-12-21 15:19:15

First of all no ; after begin.
Second of all, you forgot the end after the case read by big ol post again.
Third of all, don't quote BIG OL POSTS they are big enough aleady!
Fourth of all, don't double post.
Good Luck.

Gaston7eze

2011-12-21 15:25:47

Thanks.!

If i put End after Case then in line 36 it shows me an error
Then after all this on line 41 other error.

[Error] (37:1): Identifier expected at line 36
Compiling failed.

Gaston7eze

2011-12-21 15:35:49

If i put End after Case then in line 36 it shows me an error
Then after all this on line 41 other error.

[Error] (37:1): Identifier expected at line 36
Compiling failed.

YoHoJo

2011-12-21 15:37:29

copy/paste it here.
Put simba tags around it.

Brandon

2011-12-21 15:40:32

From: Gaston7eze
If i put End after Case then in line 36 it shows me an error
Then after all this on line 41 other error.

[Error] (37:1): Identifier expected at line 36
Compiling failed.



FORMAT your code.. and use code tags.. it was so hard to read :c As for your problems. The Mod above pointed them out. After Begin, don't put any ;.. and after End you must put a ;..

For hover skill, the function definition is HoverSkill(Skill here, Action here).. Skills can be either numbers or strings as that is a variant. Actions can be False or True as its a boolean.. True is to click left, false is to right click.

As for formatting, try to indent a little, and use the enter button more to separate lines from eachother rather than bunching them all up. That way you know which begin matches with which end..


program New;
{.include srl/srl.scar}

Procedure DeclarePlayers;
begin;
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;

Procedure ChopTree;
Var
x,y: Integer;
Begin
If FindObj(x,y,'hop',1785912, 35) Then
begin
Mouse(x,y,0,0, False);
ChooseOption('Hop');
end;

Repeat
Wait(1200+random(250));
Until (not IsUpText('yew')) or InvFull;
End;

Procedure AntiBan;
Begin;
If(Not LoggedIn)then
Exit;
Case Random(8) of
0:
Begin
HoverSkill('Woodcutting', false);
Wait(2453+random(432));
End;

1:
PickUpMouse;

2:
Begin;
MakeCompass('N');
Wait(100 + random(133));
MakeCompass('S');
Wait(50+random(133));
MakeCompass('N');
End;
End;
End;

begin;
SetUpSRL;
ActivateClient;
DeclarePlayers;
ChopTree;
end.

Gaston7eze

2011-12-21 15:41:10

From: YoHoJo
copy/paste it here.
Put simba tags around it.


Sorry i dont understand,what are you refering when you say "Tags"?

RISK

2011-12-21 15:41:47

code here[*/simba]

Remove the asterisk.

Gaston7eze

2011-12-21 15:43:38

From: RISK
code here[*/simba]

Remove the asterisk.


Okk,ok,thanks!
Begin;
HoverSkill('Woodcutting',false)
Wait(2453+random(432));
End;
Begin
1:PickUpMouse;
2: Wait(100);
End
Begin;
MakeCompass('N');
Wait(100+random(133);
MakeCompass('S');
Wait(50+random(133);
MakeCompass('N')
End;
End;

YoHoJo

2011-12-21 15:44:22

Post entire thing.
I don't see you calling the Case Random(8) of aymore, where did that line go?!

Gaston7eze

2011-12-21 16:01:16

From: YoHoJo
Post entire thing.
I don't see you calling the Case Random(8) of aymore, where did that line go?!


program New;
{.include srl/srl.scar}

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;
Procedure ChopTree;
Var x,y: Integer;
Begin
If FindObj(x,y,'hop',1785912, 35)Then
Mouse(x,y,0,0, False);
ChooseOption('Hop')
Repeat
Wait(1200+random(250));
Until not IsUpText('yew')or InvFull
End;
Procedure AntiBan;
Begin
If(Not LoggedIn)then
Exit;
Case Random(8)of
0:
End
Begin
HoverSkill('Woodcutting',false)
Wait(2453+random(432));
End;
Begin
1: PickUpMouse;
2: Wait(100);
End
Begin
MakeCompass('N');
Wait(100+random(133);
MakeCompass('S');
Wait(50+random(133);
MakeCompass('N')
End;
End;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
ChopTree;
end.

Gaston7eze

2011-12-21 17:00:38

program New;
{.include srl/srl.scar}

Procedure DeclarePlayers;
begin;
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;
Procedure ChopTree;
Var x,y: Integer;
Begin;
If FindObj(x,y,'hop',1785912, 35)Then
Mouse(x,y,0,0, False);
ChooseOption('Hop')
Repeat
Wait(1200+random(250));
Until not IsUpText('yew')or InvFull
End;
Procedure AntiBan;
Begin;
If(Not LoggedIn)then
Exit;
Case Random(8)of
0:
End
Begin;
HoverSkill('Woodcutting',false)
Wait(2453+random(432));
End;
Begin
1: PickUpMouse;
2: Wait(100);
End
Begin;
MakeCompass('N');
Wait(100+random(133);
MakeCompass('S');
Wait(50+random(133);
MakeCompass('N')
End;
End;

begin;
SetUpSRL;
ActivateClient;
DeclarePlayers;
ChopTree;
end.
Whats the error here?:fiery:

YoHoJo

2011-12-21 17:04:35

BORH!
This is like the 3rd thread about the same script. KEEP IT IN 1 THREAD!
ALSO! I'm going to not answer any more after this until you standardize (properly space) your code! It makes me eyes sore! Read my responces on last thread, learn how to standardize code, look up a tutorial on how!

Standarizeing will also help YOU figure out all of these errors, most are forgotten/extra begin/ends.

MERGING THREADS!


Procedure AntiBan;
Begin;
If(Not LoggedIn)then
Exit;
Case Random(8)of
0:
Begin;
HoverSkill('Woodcutting',false)
Wait(2453+random(432));
End;
1: PickUpMouse;
2: Wait(100);
End;
Begin;
MakeCompass('N');
Wait(100+random(133));
MakeCompass('S');
Wait(50+random(133));
MakeCompass('N')
End;
End;

Gaston7eze

2011-12-21 17:07:31

From: YoHoJo
BORH!
This is like the 3rd thread about the same script. KEEP IT IN 1 THREAD!
ALSO! I'm going to not answer any more after this until you standardize (properly space) your code! It makes me eyes sore! Read my responces on last thread, learn how to standardize code, look up a tutorial on how!

Standarizeing will also help YOU figure out all of these errors, most are forgotten/extra begin/ends.

MERGING THREADS!


Procedure AntiBan;
Begin;
If(Not LoggedIn)then
Exit;
Case Random(8)of
0:
Begin;
HoverSkill('Woodcutting',false)
Wait(2453+random(432));
End;
1: PickUpMouse;
2: Wait(100);
End;
Begin;
MakeCompass('N');
Wait(100+random(133));
MakeCompass('S');
Wait(50+random(133));
MakeCompass('N')
End;
End;

Yeah,i know,but if noone answer,what should i do?Wait until my thread goes down hill and noone answer me?

Kyle Undefined

2011-12-21 17:15:02

Yes, and in the meantime you keep trying new things. Then, after a few hours, no help comes, bump the thread.

Gaston7eze

2011-12-21 17:18:47

From: Kyle Undefined
Yes, and in the meantime you keep trying new things. Then, after a few hours, no help comes, bump the thread.


Ok,thanks man!