SRL Archive - Reflection

Working High Alchemy


nhawkesn

2011-03-19 09:19:47

[PHP]program SimbAlcher;
{$define SMART}
{$i srl/srl.scar}
{$i srl/srl/misc/reports.scar}

Const
CanISleep = False; // Want to take breaks?
SleepEvery = 10; // Time to wait to sleep + 0-10 minutes
SleepFor = 1; // Time to sleep + 0-10 minutes
SMARTSERVER = 29; //World number
SMARTMEMBERS = True; //Member's world?

Var
TC : Integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Active := True;
Integers[0] := 2500; // Times to alch
Integers[1] := 8; // Items' slot. 1-28 depends on your magic's organization
Booleans[0] := True; // True to high alchemy, False to low alchemy
end;
{
with Players[1] do
begin
Name := '';
Pass := '';
Nick := '';
Active := True;
Integers[0] := 2500; // Times to alch
Integers[1] := 8; // Items' slot. 1-28 depends on your magic's organization
Booleans[0] := True; // True to high alchemy, False to low alchemy
end;

with Players[2] do
begin
Name := '';
Pass := '';
Nick := '';
Active := True;
Integers[0] := 1000; // Times to alch
Integers[1] := 5; // Items' slot. 1-28 depends on your magic's organization
Booleans[0] := False; // True to high alchemy, False to low alchemy
end; }
end;

Procedure Debug(S : String);
Begin
WriteLn('[' + TheTime + '] ' + S);
End;

Procedure MouseAntiBan;
Var
X, Y : Integer;
Begin
Debug('Performing AntiBan');
Case Random(15) Of
0: MMouse(Random(500), Random(500), Random(MIX2), Random(MIX2));
1: SleepAndMoveMouse(Random(500));
2: IdleTime(Random(500), 2, 5.2);
3: Begin
MMouse(Random(500), Random(500), Random(MIX2), Random(MIX2));
Wait(200 + Random(100));
If IsUpText('xamine') Then
Begin
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, False);
Wait(200 + Random(100));
ChooseOption('xamine');
End;
End;
4: PickUpMouse;
5: RandomRClick;
6: If MouseSpeed < 15 Then
IncEx(MouseSpeed, Random(5))
Else
DecEx(MouseSpeed, Random(5));
7: BoredHuman;
End;
End;

Function StuckInRandom: Boolean;
Begin
Debug('Checking randoms');
Result := FindNonInventoryRandoms;
If Result Then
Result := Not LoggedIn;
End;

Function _Cast(HLA : Boolean): Boolean;
Var
X, Y, Lo, Hi : Integer;
Begin
Lo := DTMFromString('78DA634C6066606064624006B2403E3F90668' +
'4F21953816AFE32E257930254C34AC09C74A09ADFA8E6B00BB1A3AA2' +
'904AAF98FAA8609DD9C2CA09A6F04CCC905AAF94C849A1FF8D50000D' +
'4B00AB3');
Hi := DTMFromString('78DA632C6166606060624006B28C4C0CFC409' +
'A11CA67AC00AAF9CB48580D2BAA394CE86AEA8830A78E08735A8930A' +
'79508735A806A7E30E257D30654F319BF1A00D9340AC0');
Gametab(tab_Magic);
Wait(150 + Random(250));
If HLA Then
Begin
If (Not FindDTM(Hi, X, Y, MIX1, MIY1, MIX2, MIY2)) Then
Begin
Debug('Could not find Low Level Alchemy or High Level Alchemy! Make sure it''s visible');
FreeDtm(lo);
FreeDtm(hi);
Exit;
End;
Mouse(X, Y, 5, 5, True)
End
Else
Begin
If (Not FindDTM(Lo, X, Y, MIX1, MIY1, MIX2, MIY2)) Then
Begin
Debug('Could not find Low Level Alchemy or High Level Alchemy! Make sure it''s visible');
FreeDtm(lo);
FreeDtm(hi);
Exit;
End;
Mouse(X, Y, 5, 5, True);
End;
Result := True;
FreeDtm(lo);
FreeDtm(hi);
End;

