SRL Archive - Senior Scripts and Snippets

Humidifier


The Claw

2009-01-18 02:50:37

This script casts the lunar magic spell Humidify (magic level 68 and the quests Lunar Diplomacy and Dream Eater required), which fills all empty vials (or other containers) in your inventory with water.

The script has 3 modes - turbo, stepped and filling. Turbo casts humidify and empties a single vial repeatedly, stepped does the same thing but using the F12 key to turn it on or off - useful for things like casting at pest control, where you would manually go on the boat, get 50 points of damage, then press f12 to cast for the rest of the game. Filling withdraws empty vials from your bank, casts the spell to fill them all and then banks them.

In filling mode, taking into account the cost of astral runes you make about roughly 7gp per vial filled, if you buy and sell everything at mid price, assuming you're filling 27 vials per invent (1 astral rune per 27 vials). So it makes about 100k cash per hour along with the mage xp (30k/h).

Proggy from filling mode:

[FONT="Courier New"]----- Humidifier by The Claw -----
Ran for 5 Minutes and 2 Seconds
Casted 36 times
Gained 2340 exp.
Filled 972 vials, filling 11583 per hour
So currently casting 429 spells per hour and gaining 27885 experience per hour.[/FONT]

Proggy from turbo mode:

[FONT="Courier New"]----- Humidifier v0.03 by The Claw -----
Ran for 1 Hours, 15 Minutes and 44 Seconds
Casted 742 humidifies and 186 magic imbues
Gained 64226 exp.
So currently casting 735 spells per hour and gaining 50881 experience per hour.[/FONT]

Instructions: Buy a steam battlestaff/mystic steam staff, equip it, astral runes in first invent spot, either an empty vial in your invent or the stack of them in your first bank tab, first bank screen. If you don't want to use a steam staff then get a fire/water staff, fire/water runes, and change VialsPerInvent to whatever it actually is.

program New;
{.include srl/srl/misc/Smart.scar}
{.include SRL/SRL.scar}

const
Mode = 'turbo'; //turbo, stepped, or filling
WhatAreWeDoing = 'fishbowls'; //currently fishbowls or vials
Antiban = True; //highly recommended to keep this true

Location = 'eb'; //only necessary if "filling" mode
ObjectsPerInvent = 27; //only necessary if "filling" mode

SmartWorld = 110;
Version = '0.03';

SleepEvery = 75; // (Minutes)
SleepRandom = 30; // Random minutes to be added on to SleepEvery;
SleepFor = 30; // (Minutes) random + 5 minutes, if you don't like, change source...

YourSRLID = '';
YourSRLPass = '';

var
dtm_TheEmpty, dtm_TheFilled, int_Casted,
int_Filled, int_TempCasts, int_ImbueCasts, OverallTimer, SleepTimer, int_Sleeps: Integer;
AntibanTimer, AntiBanMark: Array [0..5] of Integer;

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

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := true;
end;

procedure LoadDTMs;
begin
case LowerCase(WhatAreWeDoing) of
'vials':
begin
dtm_TheEmpty := DTMFromString('78DA63CC60626078C08006189148205D0854F' +
'3940835AF5055383ABA31F023AB2905AA794FC09C1CA09ACF04D4' +
'2401D5BCC5AF0600479E0900');
dtm_TheFilled := DTMFromString('78DA639CC4C4C0F088010D302291407A2650C' +
'D73089B092A161ED3C8C085AC662E50E6050173E600D57C24A0A6' +
'07A8E61D7E3500B02B08D9');
end;
'fishbowls':
begin
dtm_TheEmpty := DTMFromString('78DA63DCCEC4C0708B010D30229140FA2450C' +
'D1B026ACE02D53C22A0E60850CD43089B092A5653D3C0C082AC66' +
'1F50E639AA9AEBD76FA2AAD90394794F845DB750CD696FEF44310' +
'700174E1151');
dtm_TheFilled := DTMFromString('78DA63DCC9C4C07083010D30229140FA0450C' +
'D4D026ACE01D53C21A0E61050CD07026AB601D5BC24A0662F50CD' +
'63089B092AB66CF956066674350F51D52424D7A1AA3988A9263EA' +
'90ECC86AB390EE4DD455593985A8F620E0002E014BD');
end;
end;
end;

procedure FreeDTMs;
begin
FreeDTM(dtm_TheEmpty);
FreeDTM(dtm_TheFilled);
end;

