SRL Archive - Research & Development Lounge

Grand exchange flipper


Wardancer

2012-09-13 15:08:48

Hello,

I'm starting this thread looking for feedback. I wrote a GE flipping bot with a few interesting features:

1- Uses all 6 slots.
2- Automatically picks the buy and selling prices.
3- Goes through an independant list for each slot (decided by the user), making it easier to remember which item was used when you have to readjust the price if needed and also allow you to plan your budget, as in you can decide where you buy pricy stuff and where you buy cheap stuff.
4- Cancel buying order after 1 hour (time can be customized, obviously).
5- Cancel selling order after 1 hour and readjust the price (same comment as above).
7- Two different selling methods. One works by scanning the inventory looking for the item name in the uptext. Note that all items with an "i" aren't read correctly (it results in a ".!" instead of i. The failsafe relies on name reading and never makes you sell the wrong item. The other method relies on inventory positioning. It's more prone to failure, but I'm slowly patching the problems related to it.
8- Filters the item to flip based on the value difference between the buying price and the selling price (can be customized).
9- Regularly searches and detects free slot and finished orders then deals with them accordingly.
10- Keeps you logged in (I might want to change that at some point).

To do:
- Customizable buy quantity and price difference for each slot (easily done by making a global variable).
- Customizable buy price for each slot. It currently works either as a static number or a number of clicks on +5%/-5%.
- Finish patching all the issues with the positioning method for selling.
- No idea how to tackle this job yet, but creating a database of the "real prices" of items being flipped so everyone using the script could have access to this information.
- Look into each of the 41 procedures and functions to see what I can improve and optimize.
- Fix the text reading to correctly read the "i".

So here I am looking for feedback on two different aspects of the script:

1) Should I release it to the public? I'm considering releasing a beta version working for only one slot, but it'd be easy for anyone with a minimum of knowledge to make it work for all others. I wouldn't mind releasing it to members, but, obviously, I'm not a member myself.

2) What else could/should I add to the script to make it even better?

weequ

2012-09-13 15:16:45

What about the 4 hour buying limit?

Austin

2012-09-13 15:19:00

1.) Didn't you already release it to public?

2.) Somehow make it able to read "I"s! ;)

mormonman

2012-09-13 15:22:28

Apply with the script. Then if you make it, you can release to members. You would have a yes from me, mostly because of your learning attitude.

Wardancer

2012-09-13 16:20:45

From: weequ
What about the 4 hour buying limit?


I didn't mention but there is already a failsafe regarding this. If you reach the end of your list of item for a slot, it checks if a time marked at the beginning went past 4 hours 30 minutes. If it didn't get past that time, it simply doesn't try to do anything with this slot (just exits the procedure). I need to think of another failsafe as this one brings more problems than it solve. Let's say you loop through 5 items for that slot and you completed items 2 and 5, it'll still wait until the time is over.

What I want to replace it to when I have time is simpler and more effective. I'll simply make it cancel the order and move on to the next item if it fails to purchase the item at the "maxprice" decided. This isn't a foolproof method and can trigger the 1 hour wait before cancelling a trade, but it's better than what I currently have. If someone has any suggestion on another way to tackle this issue, please do share as I'm still not satisfied with this failsafe. Optimum solution would be to completely remove from the array the item so it doesn't come up in the loop again, but I'm clueless about how to do that =).

From: Austin
1.) Didn't you already release it to public?

2.) Somehow make it able to read "I"s! ;)


1) No. I only released some GE functions and procedures. Nothing like the script I have. I was hoping for some feedback but no one in their right mind will read hundreds of line of codes just to tell me I wrote a useless begin and end at some place =p.

2) There are two ways to get this done, either by fixing the IsUpText to correctly read everything or fixing GetTextAtExWrap.