Function Alch: Boolean;
Var
HLA : Boolean;
Box : TBox;
C : Integer;
Begin
If Not LoggedIn Then
Exit;
If Players[CurrentPlayer].Booleans[0] Then
HLA := True
Else
HLA := False;
If Not _Cast(HLA) Then
Begin
Players[CurrentPlayer].Loc := 'Can''t cast.';
Debug('Could not cast!');
Exit;
End;
C := 0;
while GetCurrentTab = tab_Magic do
begin
Wait(150+random(150));
inc©;
if c >= 10 then
If Not _Cast(HLA) Then
Begin
Players[CurrentPlayer].Loc := 'Can''t cast.';
Debug('Could not cast!');
Exit;
End;
end;
Box := InvBox(Players[CurrentPlayer].Integers[1]);
MouseBox(Box.X1, Box.Y1, Box.X2, Box.Y2, 1);
Debug('Alching…');
Players[CurrentPlayer].Loc := 'Alching';
C := 0;
while not (GetCurrentTab = tab_Magic) do
begin
Wait(150+random(150));
inc©;
if c >= 65 then
MouseBox(Box.X1, Box.Y1, Box.X2, Box.Y2, 1);
end;
Inc(Players[CurrentPlayer].Integers[3]);
If Random(4) = 0 Then
MouseAntiBan;
If StuckInRandom Then
Exit;
Result := True;
End;

begin
SMART_Server := SMARTSERVER;
SMART_Signed := True;
Smart_SuperDetail := False;
Smart_Members := SMARTMEMBERS;
SetupSRL;
DeclarePlayers;
LoginPlayer;
Wait(2000 + Random(1000));
Repeat
TC := GetTickCount;
Repeat
If Not Alch Then
Break;
SRLProgressReport(ResultDebugBox, 'Ultimate Alcher', 'Cazax', '1.05', ['Alches done:', 'Location:'], [Players[CurrentPlayer].Integers[3], Players[CurrentPlayer].Loc]);
If (GetTickCount - TC >= (SleepEvery * 60000) + Random(10 * 60000)) And CanISleep Then
Begin
Debug('Sleep time');
Logout;
Wait((SleepFor * 60000) + Random(10 * 60000));
LoginPlayer;
Wait(2500 + Random(2000));
TC := GetTickCount;
Debug('Back to work');
End;
Until Players[CurrentPlayer].Integers[0] = Players[CurrentPlayer].Integers[3];
NextPlayer(False);
Wait(2000 + Random(1000));
Until AllPlayersInactive;
end.[/PHP]

Flight

2011-03-19 09:36:01

Oh is this your first script? I think there's a section here in the 'Scrpts' section you could put this. Also as another tip, instead of wrapping your code in 'PHP', you could wrap it in the 'Simba' format or even add it as an attachment to your thread.

Nice job on the first script :) Maybe you could post what features it has, or some progress reports?

Santa

2011-03-19 09:37:15

OMG TY!
For some reason I couldn't get the MSI Alcher to work so I was using my alcher. (which isn't very good :p) But this seems to work much better. Hopefully will post a proggie soon :D.

–Edit–
So Far so good. Preformed over 2k Alches! <3

superduperd

2011-03-20 17:38:11

Its good, but why move the mouse so much? If someones alching manually, he/she/it:

1. uses keyboard mouse, so mouse always stays at same spot
2. uses mouse itself, and it keeps on same spot for like 5 alchs, then changes a bit

I never saw anyone alch this way :P

For the rest it works great, does it have antirandom?

gr, super

**BANNED The Man

2011-03-20 18:23:13

I am guessing this is Cazax's :/
'Ultimate Alcher', 'Cazax'

nhawkesn

2011-04-03 16:25:12

Yeah, its not mine.. ^^ i just found it and used it and saw some people here needed high alch script

Sex

2011-04-03 16:27:57

From: nhawkesn
Yeah, its not mine.. ^^ i just found it and used it and saw some people here needed high alch script

Then give credit to him bro? You shouldn't have even posted this without getting permission from him. If you saw it, it is obviously still on the forum.

nhawkesn

2011-04-03 16:34:20

Yeh my bad, didnt give credit.

It wasnt on this forum, i found it somewhere else.

0UT2K1LL

2011-04-03 16:37:41

From: nhawkesn
Yeh my bad, didnt give credit.

It wasnt on this forum, i found it somewhere else.


Edit in credits that it is his, and ask him. Next time ask first tho =P

Sex

2011-04-03 17:04:26

From: nhawkesn
Yeh my bad, didnt give credit.

It wasnt on this forum, i found it somewhere else.

http://villavu.com/forum/showthread.php?t=58187
http://villavu.com/forum/showthread.php?t=55070