function DoSleeping: boolean;
var
WaitTime, i: integer;
begin
Result:= False;
if ((GetSystemTime - SleepTimer) >= ((SleepEvery + random(SleepRandom)) * 60000))then
begin
WaitTime:= GetSystemTime;
I:= ((SleepFor + random(4)) * 60000) + random(6000);
if LoggedIn then Logout;
Writeln('Waiting for '+ IntToStr(I div 60000));
while ((GetSystemTime - WaitTime) <= (I))do
Status('Waiting - '+IntToStr((I - (GetSystemTime - WaitTime)) div 60000)+' left.');
SleepTimer:= GetSystemTime;
Inc(int_Sleeps);
Writeln('Sleep concluded.');
result:= true;
end;
end;

procedure DoTheAntiBans;
var
z, c, i: Integer;
begin
if TimeFromMark(OverallTimer) > 10 * 60000 then
begin
ClearReport;
MarkTime(OverallTimer);
for i := 0 to 5 do
begin
AntibanTimer[i] := Random((i + 1) * i) + 1 + Random(3);
AddToReport('AntibanTimer[' + IntToStr(i) + '] = ' + IntToStr(AntibanTimer[i]));
end;
end;
for i := 0 to 5 do
if TimeFromMark(AntiBanMark[i]) > (AntibanTimer[i] * (60000 + Random(30000))) then
begin
AddToReport('Performing antiban number ' + IntToStr(i));
case i of
0: begin MMouse(RandomRange(0, 760), RandomRange(0, 500), 0, 0); Wait(Random(1500) + Random(500)); end;
1: begin RandomRClick; Wait(Random(1000) + Random(2000)); end;
2: Wait(Random(15000));
3: begin
repeat
c := Random(13) + 1;
GameTab(c);
Wait(Random(2000));
inc(z);
until z >= 3;
end;
4: BoredHuman;
5: HoverSkill('magic', False);
end;
MarkTime(AntiBanMark[i]);
end;
end;

procedure DoRandoms;
var
i: Integer;
begin
FindNormalRandoms;
if AntiBan then DoTheAntiBans;
if DoSleeping then LoginPlayer;
if (GetTimeRunning div 1000 div 60 - LastMins2) - LastScriptReport.Worked > 5 then
begin
IncEx(ReportVars[2], ((ReportVars[0] * 65) + (ReportVars[1] * 86)));
SendSRLReport;
for i := 0 to 2 do
ReportVars[i] := 0;
end;
end;

function GetObjectPosition(var TP: Tpoint; var TB: TBox): Boolean;
var
InventNumber: Integer;
begin
case LowerCase(Mode) of
'turbo', 'stepped': begin
GameTab(4);
if FindDTM(dtm_TheEmpty, TP.x, TP.y, 548, 206, 728, 466) then
Result := True
else
Result := False;
InventNumber := CoordsToItem(TP.x, TP.y);
TB := InvBox(InventNumber);
if not Result then Writeln('Object not found');
end;
'filling': begin
if FindDTM(dtm_TheEmpty, TP.x, TP.y, 0, 0, 508, 327) then
Result := True
else
Result := False;
TP := MSTPointToBankPoint(TP);
TB.x1 := MIX1;
TB.y1 := MIY1;
TB.x2 := MIX2;
TB.y2 := MIY2;
end;
end;
end;

function CastAndEmpty: Boolean;
var
pos_ObjectTP: TPoint;
pos_ObjectTB: TBox;
begin
case LowerCase(Mode) of
'stepped', 'turbo':
begin
if not GetObjectPosition(pos_ObjectTP, pos_ObjectTB) then Exit;
end;
'filling':
begin
if not OpenBankFast(Location) then Exit;
Deposit(29 - ObjectsPerInvent, 28, True);
if GetObjectPosition(pos_ObjectTP, pos_ObjectTB) then Withdraw(pos_ObjectTP.x + 1, pos_ObjectTP.y + 1, 0) else Exit;
CloseBank;
end;
end;
begin
GameTab(7);
if not GetColor(561, 252) = 7627069 then
begin
Writeln('OutOfSpells');
TerminateScript;
end;
if (int_Casted - int_TempCasts >= 4) or (int_Casted = 0) then
begin
int_TempCasts := int_Casted;
MouseBox(559, 333, 574, 347, 1);
Inc(int_ImbueCasts);
Inc(ReportVars[1]);
case Random(5) of
1: Wait(500 + Random(500));
2: Wait(300 + Random(200) + Random(150));
3: Wait(750 + Random(750));
4: Wait(1500 + Random(500));
5: Wait(200 + Random(400));
end;
//Wait(600 + Random(300));
end;
MouseBox(557, 244, 577, 264, 1);
GameTab(4);
case LowerCase(Mode) of
'stepped', 'turbo': MMouse(pos_ObjectTP.x, pos_ObjectTP.y, 20, 20);
end;
repeat
Wait(500 + Random(500));
until FindDTM(dtm_TheFilled, pos_ObjectTP.x, pos_ObjectTP.y, pos_ObjectTB.x1, pos_ObjectTB.y1, pos_ObjectTB.x2, pos_ObjectTB.y2)
case LowerCase(Mode) of
'stepped', 'turbo':
begin
GetMousePos(pos_ObjectTP.x, pos_ObjectTP.y);
if IsUpText('Empty') then
Mouse(pos_ObjectTP.x, pos_ObjectTP.y, 0, 0, True)
else begin
Mouse(pos_ObjectTP.x, pos_ObjectTP.y, 0, 0, False);
ChooseOption('Empty');
end;
Wait(500 + Random(500));
Result := True;
Inc(int_Casted);
Inc(ReportVars[0]);
end;
'filling':
begin
Result := True;
Inc(int_Casted);
Inc(ReportVars[0]);
IncEx(int_Filled, ObjectsPerInvent);
end;
end;
end;
end;