I tried to work around the issue that I have (IsUpText not working at all when you're in the GE selling menu since the uptext colour changes) by using isuptext plus item dragging while outside the GE selling menu and then simply picking the first item. It worked fine for about half of the items. If you withdraw a few items and look at them in your inventory, you'll notice that some have an uptext colour different from the others. That seems to be the root of the problem. Wizzup linked me to a page where it was explained how to fix the uptext but I forgot the link. I'd appreciate if someone can post it on this thread and I'll try to understand it.

As for GetTextAtExWrap, while looking around, I saw the function IsUpTextEx. Part of the code is "Text := Replace(Text, '?', '.');" which led me to wonder if there was a way to write a procedure to simply use GetTextAtExWrap and change what it reads as ".!" to "i". If it isn't obvious already, I have no idea if the "replace" is doing what I'm thinking or something completely different. Just led me to have this idea.

From: mormonman
Apply with the script. Then if you make it, you can release to members. You would have a yes from me, mostly because of your learning attitude.


Thank you for this, but I want to make sure to be accepted as a member because I have a flawless script and that I can contribute. I don't think it would be a worthwhile contribution to offer a half assed script that has to be babysit. I'll do my best to fix all the issues I'll notice over the next few days and then apply with it, but I want to ask you one thing. Please judge me based on the script and be very harsh. I won't take it personal if I get a no. I rather be told where I messed up than a pat on the head saying I'm a good boy =).

EDIT: Just found the replace function and I think it will be a solution to the ".!". I have an exam in 2 hours so I'll be editing the first post tomorrow to tell you if that worked.

Master BAW

2012-09-13 16:39:14

Is it still even possible to make some money with flipping items these days?
Because of that stupid 4hour limit?

Austin

2012-09-13 16:46:35

From: Master BAW
Is it still even possible to make some money with flipping items these days?
Because of that stupid 4hour limit?

It depends on the item/how fast it buys.

and if you're talking about all forms of flipping, you can make a hell of a lot of money flipping items over 100mil lol. Virtus I hear is a good flip atm because of the recent dramatic price change. Also a friend I had made about 20mil in 10mins flipping the new gwd armour/weps that came out a week or so ago lol. So yeah, it's definitely profitable if you have a big stash of cash.

Yakabu

2012-09-13 17:41:52

This could be used as a mass gold farming method. I'd keep it to yourself or SRL Member+ only if I were you. But it's obviously your decision what you do with it :)

xtrapsp

2012-09-14 05:25:46

If it's constructed well and in order then apply for SRL membership! :D

NKN

2012-09-14 06:40:19

Good luck on the script. :D
Maybe you should apply with it when it's finished?

Solar

2012-09-14 06:56:11

Good luck with the script.
Of course you shouldn't release this publicly, and I don't think you should even release a script that only uses one slot.

Did you have any previous knowledge of coding or scripting before you joined SRL?

Shatterhand

2012-09-14 07:01:22

You should apply with it, then release it to Members.
Btw you should use a log file so you can track the proggress easier and you could stop/continue the script at anytime. Good luck anyways!

Rezozo

2012-09-14 07:05:09

Just start a poll, depending on the amount who say free vs Members, do that.

Know that for it to be members, I think you have to be a SRL Member + first?

Austin

2012-09-14 07:07:15

Yeah, I agree with everyone else, it shouldn't be released to the public. Just pm me a version when you're done with it :D Jk Jk, it will just motivate me to become a member anyways lol

Wardancer

2012-09-14 11:46:55

From: Solar
Good luck with the script.
Of course you shouldn't release this publicly, and I don't think you should even release a script that only uses one slot.

Did you have any previous knowledge of coding or scripting before you joined SRL?


