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+++++