SRL Archive - SRL Bugs

GameTab Fix


Bionicle

2010-02-01 19:39:26

Well I fixed the procedure GetCurrentTab, I have not tested any other broken functions (I have tested with one, see below), but if I am right, it should fix a chain of broken functions.

{*******************************************************************************
function GetCurrentTab: Integer;
By: ZephyrsFury
Description: Returns current tab.
*******************************************************************************}

function GetCurrentTab: Integer;
var
tP: TPoint;
begin
if (not LoggedIn) then exit;

for Result := 1 to 16 do
begin
tP.X := 535 + (Result - 1) mod 8 * 30;
tP.Y := 169 + (Result - 1) div 8 * 298;
if (GetColor(tP.X, tP.Y) = 3775974) then
Break;
end;
result := result + 20; //SO IT ACTUALLY WORKS WITH THE TABS KTHX
end;

Ran this:

program New;
{.include SRL/srl.scar}
begin
ClearDebug;
SetupSRL;
ActivateClient;
Wait(5000);
If GetCurrentTab=25 Then
Writeln('Found it!');
end.
SRL Compiled in 16 msec
Found it!
Successfully executed

:)

E: InvFull is what was breaking in my script, so I ran this:

program New;
{.include SRL/srl.scar}
begin
ClearDebug;
SetupSRL;
ActivateClient;
Wait(5000);
If InvFull Then
Writeln('Inv full!');
end.

SRL Compiled in 15 msec
Inv full!
Successfully executed

Mwahaha :p

YoHoJo

2010-02-01 19:46:28

He changed a color
if (GetColor(tP.X, tP.Y) = 3841510) then
to
 if (GetColor(tP.X, tP.Y) = 3775974) then

PLEASE tell what you change when you make fixes. Thanks!

E: What/where exactly is that color from.

Bionicle

2010-02-01 19:48:18

From: YoHoJo
He changed a color
if (GetColor(tP.X, tP.Y) = 3841510) then
to
 if (GetColor(tP.X, tP.Y) = 3775974) then

PLEASE tell what you change when you make fixes. Thanks!


My bad ^.^
Yea, the colour was out, so I ran a MMouse when it searched for the color, changed the For…To…Do loop from 1 To 16 to 1 To 5, and when it hovered over the Inventory tab, i used SCAR to pick out the new colour.

YoHoJo

2010-02-01 20:00:24

Found it :p
http://i45.tinypic.com/2zqu9gx.png

Timer

2010-02-01 20:07:50

Err.. you didnt fix the logout one. I did, its a simple colour change.

WhiteShadow

2010-02-01 20:10:13

TabExists() > GameTab() is still broken though.

YoHoJo

2010-02-01 20:17:45

From: WhiteShadow
TabExists() > GameTab() is still broken though.


Yeah, TabExists needs a fix also (if its broken), and then GameTab will also work (GameTab uses TabExists).


From: Timer
Err.. you didnt fix the logout one. I did, its a simple colour change.


Who said he fixed it? Wat?

Bionicle

2010-02-01 20:21:26

From: YoHoJo
Found it :p
http://i45.tinypic.com/2zqu9gx.png


Aha, i see a sneak peek into your next script :rolleyes:
@whiteshadow I'll take a look at those

YoHoJo

2010-02-01 20:24:34

From: bionicle1800
Aha, i see a sneak peek into your next script :rolleyes:
@whiteshadow I'll take a look at those


lolol! :D. Yap, just need to fix a few little bugs, close to done!

Bionicle

2010-02-01 20:28:42

Err…GameTab and TabExists both work now :p

program New;
{.include SRL/srl.scar}
begin
ClearDebug;
SetupSRL;
ActivateClient;
Wait(5000);
If GameTab(25) Then
Writeln('Went to inventory tab!');
end.

SRL Compiled in 15 msec
Went to inventory tab!
Successfully executed

I did a similar thing with the other function, and it worked.

IwriteCode

2010-02-01 20:38:34

Hmm, there is a problem with the banking it attempts to click on invtab while the bankscreen is open and no tabs visible..

Bionicle

2010-02-01 20:42:05

From: IwriteCode
Hmm, there is a problem with the banking it attempts to click on invtab while the bankscreen is open and no tabs visible..


I can't see anything about that atm…but it's late…I'm going to turn in for the night. If it isn't fixed by morning, I'll look into it further :).

~G'd Night

IwriteCode

2010-02-01 20:59:40

From: bionicle1800
I can't see anything about that atm…but it's late…I'm going to turn in for the night. If it isn't fixed by morning, I'll look into it further :).

~G'd Night


OK playing around with it abit more it looks like the problem is from the Deposit(slot, toslot, thetype: Integer); procedure.

nite

Wanted

2010-02-01 23:35:45

GameTab and GetCurrent tab works