No, I had no knowledge of coding before joining SRL. Actually, there was only two weeks before the time I learned what a variable is and I released the first set of functions and procedures for GE publicly (http://villavu.com/forum/showthread.php?t=89709). I have to thank NKN for that as he tutored be about 3 hours which helped me greatly understand the basis of the pascal language. I should mention that I did this in two weeks while going to uni with 30 hours of class a week as well as working fulltime so I didn't spend that much time on scripting. All I can say is that it's a very helpful community. All you need to succeed is a bit of creativity and then people will be overjoyed to give you a hand to realize it.

From: Shatterhand
You should apply with it, then release it to Members.
Btw you should use a log file so you can track the proggress easier and you could stop/continue the script at anytime. Good luck anyways!


Can you develop on what you mean by a log file? Like a .txt file? Do you know an example of this used in a script or a tutorial about it?

Shatterhand

2012-09-14 11:56:09

From: Wardancer
Can you develop on what you mean by a log file? Like a .txt file? Do you know an example of this used in a script or a tutorial about it?

Well I have never seen a script using a log file. What I thought is:
- you make a list of items with amounts/buy prices/sell prices at start (using GUI or just typing)
- you store these in a txt file (one item - one line), you store the time of buying too (so stop it if wont buy in X hours)
- you delete lines which are completed
This way you set the script up once (using GUI or typing) then you can stop/continue at any times.
Its not that hard to do file reading/writing, there are some tuts for that.

litoris

2012-09-14 12:12:34

It's good for practice, but it isn't that useful because of the limit. The only good way to use this would be to have about 10 accounts with money on them and a list of items. It could start off by putting two items on each character and seeing whether their margin yields enough profit, and then merching the profitable items on all accounts. It would basically save the user from the trouble.

Wardancer

2012-09-14 12:42:00

From: Shatterhand
Well I have never seen a script using a log file. What I thought is:
- you make a list of items with amounts/buy prices/sell prices at start (using GUI or just typing)
- you store these in a txt file (one item - one line), you store the time of buying too (so stop it if wont buy in X hours)
- you delete lines which are completed
This way you set the script up once (using GUI or typing) then you can stop/continue at any times.
Its not that hard to do file reading/writing, there are some tuts for that.


I'll look into this idea later as that would imply an important rewriting of the script and I'm not sure how well this would cohabitate with some core functions. I still like the idea and will see how I can incorporate this in the script at a later time, for version 1.2 or 1.3.

Thank you very much for sharing this idea.

From: litoris
It's good for practice, but it isn't that useful because of the limit. The only good way to use this would be to have about 10 accounts with money on them and a list of items. It could start off by putting two items on each character and seeing whether their margin yields enough profit, and then merching the profitable items on all accounts. It would basically save the user from the trouble.


Let's say you pick 5 items to flip per slot, even if you're done with all of them within 2 hours (which is very unlikely), you still have millions of profit. Even if the script does nothing for 2 hours, the profit per hour is still astronomous. Let's go with a very conservative estimate of 1m profit per slot per 4 hours, we're still at over 1m gold per hour (1.25m). Of course, that implies knowing which items to flip though as you can waste hours with no gain otherwise.

VastlySuperior

2012-09-14 12:53:04

I don`t know why you should not want to release it to the public? Seeing as there is already scripts available in the public section which do just this. Yes it is outdated, but if you took a bit of time I`m sure you can edit the code to work once more.

In any case powerbot already have a flipping bot which works quite well. If damage was done it is already done.

But as mentioned above, flipping is only viable if you have a big cash stack of between 50mil and a 100mil, then it becomes profitable to flip with the 4 hours limit.

Wardancer

2012-09-14 15:35:21

I'm just writing this post to share the line of code that solved all the ".!" issue as that might be useful to other coders.

if (ExtractFromStr((replace((lowercase(GetTextAtExWrap(212, 68, 386, 89, 0, 10, 1, 39372, 50, UpCharsEx))), '.!', 'i')), Letters)) = (lowercase(ExtractFromStr(What, Letters)))

Now, that single line does quite a few things. I shall explain one at a time starting at the middle.

1- Get the text at the coordinates (GetTextAtExWrap(212, 68, 386, 89, 0, 10, 1, 39372, 50, UpCharsEx))).
2- Put it into lowercase (lowercase(text)).
3- Replace the ".!" with "i" (replace(text, '.!', 'i')).
4- Remove everything that isn't letters (useful for items with ( ) for example) (ExtractFromStr(text, Letters)).
5- Compare the result with the item you want to flip.

Let's take an item to make this easier to understand.

1- Royal torsion spring
2- royaltors.!onspr.!ng
3- royaltorsionspring
4- royaltorsionspring
5- True!