SRL Archive - First Scripts

All that is man's auto alcher


All that is man

2009-03-30 18:16:11

Hello, this is my first "best" script I guess you could say.
Just Press run, it'll stop when your out of alchs and it'll do its stuff, remeber to target client. Post all of my flaws and what I did wrong. Thanks!

Current Version
AutoAlcher[0.02] - Added more so it alchs in the same spot 20-30 times.
AutoAlcher[0.03] - Fixed My Repetetive CheckForGameTab7; Procedure


Recent Versions:
AutoAlcherRelease[0.01] beta: 10 views
AutoAlcherRelease[0.02] beta: 02 views

Awkwardsaw

2009-03-30 19:10:31

it looks pretty good and usefull, but there are some stuff to work on( antiban and failsafe wise )

you shouldnt use a dtm of the item your alching, unless you specify your using that item. like for example, im alching mage longbows, because you either fletched them or they have a less gp loss than yew longs(which does happen every now and then) but i cant with this script because it only looks for a yew longbow, and if it doesnt find one then it terminatesscript.

if you would like to check the item, use "isuptext" or something like that, so you can make a const, and when you look at invt spot 13, it checks what you typed in as a const, and not a single item, if that makes sence

for your actual alching procedure, its very random, and the mouse moves after every click, its very detectable because you or any one else never moves the mouse after every single click. what you can do for that is add "getmousepos" like my alcher, that way it gets a random coord and sticks with it untill you tell it to change.

for your find tabs procedure, it would be best to use it as a function, since your using a true false as an answer. also to save time and lines, you do not need to do "if not gametab(7) then gametab(7)", it does that automaticly. or if you wanted to check if it exists, use "if (TabExists(7) = true)"

but once again, its pretty good. i hope i wasnt to harsh on the feed back, if my feedback made sence at all haha. feel free to message me if you need any more help, and go ahead and use my alcher if you need a refrence, if you want to use something from it give me credit, and its all good


good luck =D

All that is man

2009-03-31 19:02:02

Ok, i'll update it if I got what your saying, haha. But, when you said make a "const" I was going to but I wanted my script just to alch and you didn't have to fill anything out, lol. But again thanks.

Smarter Child

2009-03-31 20:47:12

Nice first script, probably the first script n first script that has a well-of antiban.:)
I'd rather use a bitmap to find highalch, check gametab there should be some functions.

For your cantalch procedure, i suggest you add a backup.

program AutoAlcher;
{.Include SRL/SRL.SCAR}
{By: All that is man
V 1.0 : Beta}
var
NatureRune, YewLongBow, HighAlch, x, y, totalalchs : Integer;

Procedure LoadDTMs;
Begin
NatureRune := DTMFromString('78DA63CC62626078CE8002043A4519FE03694' +
'620FE0F048CF14035F719D000231209A413816ADE115053065473' +
'9B809A72A09AB7F8D50000FE830C55');
YewLongBow := DTMFromString('78DA639CCCC4C0F080010E188178DBB21A061' +
'D4608FB3F10307602D5BC6740019B1655C2D583E92540353751D5' +
'9CDAD987AA661150CD47543567F64C4655D30D54731D55CDE2A9F' +
'9286A00AB901514');
HighAlch := DTMFromString('78DA63B46262604862644006972E7132E8008' +
'540A2FF8180D105A8261955CDAF6F3C601A26CA6884690E4C16AE' +
'C61EA8260655CD9E430750D55803D5A4A0AA59BF9E13450D0037E' +
'D0EA3');
End;

Procedure CheckForGameTab7;
Begin
If not GameTab(7) Then
Begin
GameTab(7);
End;
End;