Tab Exists does not work for the logged out tab (#37) making LogOut; not work

program TestSRLGameTab;

{.Include SRL\SRL.SCAR}

var
I: Byte;

begin
SetUpSRL;
ActivateClient;
Wait(1000);
for I := 21 to 37 do
begin
WriteLn(TabExists(I));
GameTab(I);
Wait(RandomRange(500, 800));
WriteLn(GetCurrentTab);
end;
end.

LoginPlayer/same file stuff works!

Graphic setting is still buggy from before though -.-

program TestSRLLogin;

{.Include SRL\SRL.SCAR}

begin
SetUpSRL;
ActivateClient;
Wait(1000);
WriteLn(RSReady);
NumberOfPlayers(1);
Players[0].Name := 'zezima';
Players[0].Pass := 'stillneedsalifeman';
Players[0].Active := True;
LoginPlayer;
end.

Wanted

2010-02-01 23:56:55

Also!

Jagex just made a very fail update with the banking!

There are no longer ANY Tabs whilst you are banking… so it is impossible to unequip items and place them into your bank… you have to accordingly un-equip before you even open the bank.

This is massive retarded… it also messes up banking functions… my script just hovers over the Inventory tab (where it should it be but is missing) and does nothing for the longest time.

Jagex, why… just why??

YoHoJo

2010-02-02 00:07:50

ROFL! I think that's why the "Deposit All Equipped Items" button in the bank also no longer works! Haha

Bionicle

2010-02-02 10:39:19

ExistTab does not work. The way it works is if it doesn't find the background color of the tab, then it assumes that there is a tab there. I was testing with the bank open, where there is no tabs, and it kept coming back true. The color I posted above in the thing i thought would fix it only works for some tabs, as the background is kind of rocky, and has different colors for the different tabs. I am currently getting those colors and will post the fix soon enough ;)

@Icefire, i think its doing nothing because it is trying to get to the inventory tab, and because ExistTab it broken, it just keeps clicking the inventory tab (or where it should be). This is just a guess, i didn't sort through anything in the SRL include to back it up.

Bionicle

2010-02-02 11:46:45

Fix'd :p
{*******************************************************************************
function TabExists(Tab: Integer): Boolean;
By: ZephyrsFury
Description: Returns True if the Tab exists.
*******************************************************************************}

function TabExists(Tab: Integer): Boolean;
var
tP: TPoint;

begin
if (tab < 20) then
begin
SRL_Warn('TabExists', 'Tab ' + IntToStr(Tab) + ' is not using the new constants! Please upgrade your script.', warn_AllVersions);
Exit;
end;

if (not(InRange(Tab, Tab_Combat, Tab_LogOut))) then
begin
SRL_Warn('TabExists', 'Tab ' + IntToStr(Tab) + ' is not a valid tab number.', warn_AllVersions);
Exit;
end;

if (Tab = tab_LogOut) then
begin
Result := (GetColor(753, 6) = 6261404);
Exit;
end;

tP := Point(536 + (Tab - 21) mod 8 * 30, 187 + (Tab - 21) div 8 * 298);
Result := (GetColor(tP.X, tP.y) <> 4412771);
end;

Changed
if (Tab = tab_LogOut) then
begin
Result := (GetColor(753, 6) = 6327197);
Exit;
end;
To (logout 'x' color)
if (Tab = tab_LogOut) then
begin
Result := (GetColor(753, 6) = 6261404);
Exit;
end;
And
Result := (GetColor(tP.X, tP.y) <> 4478564);
To (rocky background color of the tabs)
Result := (GetColor(tP.X, tP.y) <> 4412771);

Tested on all tabs, first normally where they do exist, and second in the bank where they don't. It works both ways :)

E: looks like someone already beat me to it :p just updated my SRL, this was fixed last night

Wanted

2010-02-02 19:49:21

SetGraphics and GameTab are still bugged up (in latest SRL)… it returns Tabs are true when the bank is open, even though they are not. Which causes the script to fail. ExistsItem and MouseItem ect… need something like if (not (BankScreen)) then GameTab(tab_Inv); or just removed gamtab from those functions all together.

Edit: A fixed TabExists will solve the banking problem.

jimthesoundman

2010-02-03 22:51:00

I'm finding it really hard to figure out what the status of this problem is.
Are we positive we know what is causing it or are we just speculating?
Has anyone fixed it for sure?
Has anyone tested the fix?
Has anyone made any changes to SRL to include the fix?
Should I download these new changes (if they exist), or should I wait for more fixes?

If we had some sort of a large blinking indicator on the front page that would let everyone know when there has been an update, that would be very helpful. Otherwise, what is the option, just keep doing SVN Update every hour to see if anything has changed? Or paw through 10 different threads trying to find out what is going on?
I'm not trying to be cynical or a problem-causer, and I certainly would love to contribute to being a part of the solution, but from where I'm sitting all I know is something is broken and I don't know who is really working on the fix, or where to go to find out information, updates, or an ETA on the repair. So if we as a community could find some sort of consensus solution to these issues I'm sure the silent majority would thank you.

JIM

Wanted

2010-02-03 23:20:37

From: jimthesoundman
I'm finding it really hard to figure out what the status of this problem is.
Are we positive we know what is causing it or are we just speculating?
Has anyone fixed it for sure?
Has anyone tested the fix?
Has anyone made any changes to SRL to include the fix?
Should I download these new changes (if they exist), or should I wait for more fixes?

If we had some sort of a large blinking indicator on the front page that would let everyone know when there has been an update, that would be very helpful. Otherwise, what is the option, just keep doing SVN Update every hour to see if anything has changed? Or paw through 10 different threads trying to find out what is going on?
I'm not trying to be cynical or a problem-causer, and I certainly would love to contribute to being a part of the solution, but from where I'm sitting all I know is something is broken and I don't know who is really working on the fix, or where to go to find out information, updates, or an ETA on the repair. So if we as a community could find some sort of consensus solution to these issues I'm sure the silent majority would thank you.

JIM


Just update to the latest SRL Open Dev rev and it's all fixed.

jimthesoundman

2010-02-03 23:32:05

Maybe I was unclear. I know that is what needs to be done, but how am I to know when I need to do it? Do I do it once a month, once a week, once a day, once an hour? It would be nice if there was a better way to inform the "rank and file" when an update was ready for downloading. JMHO.

JIM

i luffs yeww

2010-02-04 00:14:41

From: jimthesoundman
Maybe I was unclear. I know that is what needs to be done, but how am I to know when I need to do it? Do I do it once a month, once a week, once a day, once an hour? It would be nice if there was a better way to inform the "rank and file" when an update was ready for downloading. JMHO.

JIM


The developer's revision of SRL can be updated a few minutes apart every few minutes for a few hours, depending on how much people add/change/mess up while doing it. So why not just do it when there's an error you have, or even every time you auto (right before it).. It's not like it takes time. And if you have any error, always update SRL before posting.

Bebe

2010-02-04 02:31:10

From: jimthesoundman
Maybe I was unclear. I know that is what needs to be done, but how am I to know when I need to do it? Do I do it once a month, once a week, once a day, once an hour? It would be nice if there was a better way to inform the "rank and file" when an update was ready for downloading. JMHO.

JIM

It's an open development project which means revisions can be committed at anytime. Rule of thumb: Do an SVN cheackout before each time you need SRL (i.e. each time you run SCAR). Takes 5 seconds….

Bionicle

2010-02-04 08:29:02

@JIM, do you know how to update your SRL? because the way your talking it seems like, for you, it takes a while, like your reinstalling SRL all over.
Just right click the SRL folder in the includes folder and press SVN update. Sometimes SRL is updated more then once a day, so what I do is every day when i get on my computer I update it, and every time I get off I update it.

E: TabExists is broken:
Line 115: [Error] (3762:1): Identifier expected in script C:\Program Files\SCAR 3.23\includes\SRL\SRL\Core\GameTab.scar

Wanted

2010-02-04 10:44:26

From: bionicle1800
@JIM, do you know how to update your SRL? because the way your talking it seems like, for you, it takes a while, like your reinstalling SRL all over.
Just right click the SRL folder in the includes folder and press SVN update. Sometimes SRL is updated more then once a day, so what I do is every day when i get on my computer I update it, and every time I get off I update it.

E: TabExists is broken:
Line 115: [Error] (3762:1): Identifier expected in script C:\Program Files\SCAR 3.23\includes\SRL\SRL\Core\GameTab.scar


Rev 366? wut?

  if (Tab = tab_LogOut) then //113
begin //114
Result := (GetColor(746, 0) = 65536); //115
Exit; //116
end;//117

Looks/Works fine for us :confused:

jimthesoundman

2010-02-04 17:06:25

Yes, I know how to update SRL, it is easy. I understand that it is easy and it takes only a minute or two. However, if you look at almost every thread in the "Bugs" category, what is the first response? Someone invariably tells the person to update to the latest version. Doesn't that mean that there is a problem somewhere, if EVERYONE is missing that simple point?

Granted, there may not be any way to make it simpler or more straightforward, considering all the people who have a hand in the development, but with all the brilliant minds here, I would think there would have to be a better way to make sure everyone is on the same page.

If you look at any P2P program, if you look at Flash, or Java, or even Windows, the program usually has an auto-update feature, which will notify the user if he is running an outdated version, and offer to download it and install it for him. Why can't we develop that for SCAR and SRL? Seems to me that it would be a no-brainer. It could even be bundled into SRL so when you run the include it would check the version and notify you if there were any changes.

I know that is what Tortoise is supposed to do, but it doesn't work that way for me. It puts a big green checkmark on all the SRL and SCAR folders, as though it has checked them and found that they are the correct versions, but evidently that is not what those big green checkmarks mean. They apparently mean that nothing has been altered since the last time you ran SVN update. So the big green checkmarks are terribly misleading.

Okay, I'm done ranting now. I'll have the nice nurse put me back in my padded cell. Please have her mix my meds in with the pudding.

Bionicle

2010-02-04 17:13:50

K. Something is not working, however it is not a Srl_Warn function so i have no idea where it is.

PROBLEM: inv interface not open