SRL Archive - Help and Support

Quick and incredably stupid question


thanatos920

2007-01-14 02:00:08

Making a pretty useless script, for a friend to get a ton of bronze arrows on tutorial island ( i know useless since you can't keep em, don't ask), but I've run into the dumbest problem I have no idea how to make procedures repeat X number of times, heres my scritp thus far.

//Thana's Bronze arrow getter//
//Scripted using the latest version of SRL//
//Download it from villu-reborn.com//
//Complete the setup Between lines 12 and 13//

Program BronzeArrowGetter;
{.include SRL/SRL.scar}
{.include SRL/SRL/Extended/Xobject.scar}

//Setup//
Const
BronzeArrows = 1347504;
VennakkaShirt = 1710621;

//Notice the ONLY time you should ever change one of the above COlORS is if//
//The script tells you it cannot see THE SPECIFIC THING//
//EXAMPLE:If it says, Cannot find bronze arrows, ONLY MODIFY THE COLOR FOR BRONZE ARROWS//
//These are generic colors, and it should never mess up on any of them//


//No need to do anything bellow this line, attempting to do so will mess up the script//
//---------------------------------------------------------------------------//
Procedure ClickVennakka;
begin
Wait(800+random(400))
if(FindColorSpiralTolerance(x,y,VennakkaShirt,9,64,478,360,15))then
Begin
Mouse(x,y,0,0,true);
end else
writeln('cant find Vennakka,try widening your box')
End;

Procedure PickupArrows;
Begin
Wait(500);
if FindObj(x,y,'Take',BronzeArrows,20) then
begin
mouse(x,y,1,1,true)
End else
Writeln('Cant find the arrows try and change the color')
end;

//Main Loop//
Begin
setupsrl; SymbolAccuracy:=0;
DisguiseScar('Runescape - the massive online adventure game by Jagex Ltd.');
ActivateClient;
PerfectNorth;
Repeat
Dropitem(1);
ClickVennakka;
//NEED THE ABOVE TWO PROCEDURES TO REPEAT SIX TIMES BEFORE CONTINUING TO BELLOW//
PickupArrows;
End.



Basic questions really, how to get those procedures (Dropitem(1) and ClickVennakka) to repeat 6 times before moving on to do PickUpArrows. Also if I defined a constant at the top as TimesToRun, in the setup, where the user could specify how many times they wanted the script to repeat, how would I make my main loop of

Dropitem(1);
ClickVennakka;
Repeat 6 times
PickupArrows

Repeat TimesToRun times. this is my biggest problem with scripting, I have no clue how to repeat unless I'm using colors, IE Repeat Until(SOMETHING=false), meh if anyone could explain it would be much appreciated I can't find it in any tuts.

Hobbit

2007-01-14 02:07:16

not sure if this will work cause I dont got any1 on tut island to test on but I modified it a bit so hopefully it will repeat…oh and btw…i have no idea why but they tell me ur not supposed to capitalize bolded words so i changed for you;)

//Thana's Bronze arrow getter//
//Scripted using the latest version of SRL//
//Download it from villu-reborn.com//
//Complete the setup Between lines 12 and 13//

program BronzeArrowGetter;
{.include SRL/SRL.scar}
{.include SRL/SRL/Extended/Xobject.scar}
var
click : integer;

//Setup//
const
BronzeArrows = 1347504;
VennakkaShirt = 1710621;
Repeatamount = 6;
//Notice the ONLY time you should ever change one of the above COlORS is if//
//The script tells you it cannot see THE SPECIFIC THING//
//EXAMPLE:If it says, Cannot find bronze arrows, ONLY MODIFY THE COLOR FOR BRONZE ARROWS//
//These are generic colors, and it should never mess up on any of them//


//No need to do anything bellow this line, attempting to do so will mess up the script//
//---------------------------------------------------------------------------//
procedure ClickVennakka;
begin
Wait(800+random(400))
if(FindColorSpiralTolerance(x,y,VennakkaShirt,9,64,478,360,15))then
begin
Mouse(x,y,0,0,true);
end else
writeln('cant find Vennakka,try widening your box')
click:= click + 1;
end;

procedure PickupArrows;
begin
Wait(500);
if FindObj(x,y,'Take',BronzeArrows,20) then
begin
mouse(x,y,1,1,true)
end else
Writeln('Cant find the arrows try and change the color')
end;

//Main Loop//
begin
setupsrl; SymbolAccuracy:=0;
DisguiseScar('Runescape - the massive online adventure game by Jagex Ltd.');
ActivateClient;
PerfectNorth;
repeat
Dropitem(1);
ClickVennakka;
until(click = Repeatamount);
//NEED THE ABOVE TWO PROCEDURES TO REPEAT SIX TIMES BEFORE CONTINUING TO BELLOW//
PickupArrows;
End.

Edit: i didnt see the rest of stuff at bottom…so this one should repeat the main loop that u mentioned u wanted in second part of post

//Thana's Bronze arrow getter//
//Scripted using the latest version of SRL//
//Download it from villu-reborn.com//
//Complete the setup Between lines 12 and 13//

program BronzeArrowGetter;
{.include SRL/SRL.scar}
{.include SRL/SRL/Extended/Xobject.scar}
var
click : integer;
click2 : integer;

//Setup//
const
BronzeArrows = 1347504;
VennakkaShirt = 1710621;
Runamount=2;
Repeatamount = 6;//dont touch
//Notice the ONLY time you should ever change one of the above COlORS is if//
//The script tells you it cannot see THE SPECIFIC THING//
//EXAMPLE:If it says, Cannot find bronze arrows, ONLY MODIFY THE COLOR FOR BRONZE ARROWS//
//These are generic colors, and it should never mess up on any of them//


//No need to do anything bellow this line, attempting to do so will mess up the script//
//---------------------------------------------------------------------------//
procedure ClickVennakka;
begin
Wait(800+random(400))
if(FindColorSpiralTolerance(x,y,VennakkaShirt,9,64,478,360,15))then
begin
Mouse(x,y,0,0,true);
end else
writeln('cant find Vennakka,try widening your box')
click:= click + 1;
end;

procedure PickupArrows;
begin
Wait(500);
if FindObj(x,y,'Take',BronzeArrows,20) then
begin
mouse(x,y,1,1,true)
end else
Writeln('Cant find the arrows try and change the color')
end;

//Main Loop//
begin
setupsrl; SymbolAccuracy:=0;
DisguiseScar('Runescape - the massive online adventure game by Jagex Ltd.');
ActivateClient;
PerfectNorth;
repeat
repeat
Dropitem(1);
ClickVennakka;
until(click = Repeatamount);
//NEED THE ABOVE TWO PROCEDURES TO REPEAT SIX TIMES BEFORE CONTINUING TO BELLOW//
PickupArrows;
click2:= click2 + 1;
until(click2 = Runamount);
End.

thanatos920

2007-01-14 02:50:56

Thanks a ton mate, sort of worked, I took Click out of vennakka's procedure and added it to the repeat in the main loop just before the until, but you taught me how to repeat procedures, thanks a ton mate :)

EDIT:

Ok say I wanted to randomize this a bit, and make it repeat until

instead of repeatamount=6
repeatamount=1+random(5)

If i put it in main loop it goes on for infinity help pl0z

Hobbit

2007-01-14 03:12:13

that should work….ok post the script u added the randoms in cause i dont quite get what u mean