SRL Archive - Outdated / Broken

[R] Crammies ~ Craft ammies!


Floor66

2009-07-04 12:13:43

I've been using this for a few days and I wanted to release it!

What does it do?
This scripts turns gold bars in to gold amulets! Not much pure profit, but exp+profit.

Where to start?
Stand in Al-Karhid bank with/without ammy mould (script will look in bank for it ;))
Make sure you have gold bars and amulets visible in the same slot on bank opening.

Feachurz:
  • 'Custom' walking *
  • Random tiles every inv.
  • Decent AntiBan
  • Decent AntiRandoms
  • Sweet progress-report
  • Uses resting!
  • Etc etc etc. Many more!

* : Because mostly you can't walk to the furnace from inside the bank, the script clicks about next to the kebab shop and as soon as the tile of the furnace pops up it will click there without standing still inbetween walks (this is very humanlike)!

Script:

{Crammy = CR[A]ft [A]MMY
Crammies = CR[A]ft [A]MMIES}
Program New;
{.include SRL/SRL/misc/Smart.scar}
{.include SRL/SRL.scar}
{.include SRL/SRL/reflection/Reflection.scar}

Var
BankTile, Furnace : Array Of TPointArray;
Step : TPointArray;
BankCheck : TPoint;
Mould, GoldBar, Amulet, SleepMark, Chosen : Integer;
DTMsCalled, _LoadsDone, DoNP, TilesSet : Boolean;
S : String;

Const
SmartWorld = 99; //World to hop to after loading Smart.
SmartSigned = True; //Use signed Smart?
SmartP2p = True; //Members?
UseSleep = True; //Use Sleeping?
SleepEvery = 12; //Sleep every (xx) minutes.
UseRest = True; //Restore run to 100% when under 20% energy?

Procedure DeclarePlayers;
Begin
CurrentPlayer := 0; // Starting player
HowManyPlayers := 1; // How many players in total?
NumberOfPlayers(HowManyPlayers);

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // Nickname, 3 - 4 letters of username
Players[0].Active := True; // Use this player?
Players[0].Integers[0] := 5000; // Loads to do
End;

Procedure Crammy; Forward;

Procedure _WriteLn(Txt : String);
Begin
WriteLn(Txt);
End;

Function Done: Boolean;
Begin
Result := (Players[CurrentPlayer].Integers[2] >= Players[CurrentPlayer].Integers[0]) Or
_LoadsDone Or
DoNP;
End;

Function InvDTMCount(DTM : Integer): Integer;
Var
i, x, y : Integer;
t : TBox;
Begin
If Not LoggedIn Then
Exit;
For i := 1 To 28 Do
Begin
t := InvBox(i);
If FindDTM(DTM, x, y, t.x1, t.y1, t.x2, t.y2) Then
Inc(Result);
End;
End;

Function FirstInvDTMInstance(DTM : Integer): Integer;
Var
i, x, y : Integer;
t : TBox;
Begin
If Not LoggedIn Then
Exit;
For i := 1 To 28 Do
Begin
t := InvBox(i);
If FindDTM(DTM, x, y, t.x1, t.y1, t.x2, t.y2) Then
Begin
Result := i;
Break;
End;
End;
End;

Function FillIn: Boolean;
Begin
Result := (GetColor(260, 428) = 8388608);
End;

Function WalkToTileEx(Tile1, Tile2: TPoint; Randomness, FlagD: Integer; a : Boolean): Boolean;
Var
wTile: TPoint;
t: Integer;
Begin
Result := False;
Tile1 := Point(RandomRange(Tile1.X-Randomness, Tile1.X+Randomness), RandomRange(Tile1.Y-Randomness, Tile1.Y+Randomness));
wTile := TileToMM(Tile1);
If Not rs_OnMiniMap(wTile.X, wTile.Y) Then
Exit;
MFNF(wTile.x, wTile.y, -1, -1);
Wait(RandomRange(80, 100));
MarkTime(t);
While TimeFromMark(t) < 30000 Do
Begin
Wait(20 + Random(10));
FindNormalRandoms;
If TileOnMM(Tile2) Then
Begin
Wait(450 + Random(500));
If a Then
ReplaceDebugLine(GetDebugLineCount - 1, 'Walking to furnace -> Step[0] -> Step[2]!')
Else
ReplaceDebugLine(GetDebugLineCount - 1, 'Walking to bank -> Step[3] -> BankTile[1][' + IntToStr(Chosen) + ']!');
Result := WalkToTile(Tile2, 0, 5);
Exit;
End;
End;
Result := TimeFromMark(t) < 30000;
End;

