SRL Archive - Blogs and Writing

Development diary - Flipping script


SlipperyPickle

2015-02-28 04:24:17

This is my long-term project. I started this 'blog' to keep me motivated. My progress will be posted here every once in a while. As I was working on this script I learned a lot. Because of that I rewrote the entire script multiple times. In the current state I'm quite happy, so for now I can (hopefully) make more progress.

Project overview:


  • Grand exchange functions
  • [*]Buy item high and sell cheap to get the prices
    [*]Database management
    [*]Bulk buying item with most profit
    [*]Getting the prices with tesseract
    [*]Getting the quantity with tesseract
    [*]Break system
    [*]Multiplayer
    [*]Releasing for public use
    [*]Easy way of adding new items

Changelog:


05-07-2016
Rewrote the entire script. Most of the script is working now.


Credits:


@The Mayor - For his grand exchange functions.
@3Garrett3 - For his text-parsing snippet.
@Olly - For the Tesseract filter


Feel free to post suggestions!

Sin

2015-02-28 08:41:11

I wrote a fully functioning merchanter (still works!), only problem with it is the huge item list with limits that you need.

SlipperyPickle

2015-02-28 10:01:12

From: Sin
I wrote a fully functioning merchanter (still works!), only problem with it is the huge item list with limits that you need.


Nice! I wasn't planning on making a huge list, just the items I usually flip, since I know they work. Just trying to automate the process ;)

SlipperyPickle

2015-02-28 10:13:18

Updated OP with my progress.

28-02-2015
Had to rewrite several parts of the grand Exchange. Because sometimes the search box doesn't open at the same place.

Updated functions:
  • geGetBounds(); (thought the ge was always at the same place when opened, which isn't true. Now it dynamically searches for the ge).
  • geSearchBoxBounds() (same reason. Now it dynamically gets the search box, and tBoxes for the items found).

New functions:
  • gePercentageDone(); (checks how much is sold/bought)

3Garrett3

2015-02-28 11:38:56

I find it interesting that you failed to mention that the code I posted earlier is what you have for GE text reading. I'll give you the benefit of the doubt that you created the filter yourself and you've come up with the same filter as Olly, and just had the same text-parsing idea that I had and publicly posted. It's completely fine to use code I'm posting, but I would like to see some credit if that's the case.

SlipperyPickle

2015-02-28 12:01:20

From: 3Garrett3
I find it interesting that you failed to mention that the code I posted earlier is what you have for GE text reading. I'll give you the benefit of the doubt that you created the filter yourself and you've come up with the same filter as Olly, and just had the same text-parsing idea that I had and publicly posted. It's completely fine to use code I'm posting, but I would like to see some credit if that's the case.


Oh I'm really sorry! Found that code on paste.villavu.com. Didnt know whos code that was, will add to credits! Was never my intention to insult anyone, or anything like that!

here is the link. Will add credits now!

3Garrett3

2015-02-28 12:17:07

From: SlipperyPickle
Oh I'm really sorry! Found that code on paste.villavu.com. Didnt know whos code that was, will add to credits! Was never my intention to insult anyone, or anything like that!

here is the link. Will add credits now!


Hahah this is the foundation of a project I'm working on with Taric, right now we plan on being selfish and keeping the profits to ourselves though ;). Credit Olly for the Filter, I would have been still trying to figure out tesseract if it weren't for him. Sorry for sounding cranky in my first post, I'd just woken up.

Taric

2015-02-28 12:20:19

From: SlipperyPickle
Oh I'm really sorry! Found that code on paste.villavu.com. Didnt know whos code that was, will add to credits! Was never my intention to insult anyone, or anything like that!

here is the link. Will add credits now!


We're going to have to talk about royalties :p

SlipperyPickle

2015-02-28 13:13:52

From: 3Garrett3
Hahah this is the foundation of a project I'm working on with Taric, right now we plan on being selfish and keeping the profits to ourselves though ;). Credit Olly for the Filter, I would have been still trying to figure out tesseract if it weren't for him. Sorry for sounding cranky in my first post, I'd just woken up.


I understand why you were mad. I too was for more than an hour busy with the filter, without success. After finding that snippet it finally worked ;)

From: Taric
We're going to have to talk about royalties :p


Haha, I'll add a part in my script that 50% of the profit will be traded to my mules, for royalties ;)

The Mayor

2015-02-28 14:14:45

You should also post a bug report if any of the SRL-6 functions are outdated.

3Garrett3

2015-02-28 14:15:53

From: The Mayor
You should also post a bug report if any of the SRL-6 functions are outdated.


Check bug reports for GE stuff I submitted ;)

The Mayor

2015-02-28 14:22:30

From: 3Garrett3
Check bug reports for GE stuff I submitted ;)


Just saw them! :)

SlipperyPickle

2015-02-28 19:59:36

From: The Mayor
You should also post a bug report if any of the SRL-6 functions are outdated.


Yeah, I know! But I wasnt sure it was a bug, or just me. Didnt want to jump to any conclusion. And i liked the challenge of a full ge script.

elaatl

2015-03-01 07:21:03

Gl ith this, I was allso intrested in making a Ge flipping script but iam more focusing on 07 but have no clue how to do that using simba :/

o0Matthius0o

2015-03-01 07:46:42

Wish i had seen this before i requested it. Let me know if you need help. I am still a noob but have written a few basic scripts.

3Garrett3

2015-03-09 15:33:08

