Log in

View Full Version : problems with my script



insidethefire666
05-30-2012, 02:06 AM
[Error] (29:3): Type mismatch at line 28
Compiling failed.
this is what I have at line 28 is the thing i can't seem to figure out what's going wrong and I am new to scripting so tips are really appreciated

with Players[0] do

CephaXz
05-30-2012, 02:07 AM
Post the whole script.

And put in simba tags.

YoHoJo
05-30-2012, 02:09 AM
Post entire script in simba tags and we can better help.
Often times error and just a single line alone aren't enough.

insidethefire666
05-30-2012, 02:10 AM
its funny you post here yohojo i am using your video tutorial to help me with this script i have had a few problems but worked through many of them i will post now i followed almost all of the steps i seen in your tutorial except i am getting WAY more errors than i seen in the video your first was at line 83 mine were way before that


program insidethefires_MULTI_chopper;
{$DEFINE SMART}
{$DEFINE SimbaDebug}
{$i srl/srl.simba}




const
SRLStats_Username= ''; // your username
SRLStats_Password= ''; // your password
BreakEvery= ''; // however many minutes your going to break for after
BreakFor= ''; // how long you want that break to be
NumbOfPlayers= 1; //this is how many players your using
StartPlayer= 0; // what players you are starting with
Version= '1'; // Leave this alone it's my script don't change it



procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ('Xp')

with Players[0] do
begin
Name := ''; // Player Username
Pass := ''; // this is your pass
Pin := ''; // your pin if you have one if not leave blank
Active := True; //leave at true
Integers[1] := 1; //1 for Yews,2 for magics,3,for willows,4 for oaks
Integers[2] := 4; // this is how long it waits before chopping another tree
end;




End;





Procedure StatsGuise (wat.String);
Begin
Status (wat);
Disguise (wat);
end;

Function CheckAndClick(Uptext:String; X,Y:Interger; Stronger;Boolean):Boolean;
Begin
MMouse (x, y, 5, 5) ;
If WaitUPtext (UpText, 1500+Random(500)) Then
Begin
Result:=True;
GetMousePos(x,y)
If RClick Then
Begin
Mouse(x, y, 0, 0, False);
Result:=WaitOption(Option, 2000);
If Result FFlag (0);
End Else
Begin
Mouse(x, y, 0, 0,True);
Wait(100+Random(50));
Flag(0);
End;
End;
End;

Procedure AntiBan;
Begin
Case Random(250) Of
0 Begin StatsGuise ('AntiBan') GameTab(Tab_Stats) HoverSkill ;'Magic, False) GamaTab(28) End;
1 Begin StatsGuise ('AntiBan') SleepAndMoveMouse(1000)+ Random(250)); End;
2 Begin StatsGuise ('AntiBan') GameTab(Tab_Inv) ExamineInv GamaTab(20); End;
3 Begin StatsGuise ('AntiBan') RandomAngle=(1); End;
4 Begin StatsGuise ('AntiBan') GameTab (Tab_Stats) ; Wait(1000 + Random(250)); GamaTab(28) End;
5 Begin StatsGuise ('AntiBan') GameTab (Tab_Stats) HoverSkill('random', false); GamaTab(28) End;
End;
End;

Procedure FailSafe;
Begin
Players(CurrentPlayer).Loc=Reason;
Logout;
Stats_Commit;
ProgressReport;
Teriminate Scipt
End;
Procedure ChopTree;
var x, y: Integer;
begin
//FindObjCustom(x, y, ['att', 'ack''a'], [12346, 35678], 5); this is for attack
if FindObjCustom(x, y, ['Chop', 'down' 'p d'], [1713699, 2108458, 1844516], 30) Then
WriteIn('Found tree');
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
repeat
Wait(1200+random(250));
Until not IsUpText('ew') or (InvFull);
End;



Begin


SetupSRL;
DeclarePlayers;
Repeat
ChopDown
Until(False);

End;

YoHoJo
05-30-2012, 02:15 AM
I'm on a phone right now by try putting a semicolon after
Players[i].BoxRewards := ('Xp')

