SRL Archive - SRL Suggestions

misc/INITiming.scar (or something like it)


Cigue

2010-07-19 19:39:55

Periodic collection is the single most profitable activity in runescape.

Here are a few functions that work just like TimeFromMark and MarkTime. Those are two of the functions I use the most in failsafes, and I figure that everyone should. However, there is a core application that these do not cover, like the kind of timing you'd need for a farming script.

Introducing MarkTimeINI and TimeFromMarkINI.

These are time marks that you can write in one script and read in another, or that you can read from a past occurence of the same script. As an example, a periodic collection script would need to know before execution if it has been run recently, because you can only collect these every 24 hours.

If you think these scripts are useless because you haven't seen them before, you're wrong : periodic collection is the most profitable repeatable group of activities in runescape, sometimes neighbouring up to several millions of profit per hour doing perfectly legit activities.

The reason why you haven't seen these is that there were no means of providing the timing functions necessary to these scripts by the past : you cannot run a broad bolt collection script more than every 24 hours, etc.

About two thirds of collection activities, however, reset every GMT midnight instead of 24 hours after the last run. A third function would be of use here for which I haven't found a good name, so let's call it HasMidnightPassedINI. The parameters include the timezone the script user is in, however, so this function is not for use outside of scripts that completely require its use.

{$i SRL/SRL.scar}

var INIFilePath : string;

procedure MarkTimeINI(Mark : String);
begin
if INIFilePath = '' then INIFilePath := ScriptPath + 'ScriptInstructions.ini';
WriteINI('Time Marks', Mark, TheTime + ' ' + TheDate(3), INIFilePath);
end;

function TimeFromMarkINI(Mark: String) : integer;
var
LH, LDBM, CH, CDBM, i : integer;
DaysInMonthLY, DaysInMonthCY : TIntegerArray;
LRA, CRA : TStringArray;
LRAA, CRAA : array [0..1] of TStringArray;

begin
if INIFilePath = '' then INIFilePath := ScriptPath + 'ScriptInstructions.ini';

SetArrayLength(LRA, 3);
SetArrayLength(CRA, 3);
SetArrayLength(LRAA[0], 3);
SetArrayLength(LRAA[1], 3);
SetArrayLength(CRAA[0], 3);
SetArrayLength(CRAA[1], 3);

LRA := srl_Explode(ReadINI('Time Marks', Mark, INIFilePath), ' ');
LRAA[0] := srl_Explode(LRA[0], ':');
LRAA[1] := srl_Explode(LRA[2], '-');
CRA := srl_Explode(TheTime + ' ' + TheDate(3), ' ');
CRAA[0] := srl_Explode(CRA[0], ':');
CRAA[1] := srl_Explode(CRA[2], '-');

CH := StrToInt(CRAA[0][0]);
if (CRA[1] = 'PM') then IncEx(CH, 12);

LH := StrToInt(LRAA[0][0]);
if (LRA[1] = 'PM') then IncEx(LH, 12);

SetArrayLength(DaysInMonthLY, 12);
SetArrayLength(DaysInMonthCY, 12);
DaysInMonthLY := [31, 28, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30];
DaysInMonthCY := [31, 28, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30];

if ((StrToInt(LRAA[1][0]) mod 4) = 0) then
Inc(DaysInMonthLY[1]);
if (StrToInt(CRAA[1][0]) mod 4 = 0) then
Inc(DaysInMonthCY[1]);

for i := 0 to (StrToInt(CRAA[1][1]) - 1) do
IncEx(CDBM, DaysInMonthCY[i]);
for i := 0 to (StrToInt(LRAA[1][1]) - 1) do
IncEx(LDBM, DaysInMonthLY[i]);

Result := (StrToInt(CRAA[0][2]) - StrToInt(LRAA[0][2])) + 3600*(CH - LH);
Result := Result + 60*(StrToInt(CRAA[0][1]) - StrToInt(LRAA[0][1]));
Result := Result + 86400*(StrToInt(CRAA[1][2]) - StrToInt(LRAA[1][2]) + CDBM - LDBM);
Result := Result + 31536000*(StrToInt(CRAA[1][0]) - StrToInt(LRAA[1][0]));
end;

function HasMidnightPassedINI(Mark : string; TimeZone : extended) : Boolean;
var
MidnightHour, MidnightMinutes : string;
TempHour : integer;

begin
if INIFilePath = '' then INIFilePath := ScriptPath + 'ScriptInstructions.ini';

if (TimeZone > 12) or (TimeZone < -12) then
begin
srl_Warn('HasMidnightPassedINI', 'Invalid Timezone parameter', 1);
Exit;
end;

MidnightHour := IntToStr(Floor(TimeZone));

if TimeZone < 0 then
TempHour := Ceil(TimeZone)
else
TempHour := Floor(TimeZone);

WriteINI('Time Marks', 'ThisIsMidnight', MidnightHour + ':' + MidnightMinutes + ':00 AM ' + TheDate(3), INIFilePath);
if (TimeFromMarkINI(Mark) > TimeFromMarkINI('ThisIsMidnight')) then Result := True;
end;

begin//This bit is just testing the procedure to see what it does
MarkTimeINI('Mark1');
Wait(RandomRange(10000, 20000));
Writeln(IntToStr(TimeFromMarkINI('Mark1')) + ' seconds elapsed since last mark');
if HasMidnightPassedINI('Mark1', -5.30) then Writeln('Midnight has passed');
end.

NCDS

2010-07-19 19:52:22

IceFire uses a similar system in his scripts.

He saves all the 'total' values to an INI and loads it every script start up.

