SRL Archive - Research & Development Lounge

simple alching procedure


Awkwardsaw

2009-03-21 18:45:39

program New;
{.include SRL/SRL.scar}

const
anumber = 1000; //number of alchs
atype = true; // if high alching true, false if low alch


procedure alch(alchnumber: integer; highalch: boolean);
var
Counter : integer;

begin
if highalch = true then
repeat
GameTab(7);
mouse(575, 350, 0, 0, true);
wait(150+ random (200));
mouse(575, 350, 0, 0, true);
wait(2200+ random (100));
Counter:=counter+1;
until Counter= alchnumber;

if highalch = false then
repeat
GameTab(7);
mouse(856, 314, 0, 0, true);
wait(150+ random (200));
mouse(856, 314, 0, 0, true);
wait(2200+ random (100));
Counter:=counter+1;
until Counter= alchnumber;
end;

begin
alch(anumber, atype);
end.

i know, its simple, i wouldnt use it to be honest, but im bored and it i can always work on it later. every thing seems to be self explanitory.. type in the number of alchs you want to do as a const, and true if you want to high alch.

go ahead and use it, or modify it. give me feed back on how i can make it better, even though im probobly going to add in a little antiban, it can never hurt =D. i think the failsafe is good enough, after every alch it makes sure that its on gametab(7) and if it isnt, it goes to it then continues alching. if it cant get to the mage tab, it stops alching

NCDS

2009-03-21 18:58:18

Dont use Coords in RS scripts anymore, it is highly detectable.


program New;
{.include SRL/SRL.scar}

const
anumber = 1000; //number of alchs
atype = true; // if high alching true, false if low alch


procedure alch(alchnumber: integer; highalch: boolean);
var
Counter : integer;

begin
if highalch then
repeat
GameTab(7);
mouse(575, 350, 0, 0, true);
wait(150 + random (200));
mouse(575, 350, 0, 0, true);
wait(2200 + random (100));
Counter:= Counter+1;
until Counter => alchnumber
else
repeat
GameTab(7);
mouse(856, 314, 0, 0, true);
wait(150 + random (200));
mouse(856, 314, 0, 0, true);
wait(2200 + random (100));
Counter := Counter+1;
until Counter => alchnumber;
end;

begin
alch(anumber, atype);
end.

I made a couple "Clean Up" Changes to it. You Should read up on 'else' statements.

Not a bad start tho.

Keep at it, nice job.

Awkwardsaw

2009-03-21 19:05:15

yeah, it was just something i put together in like 3 min =p

but what i was thinking, was make it click a random coord every time you start the script/ have to open up the mage tab, but keep that coord while alching, that shouldnt be detectable, because thats what every single person does when alching.

NCDS

2009-03-21 19:09:38

That would work. Just makes it a bit more detectable is all.

Awkwardsaw

2009-03-21 19:12:12

yeah i know. and thanks for telling me about else, i forgot about those haha, would have made my mta thingy a little easier

Drakan

2009-03-22 08:23:15

Hey there :)
A good start! I shortened it even more hehe. When you have repetitive code like that you can add a case statement and just set the coord into x and y. Then from there you only need one repeat statement and it shortens the procedure a lot :) Also something i didnt do but you should is add some randomness to the clicking. Like you said earlier, find a spot and keep those coords, but you also should move every once in a while ;) Keep up the great work!

program New;
{.include SRL/SRL.scar}

const
anumber = 1000; //number of alchs
atype = true; // if high alching true, false if low alch


procedure alch(alchnumber: integer; highalch: boolean);
var
Counter, x, y: integer;
begin
case highalch of
true: begin x := 575; y := 350; end;
false: begin x := 856; y := 314; end;
end;
repeat
GameTab(7);
mouse(x, y, 0, 0, true);
wait(150+ random (200));
mouse(x, y, 0, 0, true);
wait(2200+ random (100));
Inc(Counter); //increases the var by one
until Counter= alchnumber;
end;

begin
alch(anumber, atype);
end.

Awkwardsaw

2009-03-22 11:10:22

=o. that is something that i havnt heard of, thanks for telling me! something else that i can use in my mta thing

Floor66

2009-03-22 12:52:57

And U use the delay: 2200 + Random(100) but on my (fast) PC I just have to use 1750 + Random(200).
(I have made my own alcher to get to 82 recently).

Awkwardsaw

2009-03-22 13:18:38