procedure Proggy;
var SpellsPh, XPPh, ObjectsPH: Integer;
begin
ClearDebug;
SpellsPh := Round(((int_Casted + int_ImbueCasts) * 3600.0) / (GetTimeRunning / 1000.0));
XPPh := Round((((int_Casted * 65) + (int_ImbueCasts * 86)) * 3600.0) / (GetTimeRunning / 1000.0));
ObjectsPH := Round(((int_Casted * ObjectsPerInvent) * 3600.0) / (GetTimeRunning / 1000.0));
Writeln('----- Humidifier v' + Version + ' by The Claw -----');
Writeln(' Ran for ' + TimeRunning);
Writeln(' Casted ' + IntToStr(int_Casted) + ' humidifies and ' + IntToStr(int_ImbueCasts) + ' magic imbues');
Writeln(' Gained ' + IntToStr((int_Casted * 65) + (int_ImbueCasts * 86)) + ' exp.');
if int_Filled > 0 then
Writeln(' Filled ' + IntToStr(int_Filled) + ' objects, filling ' + IntToStr(ObjectsPH) + ' per hour');
if int_Sleeps > 0 then
Writeln(' Slept ' + IntToStr(int_Sleeps) + ' times');
Writeln(' So currently casting ' + IntToStr(SpellsPH) + ' spells per hour and gaining ' + IntToStr(XPPH) + ' experience per hour.');
end;


procedure ScriptTerminate;
begin
FreeDTMs;
end;

procedure SetupScript;
var
i: Integer;
begin
SmartSetupEx(SmartWorld,True,True,False);
SetTargetDC(SmartGetDC);
SetupSRL;
DeclarePlayers;
LoadDTMs;
int_TempCasts := 0;
MarkTime(SleepTimer);
for i := 0 to 5 do
MarkTime(AntibanMark[i]);
SRLID := YourSRLID;
SRLPassword := YourSRLPass;
ScriptID := '1156';
end;

begin
SetupScript;
LoginPlayer;

case LowerCase(Mode) of
'turbo', 'filling': begin
repeat
CastAndEmpty;
DoRandoms;
Proggy;
until False;
end;
'stepped': begin
repeat
repeat
Wait(100);
until IsFKeyDown(12);
Writeln('Initialising...');
Wait(1000 + Random(500));
repeat
CastAndEmpty;
DoRandoms;
Proggy;
until IsFKeyDown(12);
Writeln('Stopping...');
Wait(1000 + Random(500));
until False;
end;
end;
end.

Changelog:

0.01 - support for vials only
0.02 - now casts magic imbue every 4th humidify, support for fishbowls
0.03 - added srl stats, antiban and break taker

Narcle

2009-01-18 05:40:04

Add fishbowl. Its one click to empty, I heard you can get like 60k xp/h with fishbowl.

Pyro

2009-01-18 20:18:26

Heh. I love your scripting :) No junk. Just does what it says.

Unfortunately no testing for me as no members. But nice :)

The Claw

2009-01-21 02:52:14

Thanks pyro :p

Added in fishbowl support, it also now casts magic imbue every 4th humidify which ups the xp a fair bit. Looks like they were right Narcle :) I could probably get it up to 70-75k xp/hour, without any of the waits between casting, but it's best to keep them in I think, makes it more humanlike

Narcle

2009-01-21 06:38:03

From: The Claw
Thanks pyro :p

Added in fishbowl support, it also now casts magic imbue every 4th humidify which ups the xp a fair bit. Looks like they were right Narcle :) I could probably get it up to 70-75k xp/hour, without any of the waits between casting, but it's best to keep them in I think, makes it more humanlike


Epic. I see 62k xp/h up there.

Yeah… best to keep the waits lol

The Claw

2009-01-21 21:49:32

Updated with antiban, the break taker from sudoku (thanks to whoever put that in, lol) and srl stats. The xp averages about 50k/hour with antiban on, but it makes the script much more human. Don't know if that will reduce the chances of getting banned or not, but it's one less thing to stress over lol