# Thread: Development diary - Flipping script

1. ## Development diary - Flipping script

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!
Last edited by SlipperyPickle; 07-05-2016 at 10:35 AM.

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

3. Originally Posted by 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

4. 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)

5. 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.

6. Originally Posted by 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!

Last edited by SlipperyPickle; 02-28-2015 at 05:03 PM.

7. Originally Posted by 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!

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.

8. Originally Posted by 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!

We're going to have to talk about royalties

9. Originally Posted by 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

Originally Posted by Taric
We're going to have to talk about royalties
Haha, I'll add a part in my script that 50% of the profit will be traded to my mules, for royalties

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

11. Originally Posted by 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

12. Originally Posted by 3Garrett3
Check bug reports for GE stuff I submitted
Just saw them!

13. Originally Posted by 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.

14. SRL Junior Member
Join Date
Jan 2015
Posts
31
Mentioned
0 Post(s)
Quoted
6 Post(s)
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 :/

15. SRL Junior Member
Join Date
Nov 2012
Location
OKC
Posts
123
Mentioned
5 Post(s)
Quoted
56 Post(s)
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.

16. @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.

17. Originally Posted by 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:

Simba Code:
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;

18. Originally Posted by SlipperyPickle
Sure! Here you go:

Simba Code:
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.

19. Originally Posted by 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

20. SRL Junior Member
Join Date
Nov 2011
Location
Norway
Posts
203
Mentioned
4 Post(s)
Quoted
100 Post(s)
For RS3 or 07? Or maybe both? Sounds interesting!

21. Originally Posted by Aufi
For RS3 or 07? Or maybe both? Sounds interesting!
RS3, I don't "play" 07

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

23. SRL Member
Join Date
May 2012
Posts
499
Mentioned
23 Post(s)
Quoted
228 Post(s)
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?

24. Originally Posted by 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?

25. SRL Member
Join Date
May 2012
Posts
499
Mentioned
23 Post(s)
Quoted
228 Post(s)
Originally Posted by 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