for me, the alching takes about 2-2.2 seconds long, and my computer rarely lags, so i guess its different for every one


edit: i know this is off topic, but there has to be a way to shorten this here down:

procedure clickguardian; //goes into observe mode
begin
flag;
FindColorsTolerance(MyTPA, 11576484, MSx1, MSy1, MSx2, MSy2, 10);
if Length(MyTPA) = 0 then FindColorsTolerance(MyTPA, 8156019, MSX1, MSY1, MSX2, MSY2, 10);
begin
if Length(MyTPA) = 0 then MakeCompass('E');
FindColorsTolerance(MyTPA, 11576484, MSx1, MSy1, MSx2, MSy2, 10);

if Length(MyTPA) = 0 then FindColorsTolerance(MyTPA, 8156019, MSX1, MSY1, MSX2, MSY2, 10);
if Length(MyTPA) = 0 then MakeCompass('S');
FindColorsTolerance(MyTPA, 11576484, MSx1, MSy1, MSx2, MSy2, 10);

if Length(MyTPA) = 0 then FindColorsTolerance(MyTPA, 8156019, MSX1, MSY1, MSX2, MSY2, 10);
if Length(MyTPA) = 0 then MakeCompass('E');
FindColorsTolerance(MyTPA, 11576484, MSx1, MSy1, MSx2, MSy2, 10);

if Length(MyTPA) = 0 then FindColorsTolerance(MyTPA, 8156019, MSX1, MSY1, MSX2, MSY2, 10);
if Length(MyTPA) = 0 then MakeCompass('W');
FindColorsTolerance(MyTPA, 11576484, MSx1, MSy1, MSx2, MSy2, 10);

if Length(MyTPA) = 0 then FindColorsTolerance(MyTPA, 8156019, MSX1, MSY1, MSX2, MSY2, 10);
if Length(MyTPA) = 0 then Writeln('can not find gaurdian, exiting');
exit;
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 3, 3);
if (IsUpText('uardian')) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
ChooseOption('bserve');
Wait(5000+random(250));
writeln('found color');
Wait(900+random(350));
end;
end;
end;
end;

but i cant really think of any other way tbh, or im just plain dumb =D

an other edit: it trys to find the maze guardian in mta

Floor66

2009-03-22 13:40:07

Ur going over every found point.. wouldn't it go crazy or are they unique colours of the guardian?
You could try TPAtoATPA(Ex) or SplitTPA(Ex).
I like to do TPAtoAPTAEx and MiddleTPAEx to find objects/NPC's.

Awkwardsaw

2009-03-22 17:54:31

theyre suposed to be unque colours, i think i forgot to change them.

so would it look something like this? (TPAtoATPA)

begin
flag;
FindColorsSpiralTolerance(MSCX, MSCY, MyTPA, 11576484, MSX1, MSY1, MSX2, MSY2, 15);
ATPA := TPAtoATPA(TPA, 25);
If Length(ATPA) = 0 Then FindColorsTolerance(MyTPA, 8156019, MSX1, MSY1, MSX2, MSY2, 10);

70s_dollar

2009-03-22 19:50:58

From: drags111
Hey there :)
A good start! I shortened it even more hehe. When you have repetitive code like that you can add a case statement and just set the coord into x and y. Then from there you only need one repeat statement and it shortens the procedure a lot :) Also something i didnt do but you should is add some randomness to the clicking. Like you said earlier, find a spot and keep those coords, but you also should move every once in a while ;) Keep up the great work!

program New;
{.include SRL/SRL.scar}

const
anumber = 1000; //number of alchs
atype = true; // if high alching true, false if low alch


procedure alch(alchnumber: integer; highalch: boolean);
var
Counter, x, y: integer;
begin
case highalch of
true: begin x := 575; y := 350; end;
false: begin x := 856; y := 314; end;
end;
repeat
GameTab(7);
mouse(x, y, 0, 0, true);
wait(150+ random (200));
mouse(x, y, 0, 0, true);
wait(2200+ random (100));
Inc(Counter); //increases the var by one
until Counter= alchnumber;
end;

begin
alch(anumber, atype);
end.


Ok, so I just put this in Scar, and pressed play, but why does it go so slow?

ian.

2009-03-22 19:58:49

add SetupSRL; before alch(anumber, atype); ;)

Awkwardsaw

2009-03-23 21:18:51

oh yeah, that should be like the first thing for every script =p thanks