Also, when posting code please put it in simba tags.
(click the button on the forums that looks like simba head(sometimes you need to click 'go advanced' under a post to see it), and then paste the code in between the tags.

insidethefire666
05-30-2012, 02:21 AM
[Error] (27:39): Type mismatch at line 26
Compiling failed.
Players[i].BoxRewards := ('Xp');

that was what i got from adding a semi colon

YoHoJo
05-30-2012, 02:24 AM
Pretty sure those parenthesis need to be brackets.


You can actually just remove the lines
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ('Xp')

insidethefire666
05-30-2012, 02:25 AM
around the exp? i was thinking that myself

insidethefire666
05-30-2012, 02:26 AM
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['Xp']

;with Players[0] do

this is what i did to fix this error in particular

insidethefire666
05-30-2012, 02:28 AM
Procedure StatsGuise (wat.String)
Begin
Status (wat);
Disguise (wat);
end;

[Error] (48:26): colon (':') expected at line 47
Compiling failed.

this is my new error now

YoHoJo
05-30-2012, 02:29 AM
So that error is fixed ?
Also, learn to use simba tags please!
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['Xp'];
with Players[0] do

riwu
05-30-2012, 02:31 AM
Fix some spelling/punctuation mistakes, try this:

program insidethefires_MULTI_chopper;
{$DEFINE SMART}
{$DEFINE SimbaDebug}
{$i srl/srl.simba}




const
SRLStats_Username= ''; // your username
SRLStats_Password= ''; // your password
BreakEvery= ''; // however many minutes your going to break for after
BreakFor= ''; // how long you want that break to be
NumbOfPlayers= 1; //this is how many players your using
StartPlayer= 0; // what players you are starting with
Version= '1'; // Leave this alone it's my script don't change it



procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['Xp'];

with Players[0] do
begin
Name := ''; // Player Username
Pass := ''; // this is your pass
Pin := ''; // your pin if you have one if not leave blank
Active := True; //leave at true
Integers[1] := 1; //1 for Yews,2 for magics,3,for willows,4 for oaks
Integers[2] := 4; // this is how long it waits before chopping another tree
end;




End;





Procedure StatsGuise (wat:String);
Begin
Status (wat);
Disguise (wat);
end;

Function CheckAndClick(Uptext:String; X,Y:Integer; Stronger:Boolean):Boolean;
Begin
MMouse (x, y, 5, 5) ;
If WaitUPtext (UpText, 1500+Random(500)) Then
Begin
Result:=True;
GetMousePos(x,y)
If RClick Then
Begin
Mouse(x, y, 0, 0, False);
Result:=WaitOption(Option, 2000);
If Result FFlag (0);
End Else
Begin
Mouse(x, y, 0, 0,True);
Wait(100+Random(50));
Flag(0);
End;
End;
End;

Procedure AntiBan;
Begin
Case Random(250) Of
0 Begin StatsGuise ('AntiBan') GameTab(Tab_Stats) HoverSkill ;'Magic, False) GamaTab(28) End;
1 Begin StatsGuise ('AntiBan') SleepAndMoveMouse(1000)+ Random(250)); End;
2 Begin StatsGuise ('AntiBan') GameTab(Tab_Inv) ExamineInv GamaTab(20); End;
3 Begin StatsGuise ('AntiBan') RandomAngle=(1); End;
4 Begin StatsGuise ('AntiBan') GameTab (Tab_Stats) ; Wait(1000 + Random(250)); GamaTab(28) End;
5 Begin StatsGuise ('AntiBan') GameTab (Tab_Stats) HoverSkill('random', false); GamaTab(28) End;
End;
End;

Procedure FailSafe;
Begin
Players(CurrentPlayer).Loc=Reason;
Logout;
Stats_Commit;
ProgressReport;
Teriminate Scipt
End;
Procedure ChopTree;
var x, y: Integer;
begin
//FindObjCustom(x, y, ['att', 'ack''a'], [12346, 35678], 5); this is for attack
if FindObjCustom(x, y, ['Chop', 'down' 'p d'], [1713699, 2108458, 1844516], 30) Then
WriteIn('Found tree');
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
repeat
Wait(1200+random(250));
Until not IsUpText('ew') or (InvFull);
End;



Begin


SetupSRL;
DeclarePlayers;
Repeat
ChopDown
Until(False);

End;