Procedure RegularAlch;
Begin
case random(3) of
1: Begin
Mouse(572, 348, 3, 4, True);
Wait(325+random(357));
Mouse(572, 348, 0, 1, True);
Wait(2200+random(249));
TotalAlchs:=TotalAlchs+1;
End;
2: Begin
Mouse(575, 344, 2, 4, True);
Wait(34+random(99));
Mouse(575, 344, 0, 0, True);
Wait(2300+random(249));
TotalAlchs:=TotalAlchs+1;
End;
3: Begin
MouseBox(813, 518, 831, 535, 1);
Wait(213+random(104));
MouseBox(819, 510, 829, 518, 1);
Wait(2400+random(249));
TotalAlchs:=TotalAlchs+1;
End;
End;
End;
Procedure CheckForRegularSpells;
Begin
If not GameTab(7) then
Begin
GameTab(7);
End;
If FindDTM(HighAlch, x, y, 554, 328, 590, 374) Then
Begin
RegularAlch;
End;
If not FindDTM(HighAlch, x, y, 554, 328, 590, 374) Then
Begin
Mouse(684, 450, 5, 5, True);
End;
If not FindDTM(HighAlch, x, y, 554, 328, 590, 374) Then
Begin
Writeln('Please make sure that you have natures and a firestaff');
Disguise('Terminated');
TerminateScript;
End;
End;

Procedure CheckForItems;
Begin
If not GameTab(4) then
Begin
GameTab(4);
End;
If not FindDTM(YewLongBow, x, y, MIx1, MIy1, MIx2, MIy2) Then
Begin
Writeln('Didn''t find an item to alch, terminating.');
Disguise('Terminated');
TerminateScript;
End;
End;
Procedure ItemsInRightSpot;
Begin
If not FindDTM(YewLongBow, x, y, 561, 319, 592, 351) Then
Begin
If FindDTM(YewLongBow, x, y, MIx1, MIy1, MIx2, MIy2) Then
Begin
MMouse(x, y, 6, 6);
Wait(25+random(234));
HoldMouse(x, y, True);
Wait(23+random(234));
MMouse(577, 335, 8, 8);
ReleaseMouse(x, y, True);
End;
End;
End;

Procedure AntiBan;
Begin
case random(40) of
1: Hoverskill('random', false);
2, 3: HoverSkill('magic', false);
4: PickupMouse;
5: Begin
MakeCompass('w');
wait(150+random(124));
Makecompass('s');
wait(150+random(124));
MakeCompass('random');
wait(250+random(124));
MakeCompass('random');
End;
6: Begin
Mmouse(0, 0, 800, 800);
wait(240+random(234));
End;
End;
End;

Procedure CantAlch;
Begin
If not FindDTM(HighAlch, x, y, 554, 328, 590, 374) Then
Begin
Disguise('Finished');
TerminateScript;
End;
End;

Procedure LetsAlch;
Begin
CheckForGameTab7;
RegularAlch;
CheckForGameTab7;
CantAlch;
AntiBan;
End;

begin
SetupSRL;
Wait(250+random(123));
ActivateClient;
Wait(250+random(123));
Disguise('All that is man''s auto alcher');
Wait(250+random(123));
LoadDTMs;
CheckForItems;
ItemsInRightSpot;
CheckForRegularSpells;
repeat
LetsAlch;
until(isFkeydown(12))
end.

I fixed some standards since some were kinda unclear.
There's a function in srl called: [PHP]FreeDTM(DTM: Integer);[/PHP]

So you would use it like:
FreeDTM(HighAlch);
etc..

FreeDTM is too free the dtm off the memory, no memory leaks, or memory build-up etc..
I demand you include it after your done using a dtm…(ooo :p)
Well Done on you first script!

:)

~~~~offtopic~~~~
—Pop up on IRC sometime—

+++WOOOOH i got useful poster rank+++++

cycrosism

2009-04-03 06:35:27

Procedure CheckForGameTab7;
Begin
If not GameTab(7) Then
Begin
GameTab(7);
End;
End;

You could just change it to

GameTab(7);

In your main loop because it checks it before it clicks it anyway

ian.

2009-04-03 21:17:15

program AutoAlcher;
{.Include SRL/SRL.SCAR}
{By: All that is man
V 1.0 : Release Beta}

var
NatureRune, YewLongBow, HighAlch, x, y, TotalAlchs, TempAlchs : Integer;

procedure LoadDTMs;
begin
NatureRune := DTMFromString('78DA63CC62626078CE8002043A4519FE03694' +
'620FE0F048CF14035F719D000231209A413816ADE115053065473' +
'9B809A72A09AB7F8D50000FE830C55');

YewLongBow := DTMFromString('78DA639CCCC4C0F080010E188178DBB21A061' +
'D4608FB3F10307602D5BC6740019B1655C2D583E92540353751D5' +
'9CDAD987AA661150CD47543567F64C4655D30D54731D55CDE2A9F' +
'9286A00AB901514');