Procedure AntiBan;
Begin
If InRange(Random(90), 8, 18) Then
Begin
Case Random(50) Of
0..9: SleepAndMoveMouse(2500 + Random(1500));
10..19: PickupMouse;
20..22: BoredHuman;
End;
End;
End;

Procedure PickNewTiles;
Begin
If Not TilesSet Then
Begin
Chosen := Random(Length(BankTile[0]));
BankTile[1][0] := BankTile[0][Chosen];
Furnace[1][0] := Furnace[0][Random(Length(Furnace[0]))];
TilesSet := True;
End;
End;

Function OpenAKBank: Boolean;
Var
Tries, i : Integer;
t, z : TPoint;
Begin
If Not LoggedIn Then
Exit;
If BankScreen Then
Begin
Result := True;
Exit;
End;
If Not TilesSet Then
PickNewTiles;
z := GetMyPos;
If z.x > BankCheck.x Then
WalkToTile(BankTile[1][0], 0, 5);
Repeat
z := BankTile[1][0];
Dec(z.x);
t := TileToMS(z, 0);
MMouse(t.x, t.y, 2, 2);
Wait(50 + Random(50));
If IsUpText('ooth') Then
Begin
GetMousePos(t.x, t.y);
Mouse(t.x, t.y, 0, 0, False);
Wait(50 + Random(50));
If ChooseOption('uick') Then
Begin
MarkTime(i);
While Not R_BankScreen Do
Begin
Wait(20 + Random(10));
If TimeFromMark(i) >= 5000 Then
Break;
End;
Result := R_BankScreen;
If Result Then
Exit;
End;
End;
Until(Tries = 5);
If Tries = 5 Then
Begin
_WriteLn('Failed to open the bank 5 times!');
Result := False;
End;
End;

Procedure Bank(Deposit : Boolean);
Var
x, y, i : Integer;
Begin
If Not LoggedIn Then
Exit;
FindNormalRandoms;
If Not OpenAKBank Then
Begin
DoNP := True;
Exit;
End;
Wait(250 + Random(50));
If Deposit Then
Begin
If FindDTM(Amulet, x, y, MIX1, MIY1, MIX2, MIY2) Then
Begin
_WriteLn('Banking Ammies!');
Mouse(x, y, 2, 2, False);
Wait(50 + Random(50));
If ChooseOption('ll') Then
Begin
Bank(False);
Exit;
End;
End;
End Else
Begin
If FindDTM(GoldBar, x, y, MSX1, MSY1, MSX2, MSY2) Then
Begin
_WriteLn('Getting Gold Bars!');
Mouse(x, y, 2, 2, False);
Wait(50 + Random(50));
If Not ChooseOption('27') Then
Begin
Mouse(x, y, 2, 2, False);
Wait(50 + Random(50));
If ChooseOption('X') Then
Begin
MarkTime(i);
While Not FillIn Do
Begin
Wait(20 + Random(20));
If TimeFromMark(i) >= 5000 Then
Break;
End;
If FillIn Then
TypeSend('27')
Else
Begin
Mouse(x, y, 2, 2, False);
Wait(50 + Random(50));
If ChooseOption('ll') Then
Exit;
End;
End;
End;
End Else
Begin
_WriteLn('No gold bars found!');
DoNP := True;
End;
End;
End;

Procedure CheckMould;
Var
x, y : Integer;
Begin
If Not LoggedIn Then
Exit;
FindNormalRandoms;
If FindDTM(Mould, x, y, MIX1, MIY1, MIX2, MIY2) Then
Begin
_WriteLn('Found mould in inventory!');
Exit;
End Else
Begin
_WriteLn('Didn''t find mould in inventory, checking bank!');
If Not OpenAKBank Then
Begin
_WriteLn('Failed to open the bank 5 times!');
DoNP := True;
Exit;
End;
Wait(100 + Random(50));
If FindDTM(Mould, x, y, MSX1, MSY1, MSX2, MSY2) Then
Begin
_WriteLn('Found mould in bank. Withdrawing!');
Mouse(x, y, 2, 2, True);
Wait(1000 + Random(500));
WriteLn('Withdrew mould!');
End Else
Begin
_WriteLn('Didn''t find mould in bank!');
DoNP := True;
End;
End;
FindNormalRandoms;
End;