there is an unknown identifier "RClick" which i dont know what u are actually trying to type (DidRedClick?), so it still wont compile.

Runaway
05-30-2012, 02:32 AM
This is definitely an issue:


Procedure StatsGuise (wat.String); // . instead of :
Begin
Status (wat); // extra space in between vars and procedure
Disguise (wat); // and here
end;

insidethefire666
05-30-2012, 02:34 AM
i corrected the . instead of : already but glad you mentioned it and i was meaning for it to random right click

insidethefire666
05-30-2012, 02:39 AM
riwu thanks for the punctuation error fixes and everything that got me up to line 60 fixing the right click thing

insidethefire666
05-30-2012, 02:46 AM
fixed the RClick it was supposed to be If Stronger Than it must have gotten messed up when i was copy and pasting different pieces together of the script i wrong it was supposed to be a anti ban procedure RandomRClick

YoHoJo
05-30-2012, 02:50 AM
What? Lol :)
You all good now?

insidethefire666
05-30-2012, 02:59 AM
i'm still having problems but i'm getting to the point where if i keep going on i'm gonna get fustrated and say fuck it i still got a lot of the debugging done and scripting done today so i'm gonna set this down for today go smoke a bowl and chill out and think about what i might be doing wrong if your on tomorrow yohojo can you lend me a hand as well

Runaway
05-30-2012, 03:01 AM
so i'm gonna set this down for today go smoke a bowl and chill out and think about what i might be doing wrong

That's the best kind of debugging ;)

insidethefire666
05-30-2012, 03:04 AM
especially medicinal quality debugging lol

insidethefire666
05-30-2012, 03:19 AM
Yohojo i'm back for a while now can you help me out some more with it!

insidethefire666
05-30-2012, 03:22 AM
Result:=WaitOption(Option, 1000);

[Error] (64:22): Unknown identifier 'Option' at line 63
Compiling failed.


this is new problem now

CephaXz
05-30-2012, 03:26 AM
WaitOption('Option', 1000);

Runaway
05-30-2012, 03:27 AM
Result:=WaitOption(Option, 1000);

[Error] (64:22): Unknown identifier 'Option' at line 63
Compiling failed.


this is new problem now


Function CheckAndClick(Uptext, Option:String; X,Y:Integer; Stronger:Boolean):Boolean;
// ^ you have to declare option as a var in your function
Begin
MMouse (x, y, 5, 5) ;
If WaitUPtext (UpText, 1500+Random(500)) Then // remove spaces between function and vars!
Begin
Result:=True;
GetMousePos(x,y)
If RClick Then
Begin
Mouse(x, y, 0, 0, False);
Result:=WaitOption(Option, 2000);
If Result FFlag (0); // remove space!
// ^ you have an if but no then
End Else
Begin
Mouse(x, y, 0, 0,True);
Wait(100+Random(50));
Flag(0);
End;
End;
End;

insidethefire666
05-30-2012, 03:38 AM
WaitUpText is a function then (UpText, 1500+Random(500)) is a variable i seen now thank you for teaching me that because waituptext is the same no matter how it functions but the uptext waiting part plus the time and the random is the variable that you can change where do I declare a variable like you said

insidethefire666
05-30-2012, 03:41 AM
i corrected the than to then before you posted it as well seen my error they are all direct statements and commands i am getting the hang of scripting without even watching the tutorial and learning a lot more this way

Runaway
05-30-2012, 03:45 AM
I added it into the function declaration in my previous post:


Function CheckAndClick(Uptext,Option:String; X,Y:Integer; Stronger:Boolean):Boolean;


That way, when you call the function later in the script, you can use whatever uptext/option is necessary:


CheckAndClick('booth', 'bank', x, y, True);

insidethefire666
05-30-2012, 03:53 AM
so with that it can clickandcheck find the bank and click and select it? for later and to declare it a variable i put option in the quotes as string?

insidethefire666
05-30-2012, 03:57 AM
I KNOW COMPLETELY WHY THE BASIS OF MY SCRIPT WAS WRONG THE TUTORIAL GUIDE WAS BASED OFF A SCRIPT WITH Anti leeeching!!! it has a lotta basic errors eg GamaTab instead of GameTab and it's mixed and matched