@SlipperyPickle; Do you mind posting your function for the buy offer search box? I've submitted a bug report to @The Mayor; about it not clicking the right items in the box, but if he had more helper code for dynamically finding the searchbox I bet it would help him make a fix for it. I suggested code for actually getting the right items but I used a fixed tBox for the search coords so the dynamic box finding would be ideal.

SlipperyPickle

2015-03-09 15:50:35

From: 3Garrett3
@SlipperyPickle; Do you mind posting your function for the buy offer search box? I've submitted a bug report to @The Mayor; about it not clicking the right items in the box, but if he had more helper code for dynamically finding the searchbox I bet it would help him make a fix for it. I suggested code for actually getting the right items but I used a fixed tBox for the search coords so the dynamic box finding would be ideal.


Sure! Here you go:

function getItemBounds(itemNumber: integer): tBox;
var
i: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
b, searchBox, itemBox: TBox;
begin
if (not self.isOpen()) then
exit();

findColorsTolerance(TPA, 9877448, getClientBounds(), 35);
if length(TPA) < 1 then
begin
WriteLn('.getSearchBoxBounds(): Didn''t find correct colors');
exit();
end;

ATPA := TPA.cluster(5);
ATPA.sortBySize(true);

for i := 0 to high(ATPA) do
begin
b := ATPA[i].getBounds();
if b.getWidth() < 150 then
continue();

searchBox.setBounds(b.x1 + 60, b.y1, b.x2, b.y2); //Here you'll get the bounds of the entire searchbox
itemNumber := itemNumber - 1;
itemBox.setBounds(b.x1 + 60, b.y1 + (15 * itemNumber), b.x2 - 300, b.y2 - (16 * (6 - itemNumber))); //Here you'll get the bounds of the items in the searchbox
end;
result := itemBox;
end;

3Garrett3

2015-03-09 16:15:43

From: SlipperyPickle
Sure! Here you go:

function getItemBounds(itemNumber: integer): tBox;
var
i: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
b, searchBox, itemBox: TBox;
begin
if (not self.isOpen()) then
exit();

findColorsTolerance(TPA, 9877448, getClientBounds(), 35);
if length(TPA) < 1 then
begin
WriteLn('.getSearchBoxBounds(): Didn''t find correct colors');
exit();
end;

ATPA := TPA.cluster(5);
ATPA.sortBySize(true);

for i := 0 to high(ATPA) do
begin
b := ATPA[i].getBounds();
if b.getWidth() < 150 then
continue();

searchBox.setBounds(b.x1 + 60, b.y1, b.x2, b.y2); //Here you'll get the bounds of the entire searchbox
itemNumber := itemNumber - 1;
itemBox.setBounds(b.x1 + 60, b.y1 + (15 * itemNumber), b.x2 - 300, b.y2 - (16 * (6 - itemNumber))); //Here you'll get the bounds of the items in the searchbox
end;
result := itemBox;
end;


Sweet, looks like the same idea I was trying to give him. I think he might be looking for the entire search box coords, but I'm not 100% sure what direction he's headed in.

What's the progress like on this btw? @Taric; and I have a prototype that does a lot of the simpler things. We've got quite a heavy to-do list to go through before it's finished though.

SlipperyPickle

2015-03-09 16:21:49

From: 3Garrett3
Sweet, looks like the same idea I was trying to give him. I think he might be looking for the entire search box coords, but I'm not 100% sure what direction he's headed in.

What's the progress like on this btw? @Taric; and I have a prototype that does a lot of the simpler things. We've got quite a heavy to-do list to go through before it's finished though.


I have put my project on a hold for now, since I go on my holiday to Africa in a few days.

Didn't update the blog, but I have written the buy and sell part. Had to rewrite the part where it got the price, since it wasn't accurate enough. Had to write a script that searches for the bounds of the price, before parsing the text. Will continue this when I'm back home :)

Aufi

2015-03-09 16:59:59

For RS3 or 07? Or maybe both? Sounds interesting!

SlipperyPickle

2015-03-09 17:14:02

From: Aufi
For RS3 or 07? Or maybe both? Sounds interesting!


RS3, I don't "play" 07 ;)

The Mayor

2015-03-10 03:54:19

I had some time this arvo so fixed (most) the GE issues that Garrett reported.

Thomas

2015-03-13 13:11:18

Good job on those fixes @the Mayor :)
Will be usefull for my production script to update ge offers.

Might consider making a somewhat Flawless public base for other scripts such as a granite cutter to buy and sell items. And dont have to bother running out of supplies, but seems like a waste of time to do so untill opening the collect screen has been added to srl?

The Mayor

2015-03-13 17:45:23

From: lovebotter
Good job on those fixes @the Mayor :)
Will be usefull for my production script to update ge offers.

Might consider making a somewhat Flawless public base for other scripts such as a granite cutter to buy and sell items. And dont have to bother running out of supplies, but seems like a waste of time to do so untill opening the collect screen has been added to srl?


Didn't you get my PM? Just use that for the time being?

Thomas

2015-03-13 18:14:42

From: The Mayor
Didn't you get my PM? Just use that for the time being?



Ye I got it! Thanks a bunch for that.
But I meant for the public add-on for new scripters to add to their scripts to update supplies on their production scripts :)

SlipperyPickle

2015-10-04 16:28:26

Update:

Long time ago since I posted. I now have a full time job, and decided that I needed to focus on that. Now that I have some extra spare time, I'm coming back to this community.

I've lost all of my scripts due to not backing up my work. I've worked all day in rebuilding this script. As you can read in OP, that's going pretty great. At first my skills where a little rusty, but now it's going great.