Procedure WalkToFurnace;
Begin
If Not LoggedIn Then
Exit;
FindNormalRandoms;
SetRun(True);
If TileOnMM(Step[1]) Then
Begin
_WriteLn('Walking to furnace -> Step[1]!');
WalkToTile(Step[1], 0, 5);
End Else If TileOnMM(Step[2]) Then
Begin
_WriteLn('Walking to furnace -> Step[2]!');
WalkToTile(Step[2], 0, 5)
End Else If TileOnMM(Step[0]) Then
Begin
_WriteLn('Walking to furnace -> Step[0]');
WalkToTileEx(Step[0], Step[2], 2, 5, True);
End;
FindNormalRandoms;
Wait(250 + Random(300));
End;

Procedure WalkToBank;
Begin
If Not LoggedIn Then
Exit;
FindNormalRandoms;
SetRun(True);
If TileOnMM(Step[3]) Then
Begin
_WriteLn('Walking to bank -> Step[3]');
WalkToTileEx(Step[3], BankTile[1][0], 2, 5, False);
End;
FindNormalRandoms;
Wait(250 + Random(300));
End;

Procedure WaitingLoop;
Begin
If Not LoggedIn Then
Exit;
Repeat
Wait(20 + Random(20));
ReplaceDebugLine(GetDebugLineCount - 1, 'Ammy count: '+ IntToStr(InvDTMCount(Amulet)) +'!');
If Not LoggedIn Then
Begin
LoginPlayer;
Crammy;
Exit;
End;
If FindNPCChatText('grat', Nothing) Then
Begin
_WriteLn('Level up!');
Crammy;
FixChat;
Exit;
End;
FindNormalRandoms;
AntiBan;
Until(InvDTMCount(GoldBar) = 0);
ReplaceDebugLine(GetDebugLineCount - 1, 'Done smelting!');
IncEx(Players[CurrentPlayer].Integers[1], 27);
Inc(Players[CurrentPlayer].Integers[2]);
End;

Procedure Crammy;
Var
t : TPoint;
Tries, i : Integer;
Begin
If Not LoggedIn Then
Exit;
If InvDTMCount(GoldBar) = 0 Then
Begin
WalkToBank;
Bank(False);
WalkToFurnace;
End;
Repeat
MouseItem(FirstInvDTMInstance(GoldBar), True);
t := TileToMS(Furnace[1][0], 0);
Mouse(t.x, t.y, 3, 3, True);
FindNormalRandoms;
MarkTime(i);
While Not (GetColor(168, 47) = 2071039) Do
Begin
Wait(20 + Random(10));
If TimeFromMark(i) >= 5000 Then
Break;
End;
If Not (GetColor(168, 47) = 2071039) Then
Inc(Tries)
Else Begin
Mouse(130, 227, 8, 8, False);
If WaitOption('ll', 200) Then
Begin
_WriteLn('Going to make Ammies!');
FindNormalRandoms;
WaitingLoop;
Exit;
End;
End;
Until(Tries = 5);
If Tries = 5 Then
Begin
_WriteLn('Failed to smelt Ammies!');
DoNP := True;
End;
End;

Procedure Progress;
Var
_Len, Len, i : Integer;
Texts : TStringArray;
Begin
_Len := 84;
Len := _Len - 4;
SetLength(Texts, 3);
Texts[0] := 'Crammies by Floor66!';
Texts[1] := '~PlayerReport~';
Texts[2] := 'Running for '+ TimeRunning;
WriteLn('');
WriteLn('{'+ Replicate('-', _Len) +'}');
WriteLn('{~ '+ Replicate(' ', (Len / 2) - (Length(Texts[0]) / 2)) + Texts[0] + Replicate(' ', (Len / 2) - (Length(Texts[0]) / 2)) +' ~}');
WriteLn('{~ '+ Replicate(' ', (Len / 2) - (Length(Texts[1]) / 2)) + Texts[1] + Replicate(' ', (Len / 2) - (Length(Texts[1]) / 2)) +' ~}');
WriteLn('{~ '+ Replicate(' ', (Len / 2) - (Length(Texts[2]) / 2)) + Texts[2] + Replicate(' ', (Len / 2) - (Length(Texts[2]) / 2)) +' ~}');
WriteLn('{'+ Replicate('-', _Len) +'}');
WriteLn('{~ '+ Padr('[||] '+ Padr('Username', 12) +' [||] Active [||] Loads [||] Ammies [||] Sleeps [||] Rests [||]', Len) +' ~}');
WriteLn('{'+ Replicate('-', _Len) +'}');
For i := 0 To High(Players) Do
Begin
WriteLn('{~ '+ Padr(' || '+ Padr(Players[i].Name, 12) +' || '+ Padr(BoolToStr(Players[i].Active), 6) +' || '+
Padr(IntToStr(Players[i].Integers[2]), 5) +' || '+ Padr(IntToStr(Players[i].Integers[1]), 6) +' || '+
Padr(IntToStr(Players[i].Integers[3]), 6) +' || '+ Padr(IntToStr(Players[i].Integers[4]), 5) +' ||', Len) +' ~}');
End;
WriteLn('{'+ Replicate('-', _Len) +'}');
WriteLn('');
End;