HighAlch := DTMFromString('78DA63B46262604862644006972E7132E8008' +
'540A2FF8180D105A8261955CDAF6F3C601A26CA6884690E4C16AE' +
'C61EA8260655CD9E430750D55803D5A4A0AA59BF9E13450D0037E' +
'D0EA3');

end;

procedure AntiBan;
begin
case Random(40) of
1: HoverSkill('Random', False);
2, 3: HoverSkill('Magic', False);
4: PickupMouse;
5: begin
MakeCompass('W');
Wait(150+Random(124));
MakeCompass('S');
Wait(150+Random(124));
MakeCompass('Random');
Wait(250+Random(124));
MakeCompass('Random');
end;
6: begin
MMouse(0, 0, 800, 800);
Wait(240+Random(234));
end;
end;
end;

procedure RegularAlch;
begin
case random(3) of
1: begin
Mouse(572, 348, 3, 4, True);
GetMousePos(x, y);
Wait(325+Random(357));
Mouse(x, y, 0, 0, True);
Wait(2200+Random(249));
TempAlchs := 0;
Inc(TotalAlchs);
repeat
Mouse(x, y, 0, 0, True);
Wait(325+Random(357));
Mouse(x, y, 0, 0, True);
Wait(2200+Random(500));
Inc(TempAlchs);
Inc(TotalAlchs);
if(TempAlchs > 10)and(Tempalchs < 14)then
begin
AntiBan;
end;
until(Tempalchs >= 20+Random(20))
end;
2: begin
Mouse(575, 344, 2, 4, True);
Wait(34+Random(99));
Mouse(575, 344, 0, 0, True);
Wait(2300+Random(249));
Inc(TotalAlchs);
end;
3: begin
MouseBox(813, 518, 831, 535, 1);
Wait(213+Random(104));
MouseBox(819, 510, 829, 518, 1);
Wait(2400+Random(249));
Inc(TotalAlchs);
end;
end;
end;

procedure CheckForRegularSpells;
begin
GameTab(7);
if(FindDTM(HighAlch, x, y, 554, 328, 590, 374))then
RegularAlch;
if(not(FindDTM(HighAlch, x, y, 554, 328, 590, 374))then
begin
Mouse(684, 450, 5, 5, True);
end;
if(not(FindDTM(HighAlch, x, y, 554, 328, 590, 374))then
begin
Writeln('Please make sure that you have natures and a firestaff');
Disguise('Terminated');
TerminateScript;
end;
end;

procedure CheckForItems;
begin
GameTab(4);
if(not(FindDTM(YewLongBow, x, y, MIX1, MIY1, MIX2, MIY2))then
begin
Writeln('Didn''t find an item to alch, terminating.');
Disguise('Terminated');
TerminateScript;
end;
end;

procedure ItemsInRightSpot;
begin
if(not(FindDTM(YewLongBow, x, y, 561, 319, 592, 351))then
begin
if(FindDTM(YewLongBow, x, y, MIX1, MIY1, MIX2, MIY2))then
begin
MMouse(x, y, 6, 6);
Wait(25+Random(234));
HoldMouse(x, y, True);
Wait(23+Random(234));
MMouse(577, 335, 8, 8);
ReleaseMouse(x, y, True);
end;
end;
end;

procedure CantAlch;
begin
if(not(FindDTM(HighAlch, x, y, 554, 328, 590, 374))then
begin
Disguise('Finished');
TerminateScript;
end;
end;

procedure LetsAlch;
begin
GameTab(7);
RegularAlch;
GameTab(7);
CantAlch;
AntiBan;
end;

procedure ScriptTerminate;
begin
FreeDTM(NatureRune);
FreeDTM(YewLongBow);
FreeDTM(HighAlch);
end;

begin
SetupSRL;
Wait(250+Random(123));
ActivateClient;
Wait(250+Random(123));
Disguise('All that is man''s auto alcher');
Wait(250+Random(123));
LoadDTMs;
CheckForItems;
ItemsInRightSpot;
CheckForRegularSpells;
repeat
LetsAlch;
until(IsFKeyDown(12));
end.

STANDARDIZE ME CAP'N!

the ScriptTerminate thing is there so that it will free the DTMs when the script ends..