For my teleport script, I used findcolorspiraltolerance to pick a random pixel on the teleport button, so it wasnt always picking the same pixel. Is there a way to pick a random pixel in a pre-defined area?
Thanks guys
For my teleport script, I used findcolorspiraltolerance to pick a random pixel on the teleport button, so it wasnt always picking the same pixel. Is there a way to pick a random pixel in a pre-defined area?
Thanks guys
I'm sure there is but for teleporting I would recommend using a DTM and then when you use the mouse to move to it, you can just add some randomness. If you need any help with DTMs there are a few really great tutorials or I could help you out. Good luck with your script
Generally color finding such as findcolorspiraltolerance is used for finding objects and things on the main screen while DTMs and Bitmaps are used for finding stationary objects that do not change such as Items and spells
Mostly Inactive, School
Well this is my second day scripting, so I havnt even heard of DTM's, lol. Ill check out a few tutorials. One more thing. If I want to set my script to repeat the main loop X amount of times, how would I do that? right now I have
as my main loop. Thanks!begin
Repeat
Teleport;
Randoms;
until(false);
end.
Simba Code:var
runs, timesToRun: Integer;
begin
timesToRun := 100 + Random(50);
for runs := 0 to timesToRun do
begin
Teleport;
Randoms;
end;
end.
You'll use for..to..do (or for..downto..do) loop.
You can of course also add a variable for repeat loop, that needs to be increased with every run..
Example:
Simba Code:var
runsDone, maximumRuns: Integer;
begin
maximumRuns := 200;
repeat
Teleport;
Randoms;
Inc(runsDone); // ..or runsDone := runsDone + 1;
until (runsDone >= maximumRuns);
end.
Generally people use a repeat loop for the main loop such as.
And then you could just TerminateScript; or break out of the loop after X amount of casts or what everCode:Repeat mainloop; Until (Not LoggedIn)//Could change this to while has runes or something along those lines aswell
Edit: For loops are also useful![]()
Last edited by Based Lord; 06-22-2012 at 09:40 PM.
Mostly Inactive, School
Alright, thanks! i guess I'll ask one more question. Someone else helped me make this code for repeating camelot teleport. Pretty basic, but it should get by. However, when I run it, It opens the magic tab, which is before the repeating stuff, then starts to move very slowly towards the spell button. Why isnt it going straight there? Sorry if I'm asking noobish questions, i guess im a noob at this point, lol
EDIT: heres my script, probably should have included that
program CamTele;
{$i srl/srl.simba}
//Made for Epicbot
Procedure Start;
begin
movemouse(743, 452)
clickmouse(743, 452, 1)
end;
Procedure Teleport;
var
x, y:integer;
begin
repeat
if FindColorSpiralTolerance(x, y, 6102593, 674, 268, 694, 284, 10) then
begin
MMouse(x, y, 4, 4);
Mouse(x, y, 2, 2, 1);
wait(randomrange(2000, 2500));
end;
until(false);
end;
Procedure Randoms;
begin
if findnormalrandoms or findnoninventoryrandoms then
begin
logout;
terminatescript;
end;
end;
begin
Start
Repeat
Teleport;
Randoms;
until(false);
end.
Last edited by Footy; 06-22-2012 at 09:49 PM.
You need to put SetupSRL; into your script.
And you can also use mousebox for clicking the spell since the spell is always at a fixed position.
I gotta go, But I;ve posted my script. Ill reply later tonight
There are currently 1 users browsing this thread. (0 members and 1 guests)