Procedure TrySleep;
Begin
If Not UseSleep Then
Exit;
If TimeFromMark(SleepMark) >= (SleepEvery * 60000) Then
Begin
FindNormalRandoms;
Logout;
_WriteLn('Going to sleep!');
Inc(Players[CurrentPlayer].Integers[3]);
Wait(Random(60000));
_WriteLn('Sleeping done, waking up!');
LoginPlayer;
SetAngle(True);
MakeCompass('N');
SetRun(True);
MarkTime(SleepMark);
End;
End;

Procedure SetVars;
Begin
_WriteLn('Setting up variables!');
{Tiles}
{BankTile tiles}
SetLength(BankTile, 2);
SetLength(BankTile[0], 4);
SetLength(BankTile[1], 1);
BankTile[0][0] := Point(3269, 3169);
BankTile[0][1] := Point(3269, 3168);
BankTile[0][2] := Point(3269, 3167);
BankTile[0][3] := Point(3269, 3166);
{/BankTile tiles}
{Furnace tiles}
SetLength(Furnace, 2);
SetLength(Furnace[0], 4);
SetLength(Furnace[1], 1);
Furnace[0][0] := Point(3273, 3186);
Furnace[0][1] := Point(3272, 3186);
Furnace[0][2] := Point(3273, 3185);
Furnace[0][3] := Point(3272, 3185);
{/Furnace tiles}
{Step tiles}
SetLength(Step, 4);
Step[0] := Point(3278, 3179); //Step inbetween
Step[1] := Point(3275, 3185); //Just under furnace
Step[2] := Point(3274, 3186); //Right next to furnace
Step[3] := Point(3275, 3171); //Step inbetween (back)
{/Step tiles}
{BankCheck tile}
BankCheck := Point(3272, 3166);
{/BankCheck tile}
{/Tiles}
{DTMs}
If Not DTMsCalled Then
Begin
{Mould DTM}
Mould := DTMFromString('78DA637464626078CC800256CF9FC77039998' +
'18111C8FE0F048CDE4035EF18D000231209A4DD816A3E12506305' +
'54F396801A13A09A1704D49801D53C22A0C61FA8E6210135BE403' +
'5CFF1AB01000E711096');
{/Mould DTM}
{GoldBar DTM}
GoldBar := DTMFromString('78DA631462646098C680026EAC9762D0010A0' +
'311C37F20609407B2A633A001462412480B03598B09A81124420D' +
'0F90B590801A16206B2E0135AC40D64C026AB880AC2904D448015' +
'973F0AB0100EE020BF6');
{/GoldBar DTM}
{Amulet DTM}
Amulet := DTMFromString('78DA63B465646098C68002A6CC1666D0010A0' +
'311C37F20607402B26631A001462412489B03593308A83103B2A6' +
'1261CE64026A9C81ACE904D4580359B309A8B123AC06009A110C2' +
'7');
{/Amulet DTM}
DTMsCalled := True;
End;
{/DTMs}
End;

Procedure FreeVars;
Begin
{DTMs}
If DTMsCalled Then
Begin
FreeDTM(Mould);
FreeDTM(GoldBar);
FreeDTM(Amulet);
DTMsCalled := False;
End;
{/DTMs}
End;

Procedure ScriptTerminate;
Begin
Progress;
End;