insidethefire666
05-30-2012, 04:07 AM
Begin
Players[CurrentPlayer] .Loc= Reason;
Logout;
Stats_Commit;
//ProgressReport;
Teriminate Scipt

[Error] (90:32): Unknown identifier 'Reason' at line 89
Compiling failed.

need help on this one too

insidethefire666
05-30-2012, 04:18 AM
BOOM GOT IT declared the variable

insidethefire666
05-30-2012, 05:39 PM
Procedure ChopDown:Boolean;


[Error] (96:19): Semicolon (';') expected at line 95
Compiling failed.

getting this error however when i change it to a semi colon this comes up

[Error] (96:20): 'BEGIN' expected at line 95
Compiling failed.

insidethefire666
05-30-2012, 05:50 PM
Procedure ChopDown
var x, y: Integer;
begin
//FindObjCustom(x, y, ['att', 'ack''a'], [12346, 35678], 5); this is for attack
if FindObjCustom(x, y, ['Chop', 'down' 'p d'], [1713699, 2108458, 1844516], 30) Then
WriteIn('Found tree');
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
repeat
Wait(1200+random(250));
Until not IsUpText('ew') or (InvFull);
End;


THIS IS WHERE I AM HAVING TROUBLE NOW NEED HELP

CephaXz
05-30-2012, 05:52 PM
After a procedure name, you must put a semi colon.

Procedure ChopDown;

Only function will return something, such as boolean.

Function ChopDown :Boolean;

insidethefire666
05-30-2012, 06:00 PM
when i do Function ChopDown:Boolean; it tells me a semicolon was still expected before Boolean and if I add a semi colon it tells me that Begin was expected before Boolean
[Error] (96:20): 'BEGIN' expected at line 95
Compiling failed.
[Error] (96:19): Semicolon (';') expected at line 95
Compiling failed.

YoHoJo
05-30-2012, 06:00 PM
If you're referring to my tutorial, thee is no antileech in it.

insidethefire666
05-30-2012, 06:01 PM
Well then I must have misinterpreted some of my spelling errors as an anti leech because I guess my spelling errors could have been used as an anti leech lol.

CephaXz
05-30-2012, 06:01 PM
when i do Function ChopDown:Boolean; it tells me a semicolon was still expected before Boolean and if I add a semi colon it tells me that Begin was expected before Boolean
[Error] (96:20): 'BEGIN' expected at line 95
Compiling failed.
[Error] (96:19): Semicolon (';') expected at line 95
Compiling failed.

You probably missed out a begin before that procedure/function, or an extra end. You should post the whole script in simba tags, and in good standards which is shown in Yohojo's video. I used to follow his video tuts once, and I never had a problem other than some codes being outdated.

insidethefire666
05-30-2012, 06:07 PM
program insidethefires_MULTI_chopper;
{$DEFINE SMART}
{$DEFINE SimbaDebug}
{$i srl/srl.simba}

//var
///Loads: Integer //whole number
//Done: Boolean //true or false
//LongNumbers: Extended Integers with decimal basis

const
SRLStats_Username= ''; // your username
SRLStats_Password= ''; // your password
BreakEvery= ''; // however many minutes your going to break for after
BreakFor= ''; // how long you want that break to be
NumbOfPlayers= 1; //this is how many players your using
StartPlayer= 0; // what players you are starting with
Version= '1'; // Leave this alone it's my script don't change it



procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['Xp'];

with Players[0] do
begin
Name := ''; // Player Username
Pass := ''; // this is your pass
Pin := ''; // your pin if you have one if not leave blank
Active := True; //leave at true
Integers[1] := 1; //1 for Yews,2 for magics,3,for willows,4 for oaks
Integers[2] := 4; // this is how long it waits before chopping another tree
end;




End;





Procedure StatsGuise (wat:String);
Begin
Status (wat);
Disguise (wat);
end;

Function CheckAndClick(Uptext:String; Option:String; X,Y:Integer; RClick:Boolean):Boolean;
Begin
MMouse (x, y, 5, 5) ;
If WaitUPtext(UpText, 1000+Random(250)) Then
Begin
Result:=True;
GetMousePos(x,y)
If RClick Then
Begin
Mouse(x, y, 0, 0, False);
Result:=WaitOption(Option, 1000);
If Result Then FFlag(0);
End Else
Begin
Mouse(x, y, 0, 0,True);
Wait(100+Random(50));
FFlag(0);
End;
End;
End;

