Log in

View Full Version : I need help with making my script running for a long time...PLEASE READ!



Ilikepie1995
06-15-2007, 03:13 PM
I need help making my script running for a long time well so it would do like at least 5-10 loads and so that all the randoms would work too.

program PieShafter;
{.include SRL/SRL.Scar}
{.include SRL/SRL/skill/WoodCutting.scar}
//Stand near a place with no oak's but only trees.
//Axe first inv.Spot.
//Knife second inv.Spot.
//And already have some shafts at forth inv.Spot!
//Have nothing at the third inv.spot!
const
AntiR = True; //Set to true if u want antirandoms.
Procedure LetsDebug;
begin
ClearDebug;
WriteLn('Thank you for using PieShafter.');
WriteLn('This is version 0.1.');
WriteLn('Running Time: ' + (TimeRunning) + '')
end;
Procedure CutTreeAndShaft;
begin
if FindColor(x,y,2252880,0,0,500,500)then
Mouse(x,y,3,3,false);
Wait(2000);
ChooseOption(x,y,'ree');
Wait(5000);
FindColor(x,y,3034726,660,227,664,230);
Mouse(x,y,4,4,true);
Wait(1000);
Mouse(627,224,3,3,true);
Wait(2000);
Mouse(72,409,4,4,true);
Wait(3000);
end;
Procedure QuickRands;
begin
if(not(AntiR))then
begin
exit;
end;
if(AntiR)then
begin
CloseWindow;
Wait(10);
FindTalk;
Wait(10);
FindDead;
Wait(10);
FindMime;
Wait(10);
FindMaze;
Wait(10);
FindQuiz;
Wait(10);
FindScapeRune;
Wait(10);
ClickToContinue;
Wait(10);
FindTalk;
Wait(10+Random(50));
end;
end;
begin
SetupSRL;
CutTreeAndShaft;
LetsDebug;
end.

Please help me with it.

Bobarkinator
06-15-2007, 04:21 PM
You need failsafes so if something happens then the script will correct itself and keep going, also for randoms use the SRL antirandoms
FindNormalRandoms;

JAD
06-15-2007, 04:31 PM
Try studying some advanced/semi advanced people's scripts and see if you can make anything of them, and learn from them.

But I'd suggest reading as many tutorials as you can first. Try checking out my tutorial (links in sig) Learning the things to become a SRL member. That will teach you a LOT about the most important things used in scripting.

Hobbit
06-15-2007, 04:33 PM
So something like this..

program PieShafter;
{.include SRL/SRL.Scar}
{.include SRL/SRL/skill/WoodCutting.scar}
//Stand near a place with no oak's but only trees.
//Axe first inv.Spot.
//Knife second inv.Spot.
//And already have some shafts at forth inv.Spot!
//Have nothing at the third inv.spot!
var
a : integer;
const
AntiR = True; //Set to true if u want antirandoms.
Procedure LetsDebug;
begin
ClearDebug;
WriteLn('Thank you for using PieShafter.');
WriteLn('This is version 0.1.');
WriteLn('Running Time: ' + (TimeRunning) + '')
end;

Procedure CutTreeAndShaft;
begin
if FindColor(x,y,2252880,0,0,500,500)then
begin
Mouse(x,y,3,3,false);
Wait(2000);
ChooseOption(x,y,'ree');
Wait(5000);
FindColor(x,y,3034726,660,227,664,230);
Mouse(x,y,4,4,true);
Wait(1000);
Mouse(627,224,3,3,true);
Wait(2000);
Mouse(72,409,4,4,true);
Wait(3000);
end;
end;

begin
SetupSRL;
repeat
repeat
CutTreeAndShaft;
FindNormalRandoms;
a:= a + 1
until(a=10)
LetsDebug;
a:=0;
until(IsFKeyDown(12))
end.

Now it will repeat and debug ever 10 logs until you press F12.

Ilikepie1995
06-15-2007, 04:52 PM
Ok tnx jad, and also hobbit this is what i get from ur adding.
Line 46: [Error] (15166:1): Unknown identifier 'a' in script C:\Program Files\SCAR 2.03\Scripts\Fletchers\PieShafter.scar
Sorry for double post.

JAD
06-15-2007, 06:14 PM
Ok tnx jad, and also hobbit this is what i get from ur adding.
Line 46: [Error] (15166:1): Unknown identifier 'a' in script C:\Program Files\SCAR 2.03\Scripts\Fletchers\PieShafter.scar
Sorry for double post.

You didn't double post. Double posting is when you post 2 times in a row, without anybody responding between there :p

And you need to declare a as a variable like


var a: Integer;

Hobbit
06-16-2007, 12:45 AM
var
a : integer;



I did declaire it..

JAD
06-16-2007, 12:51 AM
I did declaire it..

Oh.. My bad :p Maybe he didn't type that in though? IDK if he copied and pasted what you put, so that may be it, he missed it.