SRL Archive - Research & Development Lounge

SRL Updates


Kevin

2013-05-16 13:27:44

SRL is not perfect, it also is only as complete as we want it to be. I'm not saying it's missing anything major with that comment, simply that everything can be improved - either via bug fixes or new functionality.

On that note, I want to contribute more to SRL itself (and perhaps others do as well), but I feel like most people (based on myself) simply don't know where or how to contribute and develop towards SRL. That's where I want this thread to come in - not just for myself but for any who wish to develop for SRL. I would like anyone who feels like it to add either bugs or suggested SRL updates to compile a list that anyone can add to, or work on to improve SRL. Yes, I know we have an area to submit bugs, but I feel having them listed alongside other updates gives people a single location where they may choose to fix/add something based off a single list.

  1. GrandExchange.simba is outdated - [sticktothescript]
  2. GetAbilityCooldown is inaccurate for some abilities RS bug. detailed below.
  3. Support non-English worlds
  4. There is no standard method for getting max hp (several people have implemented their own) - [myself]

Suggestions to add/anyone wanna take any of these on?

Olly

2013-05-16 15:34:43

Please can you give @euphemism a more accurate report of what abilities don't work for getCoolDown? :)

Kevin

2013-05-16 15:50:59

From: Ollybest
Please can you give euphemism a more accurate report of what abilities don't work for getCoolDown? :)


I'll try and gather a list based off all the skills (I have available) tonight and throw the mention tag for him next to it as soon as I do.

StickToTheScript

2013-05-16 16:12:37

Began working on the GE a bit. Will see what I come up with. Not finished testing.

Kevin

2013-05-17 13:03:26

@euphemism
Looked into the GetAbilityCooldown issue much more thoroughly. Wrote a small snippet to print out the cooldown over every skill while it was spamming them. Discovered the issue isn't due to any current issue in code, but appears to be a RS bug instead.
Whenever any ability is used, all abilities get a cooldown of about 600ms (this is normal, expected behavior). About 1% of the time that this 'all skill cooldown' occurs however, that little cooldown timer on the boxes fails to show up (or it has a delay where it starts at about the halfway point), however the cooldown is still enacted, preventing skill usage and displaying that little in game error message "still on cooldown".
So I don't think there's really anything that can be done for the GetAbilityCooldown code because there really is no visual cue in these random circumstances. It can just be chalked down as another in-game bug that slightly hinders us. Sorry for that, Euph.

euphemism

2013-05-17 14:16:03

From: Kevin
@euphemism
Looked into the GetAbilityCooldown issue much more thoroughly. Wrote a small snippet to print out the cooldown over every skill while it was spamming them. Discovered the issue isn't due to any current issue in code, but appears to be a RS bug instead.
Whenever any ability is used, all abilities get a cooldown of about 600ms (this is normal, expected behavior). About 1% of the time that this 'all skill cooldown' occurs however, that little cooldown timer on the boxes fails to show up (or it has a delay where it starts at about the halfway point), however the cooldown is still enacted, preventing skill usage and displaying that little in game error message "still on cooldown".
So I don't think there's really anything that can be done for the GetAbilityCooldown code because there really is no visual cue in these random circumstances. It can just be chalked down as another in-game bug that slightly hinders us. Sorry for that, Euph.


I see, so you are of the mind that the best course of action is to wait for Jagex to fix the bug?

Kevin

2013-05-17 14:25:14

From: euphemism
I see, so you are of the mind that the best course of action is to wait for Jagex to fix the bug?


Either that or simply have people using skills add some slight manual delay anyway. Therefore, as opposed to spamming every button the exact instant the cooldown is off anyway, have additional slight delays between ability usage. Ignoring any factor of current cooldowns, no skill can be used within 0.6 seconds of another anyway. Therefore, it would seem to me that the best course of action for scripters is to encourage an additionally handled delay at this point or let them continue as is on their own and wait for this to be fixed within RS. Any script attempting a skill "spam" would only need 2 more lines of code to get around this.
Between those reasons, I don't see any reason to add any additional logic to try and handle that in SRL (your code) itself.

