SRL Archive - OSR Help

What are the SRL-6 globals?


Wu-Tang Clan

2013-09-29 17:11:07

I'm trying to figure out SRL-6, but so far I have found it extremely confusing. What are the globals? How do I script a simple chatbox text finder? The documentation for the include are vague, and the examples leave me clueless. Could there be a simple guide on how to script using srl-6. I learned to script by reading the includes with srl-5, I just don't see how anyone can really read these functions. Maybe somebody who aided in making srl-6 could clear some of this up? No offense to those involved, I appreciate that you are trying to help everyone by keeping the includes up to date with runescape.

Olly

2013-09-29 20:01:51

function TRSChatBox.findText(): boolean; // to be called as, chatBox.findText(params);
begin
if (not self.isOpen()) then
begin
writeln('chatbox aint open...!');
exit();
end;

// result := findText(blah, blah, blah, self.getBounds(), etc, etc);
end;

Wu-Tang Clan

2013-09-30 22:36:07

From: Olly
function TRSChatBox.findText(): boolean; // to be called as, chatBox.findText(params);
begin
if (not self.isOpen()) then
begin
writeln('chatbox aint open...!');
exit();
end;

// result := findText(blah, blah, blah, self.getBounds(), etc, etc);
end;


How would I have figured that out without any reference to this thread? I'm not understanding where these globals come from.

Le Jingle

2013-09-30 23:20:06

globals in srl6 = https://github.com/SRL/SRL-6/blob/master/lib/core/globals.simba

the TRSChatBox is not a global, it is a type.

this type in specific, TRSChatBox, is indeed declared as type, and if it is confusing to not see it in the globals file, it may very well be because the file containing the type declaration is setup in SRL (when you use, #include "SRL.Simba"). So make sure to understand operation prior, but question good to learn, as it may be confusing at first!

Cheers,
Lj

Wu-Tang Clan

2013-10-01 09:04:35

From: Le Jingle
globals in srl6 = https://github.com/SRL/SRL-6/blob/master/lib/core/globals.simba

the TRSChatBox is not a global, it is a type.

this type in specific, TRSChatBox, is indeed declared as type, and if it is confusing to not see it in the globals file, it may very well be because the file containing the type declaration is setup in SRL (when you use, #include "SRL.Simba"). So make sure to understand operation prior, but question good to learn, as it may be confusing at first!

Cheers,
Lj


So if I'm observing correctly, you pretty much remove the "TRS" from the function: TRSChatBox.findText(): boolean; = chatbox.findtext:(yada);

masterBB

2013-10-01 10:35:47

I will keep it supershort. But let's create the need to look onto the mainscreen. We want to kill a goblin!

The first step would be to go to the documentation since examples and tutorials aren't here yet. http://docs.villavu.com/srl-6/

Since we will have to search the mainscreen, the mainscreen part will probably be most helpfull.
http://docs.villavu.com/srl-6/mainscreen.html

Notice that since it is considerd an interface, it inherits all the functions from interface, like getBounds();
http://docs.villavu.com/srl-6/interfaces.html

We looking at the mainscreen documentation let's decide that the findObject function is what we are looking for. At the beginning of the page you can see that srl creates there own mainscreen by default and saves it in the variable: mainscreen.

Assuming we have the color of the Goblin stored in a variable called GoblinColor and 10 is the tolerance:
mainscreen.findObject(x, y, GoblinColor, 10, colorSetting(1), mainscreen.getCenterPoint(), 50, 25, 40, ['oblin', 'ttack'], MOUSE_LEFT);

Notice that:
ColorSetting(1) will use CTS 1.
mainscreen.getCenterPoint() gets the old MSCX and MSCY

I hope this helps you!

Wu-Tang Clan

2013-10-01 19:09:02

From: masterBB
I will keep it supershort. But let's create the need to look onto the mainscreen. We want to kill a goblin!

The first step would be to go to the documentation since examples and tutorials aren't here yet. http://docs.villavu.com/srl-6/

Since we will have to search the mainscreen, the mainscreen part will probably be most helpfull.
http://docs.villavu.com/srl-6/mainscreen.html

Notice that since it is considerd an interface, it inherits all the functions from interface, like getBounds();
http://docs.villavu.com/srl-6/interfaces.html

We looking at the mainscreen documentation let's decide that the findObject function is what we are looking for. At the beginning of the page you can see that srl creates there own mainscreen by default and saves it in the variable: mainscreen.

Assuming we have the color of the Goblin stored in a variable called GoblinColor and 10 is the tolerance:
mainscreen.findObject(x, y, GoblinColor, 10, colorSetting(1), mainscreen.getCenterPoint(), 50, 25, 40, ['oblin', 'ttack'], MOUSE_LEFT);

Notice that:
ColorSetting(1) will use CTS 1.
mainscreen.getCenterPoint() gets the old MSCX and MSCY

I hope this helps you!


Yes this was exactly what I wanted :) Thanks!