Begin
Smart_Server := SmartWorld;
Smart_Members := SmartP2p;
Smart_Signed := SmartSigned;
Smart_SuperDetail := False;
SetupSRL;
SetupReflection;
DeclarePlayers;
SelectWorld(SmartWorld);
SetVars;
Repeat
If Not LoggedIn Then
LoginPlayer;
// WriteLn(IntToStr(GetMyPos.x) + ', ' + IntToStr(GetMyPos.y));
SetAngle(True);
MakeCompass('N');
SetRun(True);
MarkTime(SleepMark);
ClearDebug;
CheckMould;
If InvDTMCount(Amulet) > 0 Then
Bank(True)
Else If InvDTMCount(GoldBar) = 0 Then
Bank(False);
Repeat
SetRun(True);
FixChat;
PickNewTiles;
If Done Then
Begin
NextPlayer(False);
Break;
End;
WalkToFurnace;
Crammy;
If Done Then
Begin
NextPlayer(False);
Break;
End;
WalkToBank;
Bank(True);
If Done Then
Begin
NextPlayer(False);
Break;
End;
TilesSet := False;
Progress;
TrySleep;
If UseRest Then
Begin
If GetMMLevels('run', S) <= 20 Then
Begin
_WriteLn('Going to rest to 100% energy!');
If SetRest Then
Begin
_WriteLn('Current run energy: '+ IntToStr(GetMMLevels('run', S)) +'%!');
Repeat
Wait(20 + Random(20));
ReplaceDebugLine(GetDebugLineCount - 1, 'Current run energy: '+ IntToStr(GetMMLevels('run', S)) +'%!');
Until(GetMMLevels('run', S) = 100);
_WriteLn('Full run energy!');
Inc(Players[CurrentPlayer].Integers[4]);
End;
End;
End;
Until(Done);
If AllPlayersInActive Then
Break;
NextPlayer(False);
Until(AllPlayersInActive);
FreeVars;
End.

Lancelot074

2009-07-04 19:14:28

Looks nice, how much exp/h would you say this gives? I've always wanted 99 crafting. :D

Floor66

2009-07-04 20:27:43

I have no idea lolz. 1 inventory is 810 exp, 1 inventory takes ~90 sec.
3600 sec / 90 sec = 40.
40 * 810 = 32400.

So id say ~32k/hr. Not bad imo, seen it also makes aprox. the same amount of cash per hr.

Camaro'

2009-07-05 09:08:04

im gonna download.

Am i aloud to post constructive criticism , last time i did, i got flamed and told not to.

EDIT: There is no need to! JOB WELL DONE from me. Even though im not gonna use this, seems you worked hard on this. REP + !

edit
Make attachment instead.

Floor66

2009-07-05 11:48:55

Yeh will do when I can reach another PC.
Thanks ;) I made this in the first place for my brother (who has reached 94 mage yesterday), and also to get some cash for my new tank together with crafting exp :p

Simtoon

2009-07-05 11:58:10

From: The Cnr Sport
im gonna download.

Am i aloud to post constructive criticism , last time i did, i got flamed and told not to.


Then don't give constructive criticism to that person from what i see they are not that good. :)

Floor66

2009-07-05 12:02:10

Me=confused…
But w/e Simtoon 'ave anything to say about the script..?

Simtoon

2009-07-05 14:13:38

AHH, umm ill use it on an account of mine later :)
First 19k ess to airs :)

Camaro'

2009-07-05 19:33:51

Im going to use this script actually, can you please explain how this script makes the amulets, i dont play runescape much. Im curious. Is it a spell?

Gu3st...

2009-07-05 22:02:41

From: The Cnr Sport
Im going to use this script actually, can you please explain how this script makes the amulets, i dont play runescape much. Im curious. Is it a spell?

To make amulets you have to level crafting a bit.
Read here: http://www.runescape.com/kbase/viewarticle.ws?article_id=1872 :)

Floor66

2009-07-05 22:41:39

You have to have an amulet mould in bank/inv. The script will take the gold bars out of your inv -> go to the furnace -> use gold bar with furnace -> make-all gold amulets -> wait wait wait -> bank.

Phran6

2009-07-05 23:50:05

you should add the option to craft gold necklace, they are sold for more
Gold necklace: 460
Gold amulet: 357
Gold bar: 315

Floor66

2009-07-06 00:20:57

But do the gold necklaces actually sell?
Gold ammies sell because they're massively used for mage training.

Phran6

2009-07-06 01:29:18

i dont know but they raised price recently so they probably sell

Floor66

2009-07-06 09:36:47

Or not.. If people put in offers but they don't buy, the prices will rise.