Procedure AntiBan;
Begin
Case Random(250) Of
0: Begin StatsGuise ('AntiBan') GameTab(Tab_Stats) HoverSkill('Magic', False); GameTab(28) End;
1: Begin StatsGuise ('AntiBan') SleepAndMoveMouse((750)+ Random(250)); End;
2: Begin StatsGuise ('AntiBan') RandomAngle(1); End;
3: Begin StatsGuise ('AntiBan') GameTab (Tab_Stats) ; Wait(750 + Random(250)); GameTab(28) End;
4: Begin StatsGuise ('AntiBan') GameTab (Tab_Stats) HoverSkill('random', false); GameTab(28) End;
End;
End;

Procedure FailSafe(Reason:String);
Begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
//ProgressReport;
TerminateScript;
End;


Procedure ChopDown: Boolean;
Var
x, y: Integer;
Begin
//FindObjCustom(x, y, ['att', 'ack''a'], [12346, 35678], 5); this is for attack
if FindObjCustom(x, y, ['Chop', 'down' 'p d'], [1713699, 2108458, 1844516], 30) Then
WriteIn('Found tree');
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
repeat
Wait(1200+random(250));
Until not IsUpText('ew') or (InvFull);
End;



Begin


SetupSRL;
DeclarePlayers;
Repeat
ChopDown
Until(False);

End;


this is what it is right now and im getting that error still

CephaXz
05-30-2012, 06:08 PM
I mean the entire script, not just the procedure.

And your procedure just returned a boolean.

insidethefire666
05-30-2012, 06:28 PM
I removed the boolean from after the chopdown and it fixed that error i dunno if it needs to be there but yeah. and now im

insidethefire666
05-30-2012, 06:43 PM
Procedure ChopDown;
Var
x, y: Integer; WriteIn: String;
Begin
//FindObjCustom(x, y, ['att', 'ack''a'], [12346, 35678], 5); this is for attack
if FindObjCustom(x, y, ['Chop', 'down', 'p d'], [1713699, 2108458, 1844516], 30) Then
WriteIn:('Found tree');
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
repeat
Wait(1200+random(250));
Until not IsUpText('ew') or (InvFull);
End;


[Error] (104:8): Assignment expected at line 103
Compiling failed.
for the WriteIn: ('Found Tree')

insidethefire666
05-30-2012, 06:45 PM
Procedure ChopDown;
Var
x, y: Integer; WriteIn: String;
Begin
//FindObjCustom(x, y, ['att', 'ack''a'], [12346, 35678], 5); this is for attack
if FindObjCustom(x, y, ['Chop', 'down', 'p d'], [1713699, 2108458, 1844516], 30) Then
WriteIn:('Found tree');
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
repeat
Wait(1200+random(250));
Until not IsUpText('ew') or (InvFull);
End;


[Error] (104:8): Assignment expected at line 103
Compiling failed.
for the WriteIn: ('Found Tree')

CephaXz
05-30-2012, 06:46 PM
WriteLn('Found tree');

No : in between. And should be WRITELN, which is WriteLn

insidethefire666
05-30-2012, 06:49 PM
ok and thank you for helping me as i go along once i have the basics down for this script i want to tweak them and turn it into an autofighter with banking instead of chopping with banking

insidethefire666
05-30-2012, 06:50 PM
program insidethefires_MULTI_chopper;
{$DEFINE SMART}
{$DEFINE SimbaDebug}
{$i srl/srl.simba}

//var
///Loads: Integer //whole number
//Done: Boolean //true or false
//LongNumbers: Extended Integers with decimal basis := it's value
//Text: String '' to declare a string
const
SRLStats_Username= ''; // your username
SRLStats_Password= ''; // your password
BreakEvery= ''; // however many minutes your going to break for after
BreakFor= ''; // how long you want that break to be
NumbOfPlayers= 1; //this is how many players your using
StartPlayer= 0; // what players you are starting with
Version= '1'; // Leave this alone it's my script don't change it



procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['Xp'];

