SRL Archive - OSR Help

Require some help, maybe.


iEatApplez

2014-09-15 10:20:43

Hello there,
I just recently started scripting an AIO Fletching script, but I got stuck on the part after clicking Craft-All.
It has to cut 27 logs or string 14 bows, and I could let the script wait for the exact time it takes to fletch those, or untill a bitmap of the longbow/shortbow has been found in the last slot of the invertory, but I think there should be a better and easier way to do that.
It'd also be nice if the script could antiban while waiting for the action to finish.
So please correct me if I'm wrong and should actually use sleep/wait and/or a BMP.

Thanks in advance :)

~Annonymus

rj

2014-09-15 10:48:55

You can use countItems to count the log and bow DTMs in your inventory
procedure waitToFletchAll;
var
currentLogs, t:integer;
begin
//insert fletching stuff here
currentLogs := countItems('dtm', logDTM, []);
markTime(t);
repeat
// anti ban stuff or something
if (countItems('dtm', bowDTM, []) = currentLogs) then
exit()
else
wait(100);
until (timeFromMark(t) > 50000);
end;

So right here pretty much the number of logs in your inventory is stored in the variable 'currentLogs'. Instead of using 27 you want to get the number of logs in your inventory before you fletch them incase a unexpected item enters your inventory at any point during the script(you will see why below). Next, it will loop until one of these conditions is met:

a) The number of bow DTMs counted matches the number of logs counted. If you where to use 27 instead of counting the logs, if there was a unexpected item making the number of logs 26, then it would defeat the purpose of this procedure and the script would be waiting 50 seconds everytime.
b) More than 50 seconds pass

iEatApplez

2014-09-15 18:06:51

From: Robert
You can use countItems to count the log and bow DTMs in your inventory
procedure waitToFletchAll;
var
currentLogs, t:integer;
begin
//insert fletching stuff here
currentLogs := countItems('dtm', logDTM, []);
markTime(t);
repeat
// anti ban stuff or something
if (countItems('dtm', bowDTM, []) = currentLogs) then
exit()
else
wait(100);
until (timeFromMark(t) > 50000);
end;

So right here pretty much the number of logs in your inventory is stored in the variable 'currentLogs'. Instead of using 27 you want to get the number of logs in your inventory before you fletch them incase a unexpected item enters your inventory at any point during the script(you will see why below). Next, it will loop until one of these conditions is met:

a) The number of bow DTMs counted matches the number of logs counted. If you where to use 27 instead of counting the logs, if there was a unexpected item making the number of logs 26, then it would defeat the purpose of this procedure and the script would be waiting 50 seconds everytime.
b) More than 50 seconds pass


Thanks a bunch! Also, I doubt it's possible in OldSchool as of now to get unexpected items as randoms are optional and there's no such thing as spin tickets or strange rocks, but I'll play with this a little.
Also, I see you're using DTMs in that procedure, would the countItems also work with BMPs?

Edit: stupid question. lol.