View Full Version : My first script,but,i have one problem.
Gaston7eze
12-21-2011, 07:22 PM
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
12-21-2011, 07:32 PM
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
12-21-2011, 07:36 PM
I will try out,its a noobish account so i dont care.!Thanks for the advice!
Gaston7eze
12-21-2011, 07:37 PM
Someone took it.LOL.Come on guys.
supersain
12-21-2011, 07:42 PM
check your inbox
Gaston7eze
12-21-2011, 07:50 PM
Thanks,
There correction that sahibis made dont solve the problem,someone ?
Jhangir
12-21-2011, 07:54 PM
Isnt this the script posted in the tutorial section?
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
12-21-2011, 07:59 PM
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
12-21-2011, 08:13 PM
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
12-21-2011, 08:19 PM
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
12-21-2011, 08:25 PM
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
12-21-2011, 08:35 PM
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
12-21-2011, 08:37 PM
copy/paste it here.
Put simba tags around it.
Brandon
12-21-2011, 08:40 PM
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
12-21-2011, 08:41 PM
copy/paste it here.
Put simba tags around it.
Sorry i dont understand,what are you refering when you say "Tags"?
[simba]code here[*/simba]
Remove the asterisk.
Gaston7eze
12-21-2011, 08:43 PM
[simba]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
12-21-2011, 08:44 PM
Post entire thing.
I don't see you calling the Case Random(8) of aymore, where did that line go?!
Gaston7eze
12-21-2011, 09:01 PM
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
12-21-2011, 10:00 PM
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
12-21-2011, 10:04 PM
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
12-21-2011, 10:07 PM
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
12-21-2011, 10:15 PM
Yes, and in the meantime you keep trying new things. Then, after a few hours, no help comes, bump the thread.
Gaston7eze
12-21-2011, 10:18 PM
Yes, and in the meantime you keep trying new things. Then, after a few hours, no help comes, bump the thread.
Ok,thanks man!
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.