Edited: 05/20/2013 -
@euphemism - it turns out I was wrong, there is a case where GetAbilityCooldown is incorrect. As any Threshold or Ultimate ability finishes that "mini cooldown" for a split second, it flashes a complete white screen which is recognized as a cooldown that is finished (which isn't the entire case, as it isn't a usable ability if you don't have enough adrenaline).
The numbers on that gif are made with the following code:
for i:=1 to 12 do
begin
SMART_DrawText(ActionBarSlotToBox(i).x1, ActionBarSlotToBox(i).y1, LoginChars, IntToStr(GetAbilityCooldown(i)), 13158600);
end;

This is at least easily passable with a check for adrenaline percent, however that depends on knowing which slots is threshold or ultimate. So it's not a huge bug, but I do think it's a bug we could possibly fix unlike the originally mentioned one.

euphemism

2013-05-28 18:20:46

From: Kevin

@euphemism - it turns out I was wrong, there is a case where GetAbilityCooldown is incorrect. As any Threshold or Ultimate ability finishes that "mini cooldown" for a split second, it flashes a complete white screen which is recognized as a cooldown that is finished (which isn't the entire case, as it isn't a usable ability if you don't have enough adrenaline).


Ah, I see. This seems like something that can be accounted for within the cooldown function. Thank you for pursuing this.

EngageTheRage

2013-05-28 18:27:57

an observation, in SLR-OSR/SRL/core/gametab.simba the GetXp function moves the mouse to the top left of the skill box instead of the centre, when hovering to make the XP box appear. There are a few other minor issues i saw as well, when i remember i'll put there in here too.

line 1089:
 MMouse(MouseTB.X1+3,MouseTB.Y1+3, 55, 25); 
i think should be:
 MMouse((MouseTB.X1 + MouseTB.X2) / 2, (MouseTB.Y1 + MouseTB.Y2) / 2,  55,  25); 

** this is what the thread is for right? **

Itankbots

2013-05-28 22:37:41

From: StickToTheScript
Began working on the GE a bit. Will see what I come up with. Not finished testing.


If you need help with GE. Ill help ya. I will need that for some coming scripts im making, was going to have to re-write most them anyways. Already did a few. Im having surgery tomrrow tho. Won't be on much for a week or so. Feel free to hit me up on skype : Peter_knight2191

Just put ur SRl name in request so ik its you :P and we can talk ^^

StickToTheScript

2013-05-28 23:03:02

From: Itankbots
If you need help with GE. Ill help ya. I will need that for some coming scripts im making, was going to have to re-write most them anyways. Already did a few. Im having surgery tomrrow tho. Won't be on much for a week or so. Feel free to hit me up on skype : Peter_knight2191

Just put ur SRl name in request so ik its you :P and we can talk ^^


Added

Enslaved

2013-05-29 07:02:19

I will do the Max Hp method, just fixing OCR now.

function Closewin(button,WaitT:integer): Boolean; //0 = noclick, 1 = click
var
bmp, t, x, y, i: integer;
begin
Result := False;
Bmp := BitmapFromString(11, 9, 'meJzTzp6rs/Gv1oyHWgYZSkqhkso' + 'JQDZQRDKyj4dHRlPTUMcwEiICJBXMaiBstSn3OEScmJmlmZiEpaW9' + 'FFXSIeIQBJTlFgtkZTVmYVECKpCSspeWChLTLoErENUu4eZ24uCAK' + 'hASshSRigTqwmUCp6gTRBZIAs2BszmErZmZpRgZuaUi+yAiPOKBPD' + 'xOQL0QNUBfMDEJycioAJUB1XCKWLOxGUMQUC9ElomJZ/r06UBDgBY' + 'BlQFtBCIgA2yyEFA8MzPv1KlTAA4RVsQ=');
MarkTime(T);
while (TimefromMark(t) < WaitT) do
begin
if FindBitmapToleranceIn(bmp, x, y, 400, 0, 500, 100, 20) then
begin
writeln('Found x');
If (button = 1) Then
begin
MMouse(x, y, 3, 3);
ClickMouse2(True);
end;
Result := True;
FreeBitmap(bmp);
exit;
end;
inc(i);
getmousepos(x, y);
If (TimeFromMark(t) Mod 4) = 0 then
MMouse(x + randomrange( - 5, 5), y + Randomrange( - 5, 5), 2, 2);
wait(randomrange(10,50));
end;
FreeBitmap(bmp);
end;

function GetMaxHp: Integer;
begin
CloseWin(1,300);
GameTab(tab_Equip);
if not WaitTabExists(tab_Equip, 3000) then
begin
Result := - 1;
Exit;
end;
MMouse(RandomRange(555, 590), RandomRange(420, 450), 3, 3);
ClickMouse2(True);
CloseWin(0,1000);
Result := StrToInt(Replace(GetTextAtExWrap(250, 68, 290, 80, 0, 1, 4, 12903403, 75, 'EquipChars'), ' ', ''));
CloseWin(1,100);
if result < 800 then
result := getmaxhp;
end;