Perhaps have a look at his GE Arson and see how he does it, or correspond with him on this a bit?

Although, why not just make the script, then run it once a day?

Cigue

2010-07-19 21:09:32

From: NCDS
IceFire uses a similar system in his scripts.

He saves all the 'total' values to an INI and loads it every script start up.

Perhaps have a look at his GE Arson and see how he does it, or correspond with him on this a bit?

Although, why not just make the script, then run it once a day?


Farming scripts are where the money's at - and, from herbs to bushes to trees, the timing is always different, varying from 25 mins to 20 hours.

NCDS

2010-07-19 23:12:40

From: Cigue
Farming scripts are where the money's at - and, from herbs to bushes to trees, the timing is always different, varying from 25 mins to 20 hours.


I'm not familiar with the farming skill as I've never done it, and I'm not necessarily saying 'No' or anything.

I would more or less just like to see some other opinions to bounce idea's off of.

Either way, it would be a cool script :)

Ogre

2010-07-19 23:16:00

I'm not exactly sure what kind of money you can make with other skills, and maybe farming does make the most money for how much time you have to actually be working on it, but I would think there are other skill(s) that make more money over the same amount of elapsed time.

and with botting we're probably more concerned with "elapsed" time per hour than "active" time per hour.


Maybe max profit would be another skill + farming?

Cigue

2010-07-19 23:21:02

From: Ogre
I'm not exactly sure what kind of money you can make with other skills, and maybe farming does make the most money for how much time you have to actually be working on it, but I would think there are other skill(s) that make more money over the same amount of elapsed time.

and with botting we're probably more concerned with "elapsed" time per hour than "active" time per hour.


Most people here bot with armies.

Let's say you put your army to herb farming. 15 minutes of farming each. herbs take 45 mins to grow. Rotating over three characters all night is MASSIVE money.

I rest my case :)

NCDS

2010-07-19 23:23:14

From: Cigue
Most people here bot with armies.


From what I can tell, not so much these day's. Most transfer methods have been patched so I believe the majority of people just auto intelligently with their "mains" or "Skill" accounts.

Ogre

2010-07-19 23:27:57

What NCDS said, I don't think armies are as popular as they used to be, and what you said makes sense, but I think it would be a little more complex than what you originally explained (maybe not?)

Also, there aren't many (any?) farming scripts to get an army to those high levels for lots of profits, and when was the last time you heard of someone with an army of p2p accounts? :unsure:

Cigue

2010-07-19 23:32:43

From: Ogre
What NCDS said, I don't think armies are as popular as they used to be, and what you said makes sense, but I think it would be a little more complex than what you originally explained (maybe not?)

Also, there aren't many (any?) farming scripts to get an army to those high levels for lots of profits, and when was the last time you heard of someone with an army of p2p accounts? :unsure:


You're right about that. However, even for single player you can't make a farming script without a reliable timer (which is why you've never seen one before).

If nobody sees a use to this I'll just use it in my own scripts then.

i luffs yeww

2010-07-19 23:34:13

It's not that hard to make a farmer.. A timer has nothing to do with it. It's just that there's not that many people who'd risk it. The people who would use it are generally scripters (so they can make their own).

Cigue

2010-07-19 23:37:18

From: i luffs yeww
It's not that hard to make a farmer.. A timer has nothing to do with it. It's just that there's not that many people who'd risk it. The people who would use it are generally scripters (so they can make their own).


I don't get why someone would make a script and not release it, at least in member's scripts…

NCDS

2010-07-19 23:42:51

From: Cigue
I don't get why someone would make a script and not release it, at least in member's scripts…


More poeple using it mean's more risk of Jagex detecting patterns I guess. Also, can effect market values etc.

i luffs yeww

2010-07-20 01:13:08

^ This.

I've made tons of scripts but I've only released a few.

EvilChicken!

2010-07-20 15:42:15

Ah, you posted it, cool.
Still think you did a good job on this one. :)

Ogre

2010-07-20 15:45:47

Just to be clear, I wasn't trying to say this is a bad idea or anything, I can see how it could be useful.

I'm just doubting farming is the most profitable, but think it could make lots of cash if it were combined with something else.

Sabzi

2010-07-20 16:00:10

It seems I am the only voted no so I have to say why. This is not something for SRL I think. Doesn't really fit in. Individually, it's okay and I like the idea.

Shuttleu

2010-07-20 16:08:20

what sort of periodic collection are you talking about when you say periodic collection is the most profitable repeatable group of activities in runescape

~shut

i luffs yeww

2010-07-20 16:33:58

^ Farming is all I can think of. Maybe rune mining.

Cigue

2010-07-20 16:50:12

From: Shuttleu
what sort of periodic collection are you talking about when you say periodic collection is the most profitable repeatable group of activities in runescape

~shut


You probably have missed it but there's a link in the first post :)
http://runescoop.com/html/rs_MMINDEXMASTERLTD.htm
Just click the down pointing arrow next to "Equivalent hourly profit"

From: i luffs yeww
^ Farming is all I can think of. Maybe rune mining.


Wrong, there is a whole family of activities dependent on long time marks.

Short reset :
-Farming
-Jade Vine (req quest)

24h Reset :
-Broad tips (req 55 Slayer), yak hides (req quest), seaweed, pineapples
-Miscellania Kingdom Management (req quest)
-Sand collection (req quest)

Midnight Reset :
-Battlestaves, Pure Essence (req Ardougne Diary)
-Phoenix and Bork (both req quest)
-Low level alchemy from Explorer's ring (after Lumbridge Diary)

Week reset :
-Circus (!!!)
-Tears of Guthix