with Players[0] do
begin
Name := ''; // Player Username
Pass := ''; // this is your pass
Pin := ''; // your pin if you have one if not leave blank
Active := True; //leave at true
Integers[1] := 1; //1 for Yews,2 for magics,3,for willows,4 for oaks
Integers[2] := 4; // this is how long it waits before chopping another tree
end;




End;





Procedure StatsGuise (wat:String);
Begin
Status (wat);
Disguise (wat);
end;

Function CheckAndClick(Uptext:String; Option:String; X,Y:Integer; RClick:Boolean):Boolean;
Begin
MMouse (x, y, 5, 5) ;
If WaitUPtext(UpText, 1000+Random(250)) Then
Begin
Result:=True;
GetMousePos(x,y)
If RClick Then
Begin
Mouse(x, y, 0, 0, False);
Result:=WaitOption(Option, 1000);
If Result Then FFlag(0);
End Else
Begin
Mouse(x, y, 0, 0,True);
Wait(100+Random(50));
FFlag(0);
End;
End;
End;

Procedure AntiBan;
Begin
Case Random(250) Of
0: Begin StatsGuise ('AntiBan') GameTab(Tab_Stats) HoverSkill('Magic', False); GameTab(28) End;
1: Begin StatsGuise ('AntiBan') SleepAndMoveMouse((750)+ Random(250)); End;
2: Begin StatsGuise ('AntiBan') RandomAngle(1); End;
3: Begin StatsGuise ('AntiBan') GameTab (Tab_Stats) ; Wait(750 + Random(250)); GameTab(28) End;
4: Begin StatsGuise ('AntiBan') GameTab (Tab_Stats) HoverSkill('random', false); GameTab(28) End;
End;
End;

Procedure FailSafe(Reason:String);
Begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
//ProgressReport;
TerminateScript;
End;


Procedure ChopDown;
Var
x, y: Integer; WriteIn: String;
Begin
//FindObjCustom(x, y, ['att', 'ack''a'], [12346, 35678], 5); this is for attack
if FindObjCustom(x, y, ['Chop', 'down', 'p d'], [1713699, 2108458, 1844516], 30) Then
WriteLn('Found tree');
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
repeat
Wait(1200+random(250));
Until not IsUpText('ew') or (InvFull);
End;


ALLL OF THIS IS NOW WORKINGG!!!! JUST NEED TO ADD A BANKING SYSTEM AND SET SRL UP TO DO AND AND ADD WALKING AND I DID IT!! which is probably a lot harder than i'm thinking it is but it's progress

CephaXz
05-30-2012, 06:52 PM
By then, you should learn something more complicated. With reading scripts from SRL members to see how they use codes to make very useful functions and how they write procedures efficiently. I don't think anyone would use FindObj after their first script. Everything can be learnt in the tutorial section. Good luck.

insidethefire666
05-30-2012, 06:57 PM
yeah I want to use TPA eventually and FindObjDtm but right now im into basics and ill probably need some more help so i'll keep posting on this thread so as not to make a duplicate

insidethefire666
05-31-2012, 03:43 AM
Program Insidethefires_MULTI_chopper;

{$DEFINE SMART}
{$i SRL\SRl.simba}



//var
///Loads: Integer //whole number
//Done: Boolean //true or false
//LongNumbers: Extended Integers with decimal basis := it's value
//Text: String '' to declare a string
const
SRLStats_Username= ''; // your username
SRLStats_Password= ''; // your password
BreakEvery= ''; // however many minutes your going to break for after
BreakFor= ''; // how long you want that break to be
LoadsTotal= ''; // how many loads you want to chop
NumbOfPlayers= 1; //this is how many players your using
StartPlayer= 0; // what players you are starting with
Version= '1'; // Leave this alone it's my script don't change it



procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['Xp'];

with Players[0] do
begin
Name := ''; // Player Username
Pass := ''; // this is your pass
Pin := ''; // your pin if you have one if not leave blank
Active := True; //leave at true
Integers[1] := 1; //1 for Yews,2 for magics,3,for willows,4 for oaks
Integers[2] := 4; // this is how long it waits before chopping another tree
end;




End;





Procedure StatsGuise (wat:String);
Begin
Status (wat);
Disguise (wat);
end;

Function CheckAndClick(Uptext:String; Option:String; X,Y:Integer; RClick:Boolean):Boolean;
Begin
MMouse (x, y, 5, 5) ;
If WaitUPtext(UpText, 1000+Random(250)) Then
Begin
Result:=True;
GetMousePos(x,y)
If RClick Then
Begin
Mouse(x, y, 0, 0, False);
Result:=WaitOption(Option, 1000);
If Result Then FFlag(0);
End Else
Begin
Mouse(x, y, 0, 0,True);
Wait(100+Random(50));
FFlag(0);
End;
End;
End;

Procedure AntiBan;
Begin
Case Random(250) Of
0: Begin StatsGuise ('AntiBan') GameTab(Tab_Stats) HoverSkill('Magic', False); GameTab(28) End;
1: Begin StatsGuise ('AntiBan') SleepAndMoveMouse((750)+ Random(250)); End;
2: Begin StatsGuise ('AntiBan') RandomAngle(1); End;
3: Begin StatsGuise ('AntiBan') GameTab (Tab_Stats) ; Wait(750 + Random(250)); GameTab(28) End;
4: Begin StatsGuise ('AntiBan') GameTab (Tab_Stats) HoverSkill('random', false); GameTab(28) End;
End;
End;

Procedure FailSafe(Reason:String);
Begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
//ProgressReport;
TerminateScript;
End;


Procedure ChopDown;
Var
x,y : Integer;
Begin
//FindObjCustom(x, y, ['att', 'ack''a'], [12346, 35678], 5); this is for attack
If FindObjCustom(x, y, ['Chop', 'down', 'Yew'], [1713699, 2108458, 1844516], 30) Then
WriteLn('Found tree');
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
repeat
Wait(1200+random(250));
Until IsUpText('ew') or (InvFull);
End;



Begin
SetupSRL;
DeclarePlayers;
Repeat
ChopDown
Until(False);

End.


Having trouble still this doesn't chop down the yew it just moves around the screen in a circle i need some help guys

riwu
05-31-2012, 03:50 AM
Whenever there is more than 1 action to be performed, use begin and end.
in ur script:
If FindObjCustom(x, y, ['Chop', 'down', 'Yew'], [1713699, 2108458, 1844516], 30) Then
WriteLn('Found tree');
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
this will always perform
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
even if the obj is not found.

Just add "begin" before the WriteLn and "end" after the ChooseOption.

Also is ur colortolerance of 30 a bit too high? it'd still work if there isn't any similar color around the area.

insidethefire666
05-31-2012, 03:54 AM
Begin
Wait(750+random(250)) or
IsUpText('ew') (InvFull);
Repeat;
End;


[Error] (115:16): Type mismatch at line 114
Compiling failed.


Fixed the other error and i tweaked this around some any ideas on what i'm doing wrong?

insidethefire666
05-31-2012, 03:56 AM
Double posted my bad laggy internet

riwu
05-31-2012, 04:02 AM
Begin
Wait(750+random(250)) or
IsUpText('ew') (InvFull);
Repeat;
End;


[Error] (115:16): Type mismatch at line 114
Compiling failed.


Fixed the other error and i tweaked this around some any ideas on what i'm doing wrong?
uhm..are u actually trying to do this:
if WaitUptext('ew') or InvFull then

YoHoJo
05-31-2012, 04:04 AM
Or only comes after if statements.
Read your code out loud and see if it makes any sense.

"wait or" naah!
But
If IsUoText() Or InvFull then

That makes sense.


I thunk you really need to slow down, go through the code line by line, make sure it's standardized/organized first, and then read to see if it makes sence logically.
First just think in human terms what you're trying to do, then figure out how to code it.
Imagine what you would do if you were playing, then turn it into code.

Slow down, relax, and code away!
If you are basing this off of my tutorial videos, pay closer attention to my code and make yours like mine. The code in the video works and compiles except for like updates in SRL simba.

Good luck.

insidethefire666
05-31-2012, 04:11 AM
i am doing this without the tutorial and free balling it off what i learned in the first 15 minutes of your video i want it to be a all hands on learning process not video instructed where i'm copying you I want some of my own touches and variances,