PDA

View Full Version : [Utility] 3Garrett3's Merchant Aid



3Garrett3
11-27-2014, 03:39 AM
3Garrett3's Merchant Aid
Current Version: July 2020
Last Update: July 8, 2020
Status: WORKING

Features

Recommends items which are good to invest in based on the Top 100 traded items.
Extremely customizable to suit investor risk appetite.
Expected profits are ~1-2% of invested cash per day (Ex. 1-2M per day on 100M investment)
Can manually blacklist items which are not worth trading. A suggested blacklist is included.
Filters members vs. non members items. Only recommends p2p items to members accounts.
Can be used to back check what profits you *could* have had over the last X days.
Saves all results in a .INI file


Script Setup

Download the script. Download SRL 6.9 from GitHub (ask on Discord if you need a link). SRL is used for array functions that are not Simba standard.
Go to this link (https://github.com/osrsbox/osrsbox-db/blob/master/data/items/ge-limits-ids.json) and save the file as ge_limits.json in your scripts folder (same folder as the script).
Change any settings in lines 10-27.
If desired, change the settings in lines 31-44.
Press start. Initial startup takes ~5 minutes because it has to grab prices for 100 items from the RS website.
The script will print out buy/sell recommendations for the day. If you set saveDebug to True at line 43 then it will save the recommendations in a file.


Settings Explanation

isMember: Are you a Runescape P2P Member? It will only recommend P2P purchases for P2P players.
BuyPercentage: How many percent of your money are you willing to spend on one item? A lower number will reduce your risk, but higher values *may* increase profit.
StartCash: How much money are you starting with? After running the first time, the script will keep track of how much money you have spent and will save it to the INI file for the next use.
Backcheck Settings: This feature allows you to test the script against historical data. It will tell you how much profit you would have made over the amount of days specified.
Blacklist Settings: This feature allows you to prevent recommendations for items which do not change price. The default setting is false, because this lowers the profit slightly. The default list contains items which are historically not very profitable.
Algorithm Settings: The algorithms are used to determine which items are good buys and which are good sells. Current settings are used for short term trading (on average sells an item within a week of buying it). You can increase the settings if you desire long term trading. I suggest backchecking all new settings before actually investing. Default settings are the highest profit achieved over 500,000 iterations.
Sorting Settings: These settings are used to refine the list of items which are recommended to be bought. They detect price volatility and historic "scores" to determine which items are likely to make the most profit. The default settings were found to yield the highest profit in 500,000 iterations.


Limitations

RS only provides data for 160 days. Therefore back checking can not be run with more than 160 days.
This script cannot see the future. Expect ~50-60% of the trades will make money, ~30% will break even, and ~10-20% will lose money.
RS limits requests for prices. Changing the script from backchecking to not backchecking will force it to re-grab prices. Do not continually change this setting or you may cap out on price requests.


Version History

Alpha - First Public Release
Alpha Fix 1 - RSWiki Changed how they displayed trade limits
July 2020 - Changed to OSRS Merchant Aid and updated to work with Simba 1.4



Credits!
This script would certainly not exist without the help and support of Incurable, who has put up with me for 2 months while making this.
HUGE thank you to slacky for his inspiration with SimbaExt, his functions for grabbing prices from RS, and putting up with my dumb questions for 2 months.


I am 90% sure that this explanation is not sufficient to explain stuff. So just ask questions on the confusing parts.

Incurable
11-27-2014, 04:17 AM
About time, congrats for finally releasing something! :D

serajin
11-27-2014, 05:16 AM
Very cool looking! I know what I'm looking into over the holiday weekend. =P

WhatEva
11-27-2014, 06:57 AM
=D thanks been looking ever where for an eoc merching script

Frement
11-27-2014, 07:59 AM
Did you just seriously ask if there is an interest for an automatic money making machine?

Clarity
11-27-2014, 09:02 AM
Excellent, unique release. Congratulations! Sorry I was so delayed with my contributions, I'll pump them out soon.

3Garrett3
11-27-2014, 03:42 PM
Did you just seriously ask if there is an interest for an automatic money making machine?

Well.. I suppose I did. There are technically many more ways of making money, but when I figure out the logic to make automation work I'll definitely see it through.


Excellent, unique release. Congratulations! Sorry I was so delayed with my contributions, I'll pump them out soon.

Thanks! Not having your code as a fall back forced me to learn even more about the functions I was looking for. Again, something I would never have thought about for regular RS scripts so it was extremely beneficial. I'll be looking through the SRL bankscreen and item detection logic for the GE stuff because the method I wrote up is not really up to par. If you were to release yours I would just have another resource to help learn faster!


Very cool looking! I know what I'm looking into over the holiday weekend. =P

Thanks! Let me know if it does anything wonky, it's relatively complex compared to what I normally write. I've been testing as I write but who knows! :p

Trollcrank
11-28-2014, 01:57 AM
I fear this script cuz I except some money bags to come through and set something like this up and make 100s of mils. Hopefully people will just ignore such an amazing script...Should be good for attracting new comers though :)

Ross
11-28-2014, 03:31 AM
Hell yeah man this is awesome! Congrats on the release! Been waiting on this.

getskilled
11-28-2014, 05:04 PM
Really do love this script. Only ran it a little bit but works like a charm. When i get a good bit of capital built up i'll be using this for sure.

3Garrett3
11-28-2014, 05:30 PM
I fear this script cuz I except some money bags to come through and set something like this up and make 100s of mils. Hopefully people will just ignore such an amazing script...Should be good for attracting new comers though :)

Keep in mind that this is not automated, it simply tells you if an item is a good buy or sell and lets you make the decision. I'm pretty confident that people will have to be determined to gold farm with this.


Hell yeah man this is awesome! Congrats on the release! Been waiting on this.


Really do love this script. Only ran it a little bit but works like a charm. When i get a good bit of capital built up i'll be using this for sure.

Thanks to both of you!

Obquility
11-29-2014, 08:22 AM
3Garret3, the script looks very complex, and I'm sure will be very helpful, Thanks. Unfortunately I'm aving a problem running this script at the moment, by putting is 25mil (25000000) into the starter money, I get this error:
Setting up INI file
Error: "25000000" is an invalid integer at line 1009
Execution failed.
I'm sorry if i sound demanding, annoying even, but I just can't get it to work- it looks great though!
Josh

bonsai
11-29-2014, 11:31 AM
3Garret3, the script looks very complex, and I'm sure will be very helpful, Thanks. Unfortunately I'm aving a problem running this script at the moment, by putting is 25mil (25000000000) into the starter money, I get this error:
Setting up INI file
Error: "25000000000" is an invalid integer at line 1009
Execution failed.
I'm sorry if i sound demanding, annoying even, but I just can't get it to work- it looks great though!
Josh

Um, that's 25 billion

Obquility
11-29-2014, 11:34 AM
Jeez, that's embarrassing
Thanks Bonsai:duh:
Edit: I was right :P Your quote is a bit different ;)

3Garrett3
11-29-2014, 06:41 PM
Jeez, that's embarrassing
Thanks Bonsai:duh:
Edit: I was right :P Your quote is a bit different ;)

Are you putting it in quotes?

The setup line should look like this:


startCash = 25000000; //In gp


That's all you need to change. I notice that the error is line 1009. That line is:


Self.Cash := strToInt(ReadINI('Portfolio', 'Cash', ScriptPath + GlobalSuffix));


Can you confirm that this line reads exactly that? It sounds like it's trying to take a string as an integer in the error. But the code clearly tells it to change from string to integer.

Confirm these two things for me and if they're both as I mentioned above we'll have to do some debugging. I can't manage to replicate the error.

Edit: If you haven't gotten the script to run at all, I suggest deleting the .INI file and when the script asks, click yes to "Is this your first time running the script" and it will re-create the INI file.

Obquility
11-29-2014, 07:42 PM
Are you putting it in quotes?

The setup line should look like this:


startCash = 25000000; //In gp


That's all you need to change. I notice that the error is line 1009. That line is:


Self.Cash := strToInt(ReadINI('Portfolio', 'Cash', ScriptPath + GlobalSuffix));


Can you confirm that this line reads exactly that? It sounds like it's trying to take a string as an integer in the error. But the code clearly tells it to change from string to integer.

Confirm these two things for me and if they're both as I mentioned above we'll have to do some debugging. I can't manage to replicate the error.

Edit: If you haven't gotten the script to run at all, I suggest deleting the .INI file and when the script asks, click yes to "Is this your first time running the script" and it will re-create the INI file.

Thanks for the help Garret, I'll try what you said as soon asI get home.
Thanks again for the help,
Josh

3Garrett3
12-01-2014, 05:42 PM
Thanks for the help Garret, I'll try what you said as soon asI get home.
Thanks again for the help,
Josh

So to confirm, did this work? I've been using it daily while attempting to figure out all of the data I need to save for automation and haven't run into any problems.

Obquility
12-01-2014, 07:34 PM
Yep it works great. Problem was I don't think the script can handle numbers like 25bil. But yes, its working fine.
Thanks Garret

3Garrett3
12-01-2014, 08:06 PM
Yep it works great. Problem was I don't think the script can handle numbers like 25bil. But yes, its working fine.
Thanks Garret

Good to hear! So this makes it that much harder to gold farm with the script. You can't be infinitely rich or Simba won't accept your inputs ;)

(In case anyone with 25B is reading, you stand to make approximately 250M ($100 USD) per day with this method assuming you trust the script with $10,000 worth of RSGP. That could be worth 78B after a year of investment (using weekly compound interest based on 115% anually), only $31,000 US worth of RSGP, based on about 30 minutes of investment per day. Assuming 2 years of constant investment, that would add up to 246B ($98,000 USD).)

*Disclaimer: I do not take responsibility for losing $10,000 USD worth of RSGP if the script does not perform as well in the future as it would have in the past! All values are theoretical and serve to illustrate the hilarious effect of compound interest.

Edit because of hilarious compound interest: The rate stated above would make you a millionaire assuming that RS existed for the next 10 years and RSGP is worth $0.40 USD when sold in such ridiculous bulk.

Edit again because some people are too literal: I do not suggest EVER buying (or risking) $10,000 worth of RSGP. Please do not do this.

Obquility
12-01-2014, 08:30 PM
Half the sites don't even buy gold for a good rate, with 100 gold farming bots they are good to go. I wish I was that rich though, I put 25bil instead of 2.5bil lol.

3Garrett3
12-01-2014, 08:37 PM
Half the sites don't even buy gold for a good rate, with 100 gold farming bots they are good to go. I wish I was that rich though, I put 25bil instead of 2.5bil lol.

I tested for 2 months with only 5M, so I have no idea how well this stuff scales up haha, I assume it gets pretty limited by the trade limit when you have that kind of money. I was gifted 20M to test once I released the script, and I'm not running into the trade limit for most items anyway. All back checking was done with 100M as the amount, just to see what happened and it seemed to work fine.

Obquility
12-01-2014, 08:45 PM
I tested for 2 months with only 5M, so I have no idea how well this stuff scales up haha, I assume it gets pretty limited by the trade limit when you have that kind of money. I was gifted 20M to test once I released the script, and I'm not running into the trade limit for most items anyway. All back checking was done with 100M as the amount, just to see what happened and it seemed to work fine.
Just a quick question, is there another script like this in the private section? You've got it labelled as merchant aid public- although not that I care cause its sexy enough as it is :)

3Garrett3
12-01-2014, 09:07 PM
Just a quick question, is there another script like this in the private section? You've got it labelled as merchant aid public- although not that I care cause its sexy enough as it is :)

It's public so that I remember to make any changes to the master copy, and don't accidentally edit the wrong file when I'm adding stuff. There is no other version of this released. If I ever to get automatic stuff working it would either be Jr or SRL Member though, because money printing machines shouldn't be public. Whenever that happens it will be mentioned in my signature though.

fastler
12-02-2014, 12:05 AM
Using 10m, almost randomly selecting which items to buy and which not, from one day to the next, I made about 500k, if I'm not mistaken. (Run-on sentence ftw)
I didn't buy and sell at market price though, I always pricechecked to get the best deal.

3Garrett3
12-04-2014, 12:26 AM
Using 10m, almost randomly selecting which items to buy and which not, from one day to the next, I made about 500k, if I'm not mistaken. (Run-on sentence ftw)
I didn't buy and sell at market price though, I always pricechecked to get the best deal.

I'm glad that it sounds like you're making good money from it.

Like I said, the benefit of having an *aid* rather than automatic is that it's uniquely tailored to each person's buying preferences. Some people (like you) prefer to do their research before buying and get the best price, some people (like me usually) just want to log in and make the offers and log out while they complete at market price. The benefit of using the top 100 traded items is that because of the huge volumes, you're pretty much guaranteed to make the buy/sell at market if you're willing to wait long enough (exceptions apply here obviously).

Tannex
12-29-2014, 06:25 PM
Hi, im getting an error and hoped you would take a look :)

Setting up INI file
Getting RS Prices, this may take a few minutes
Error: "" is an invalid integer at line 867
Execution failed.
The following bitmaps were not freed: [Minimap Mask]

the line of code:

Result.TradeLimit := StrtoInt(Between('data-limit="', '" style="display:none">', Page));

warlord94
12-31-2014, 02:44 AM
Hi, im getting an error and hoped you would take a look :)

Setting up INI file
Getting RS Prices, this may take a few minutes
Error: "" is an invalid integer at line 867
Execution failed.
The following bitmaps were not freed: [Minimap Mask]

the line of code:

Result.TradeLimit := StrtoInt(Between('data-limit="', '" style="display:none">', Page));

Same problem here, tried fiddling around to the best of my knowledge and I couldn't get it to work.

zeinir
01-01-2015, 06:59 AM
Setting up INI file
Error: Unable to create file "C:\Users\\Desktop\Games\simba\MerchantBackCheck" at line 921
Execution failed.
The following bitmaps were not freed: [Minimap Mask]
Get this error everytime I try to start it.

else WriteINI(Result[0][i], 'Member', (isMemberItem(Str, Result[0][i])), ScriptPath + GlobalSuffix)

3Garrett3
01-02-2015, 10:10 PM
The issues shown below have now been fixed and the script has been updated in the first post


Hi, im getting an error and hoped you would take a look :)

Setting up INI file
Getting RS Prices, this may take a few minutes
Error: "" is an invalid integer at line 867
Execution failed.
The following bitmaps were not freed: [Minimap Mask]

the line of code:

Result.TradeLimit := StrtoInt(Between('data-limit="', '" style="display:none">', Page));


Same problem here, tried fiddling around to the best of my knowledge and I couldn't get it to work.

Looks like RS is giving no prices. It's possible that they changed their limit on price grabs so now the script is running too many attempts and it's breaking the script. Looks like I'll need to find a work around sometime...



Setting up INI file
Error: Unable to create file "C:\Users\\Desktop\Games\simba\MerchantBackCheck" at line 921
Execution failed.
The following bitmaps were not freed: [Minimap Mask]
Get this error everytime I try to start it.

else WriteINI(Result[0][i], 'Member', (isMemberItem(Str, Result[0][i])), ScriptPath + GlobalSuffix)

That's because Simba can't create the file. You don't have simba installed to the default directory and that might be causing problems. The script however appears to be broken anyway.

Clarity
01-18-2015, 02:22 PM
GE Include now exists in SRL-6 thanks to The Mayor :)

niels00o
01-18-2015, 07:15 PM
Nice, gonna check it out

3Garrett3
01-19-2015, 03:08 PM
GE Include now exists in SRL-6 thanks to The Mayor :)

Wait, where? Actually just in SRL now? This could be big. I might have to get off my lazy ass and work on the automatic mercher at some point now.

KeepBotting
01-19-2015, 07:35 PM
Wait, where? Actually just in SRL now? This could be big. I might have to get off my lazy ass and work on the automatic mercher at some point now.

Yes (https://github.com/SRL/SRL-6/commit/29e389a48c4dc5377519dfdd3ab2e7eb9af41c5c)

Swatarianess
01-22-2015, 11:14 PM
Wait, where? Actually just in SRL now? This could be big. I might have to get off my lazy ass and work on the automatic mercher at some point now.

I implore you to do this, i've waited patiently for the time that you would rework it. :) PS. add some reflections to it because increase efficiency :)

KeepBotting
01-22-2015, 11:18 PM
I implore you to do this, i've waited patiently for the time that you would rework it. :) PS. add some reflections to it because increase efficiency :)

Reflection for RS3 isn't a thing, and hasn't been for a number of years.

Swatarianess
01-22-2015, 11:36 PM
I was mistaken, I saw a thread talking about reflection but only for OSRS. Nevertheless, Grandexchange should be coming to OSRS soon according to a poll?

3Garrett3
01-23-2015, 12:07 AM
I was mistaken, I saw a thread talking about reflection but only for OSRS. Nevertheless, Grandexchange should be coming to OSRS soon according to a poll?

I presume that the prices and interface will be different than the RS3 version. Depending on game mechanics it may be a simple port, but it will be hard to know until it happens.

nicky101
01-26-2015, 01:09 AM
testing it out as we speak, great scrip so far man. doing f2p merching.

Enigmatic
01-27-2015, 03:07 PM
Getting this error :/

24904

Any fix?

3Garrett3
01-27-2015, 03:22 PM
Getting this error :/

24904

Any fix?

It looks like RS Wiki has again changed how they load trade limits, I should be able to fix this tomorrow evening if nobody else volunteers to look through the page source and find the proper link again.

Enigmatic
01-28-2015, 08:34 AM
It looks like RS Wiki has again changed how they load trade limits, I should be able to fix this tomorrow evening if nobody else volunteers to look through the page source and find the proper link again.

I would have done it for you if I could script. :/ But sadly I can't, but looking forward to update!

-ENIGMA

3Garrett3
01-31-2015, 04:42 PM
I would have done it for you if I could script. :/ But sadly I can't, but looking forward to update!

-ENIGMA

I'm actually trying to figure out what the problem was here, I can't seem to duplicate it.

Try running it again, and if you can't get it to work you've got two options.

1) Go through the INI file (open with notepad) and check to see what item is missing a trade limit. Add the limit manually to match the format of the other items.
2) Delete the INI file (will delete all bought items from INI so I don't recommend if you're in the middle of merching stuff) and run the script again, saying "Yes" when it asks if this is the first time you're running the script.

savetehlemmings
01-31-2015, 10:41 PM
The problem is a script error on rswiki's exchange page for Araxyte arrow. I'll try to change it tomorrow, but no promises that I won't somehow fuck it up worse lol

--edit-- on second thought, sharper minds may have to take a look

3Garrett3
02-01-2015, 05:42 PM
The problem is a script error on rswiki's exchange page for Araxyte arrow. I'll try to change it tomorrow, but no promises that I won't somehow fuck it up worse lol

--edit-- on second thought, sharper minds may have to take a look

Is it just the Araxyte Arrow? I've never heard of it before, I'll take a look and see if it's different.

Edit:

I'm still getting the trade limit from it.. Can you confirm this is my script's problem or is it a problem caused by the RSWiki page?

savetehlemmings
02-01-2015, 06:04 PM
Is it just the Araxyte Arrow? I've never heard of it before, I'll take a look and see if it's different.

Edit:

I'm still getting the trade limit from it.. Can you confirm this is my script's problem or is it a problem caused by the RSWiki page?

.../wiki/Exchange:Araxyte_arrow

Yesterday it came up saying "Script error" with no information on the page. It was an RSWiki problem, not your script

3Garrett3
02-01-2015, 06:10 PM
.../wiki/Exchange:Araxyte_arrow

Yesterday it came up saying "Script error" with no information on the page. It was an RSWiki problem, not your script

Oh okay. It appears that today it works so it should be back in working order.

apple98
02-01-2015, 09:10 PM
mm useful

Battousai
02-14-2015, 05:08 AM
So uhm, I run the script, let it set everything up, Then it pops up asking if i wanna buy items or not, Then after going through all the pop ups, It just ends the script?

3Garrett3
02-15-2015, 05:15 PM
So uhm, I run the script, let it set everything up, Then it pops up asking if i wanna buy items or not, Then after going through all the pop ups, It just ends the script?

Yes. It is a merchanting *AID* currently. The long-winded OP describes how it helps you pick items to buy and sell. If you say "yes" it assumes you buy the amount it recommends at market price. Then it saves that information and when you run it the next day it sees if it's time to sell any of those items.

I never quite figured out the logic for some of the rare exceptions that happen during merching so I didn't get around to automating everything.

elaatl
02-20-2015, 07:52 AM
This looks awesome will try this out when i come home :)

sekirei
02-27-2015, 07:26 PM
I had to tweak the code a little to fit my needs, but so far after a day with 1b I managed to make 60m not bad for doing almost nothing :P

3Garrett3
02-27-2015, 07:57 PM
I had to tweak the code a little to fit my needs, but so far after a day with 1b I managed to make 60m not bad for doing almost nothing :P

One day, 60M, only 2.5M per hour. I guess if there's ever a way to farm with a script then someone will find it ;)

Just out of curiosity, what parts did you tweak? I'm always willing to learn more :)

o0Matthius0o
03-01-2015, 11:07 PM
What kind of merching is this script used for? Flipping the items it suggests instantly? Or doing short term merches where you hold on to the item for a day or 2. And how do we know at what point to sell? Just wondering. Im testing the script out now buying things randomly lol. Just want to make sure im not doing it wrong.

3Garrett3
03-01-2015, 11:17 PM
What kind of merching is this script used for? Flipping the items it suggests instantly? Or doing short term merches where you hold on to the item for a day or 2. And how do we know at what point to sell? Just wondering. Im testing the script out now buying things randomly lol. Just want to make sure im not doing it wrong.

It is for short-term merching. It will suggest what to buy, and if you say "yes" it will save that you bought it at X price. The next day (after GE update) it will run through all the things you've bought and see if they should be sold or not. It will ask if you want to sell them, and if you do then it will save that they're gone too. Everything is saved in a file so that you can open/close Simba at will. Just be mindful that when it says "is this your first time" at the start, it will re-write the file so don't do that or it won't know when to tell you to sell.

o0Matthius0o
03-01-2015, 11:26 PM
It is for short-term merching. It will suggest what to buy, and if you say "yes" it will save that you bought it at X price. The next day (after GE update) it will run through all the things you've bought and see if they should be sold or not. It will ask if you want to sell them, and if you do then it will save that they're gone too. Everything is saved in a file so that you can open/close Simba at will. Just be mindful that when it says "is this your first time" at the start, it will re-write the file so don't do that or it won't know when to tell you to sell.

damn, thats pretty awesome. Thanks for the quick response. I am looking into making an auto mercher myself. So if you need any help let me know. I mean, you know way more than me, but i could do some of the menial tasks and learn from you.

RayAldeza
03-13-2015, 01:56 AM
This scripts buys and sells on its own?

3Garrett3
03-13-2015, 01:46 PM
This scripts buys and sells on its own?

Nope, there's a plan in the future to make it do so, but I expect it will be released to SRL Members only.

Reveille
03-14-2015, 11:02 PM
If you keep making money, do you have to update the Cash amount in the script? Or does it keep account of your gains?

3Garrett3
03-15-2015, 04:29 AM
If you keep making money, do you have to update the Cash amount in the script? Or does it keep account of your gains?

As long as you don't delete the INI file, it will keep track of your Cash based on what you answer "yes" to. If you sell an item, it will add to your cash and if you buy an item it will subtract from your cash.

Antonio
03-16-2015, 11:15 PM
Wait never mind i've fixed it :) Will report back with any profits!

3Garrett3
03-16-2015, 11:20 PM
Hmmm am I being dumb or?

Whenever I run this script this happens

Setting up INI file
Getting RS Prices, this may take a few minutes
Your portfolio would be worth: 277263799gp (177.26% increase) if you had invested over the last 160 days.
Successfully executed.


However nothing has popped up during this time it just stops after getting RS prices?

Depends on what kind of dumb you're suggesting you might be ;).

It sounds like you have it in "Backcheck" mode, in which it will simulate the last X days (a setting you determine) and tell you how much money you would have earned if you made all the investing decisions as recommended by the script.

To have it make recommendations you should turn "Backcheck" to false and when it says "is this the first time running this script" you say "yes". It will then grab prices again and say "would you like to buy X?" and you can determine yes or no. To be extremely clear, since a few people have asked recently, this is not automatic so you have to do the actual buying and selling in the GE by yourself.

Antonio
03-16-2015, 11:21 PM
Depends on what kind of dumb you're suggesting you might be ;).

It sounds like you have it in "Backcheck" mode, in which it will simulate the last X days (a setting you determine) and tell you how much money you would have earned if you made all the investing decisions as recommended by the script.

To have it make recommendations you should turn "Backcheck" to false and when it says "is this the first time running this script" you say "yes". It will then grab prices again and say "would you like to buy X?" and you can determine yes or no. To be extremely clear, since a few people have asked recently, this is not automatic so you have to do the actual buying and selling in the GE by yourself.


Alright so I got it to run however I get this error now:


[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
Error: "" is an invalid integer at line 997
Execution failed.


Line 997 is this


Result[j] := StrToInt(tempPArr[j]);



Yeah I'm just running this to see how well it predicts the market :D

3Garrett3
03-16-2015, 11:23 PM
Alright so I got it to run however I get this error now:

[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
[Hint] NumSamples overflow: Could only gather -1 samples
Error: "" is an invalid integer at line 997
Execution failed.


Line 997 is this

Result[j] := StrToInt(tempPArr[j]);

In the OP:

"RS limits requests for prices. Changing the script from backchecking to not backchecking will force it to re-grab prices. Do not continually change this setting or you may cap out on price requests"

That's the error it gives when you've maxed out the server requests. Wait 10-15 minutes and it should work.

Antonio
03-16-2015, 11:24 PM
In the OP:

"RS limits requests for prices. Changing the script from backchecking to not backchecking will force it to re-grab prices. Do not continually change this setting or you may cap out on price requests"

That's the error it gives when you've maxed out the server requests. Wait 10-15 minutes and it should work.

Ahhh, perfect thanks bro :) I'll try it again tomorrow!

Chat
03-19-2015, 11:55 PM
Congrats on the first release!

P.S. This is a great looking script, might try some time. :)

knotted fear
03-24-2015, 10:59 PM
I'm gonna look into giving this a shot and see how things go, i'll report back to you once I do and let you know how it runs. Looking forward to making some money :p

Antonio
03-25-2015, 01:39 PM
I've used this on four items (I know not a great amount to test with) and all four items have continued to crash the day after I've bought into them. So at the moment I'm looking at around 300k loss which isn't a big deal but those four items I used were based on my own judgment and the scripts recommendation. I'm unsure how those items have crashed so hard though as they are pretty commonly traded items.

3Garrett3
03-25-2015, 02:16 PM
I've used this on four items (I know not a great amount to test with) and all four items have continued to crash the day after I've bought into them. So at the moment I'm looking at around 300k loss which isn't a big deal but those four items I used were based on my own judgment and the scripts recommendation. I'm unsure how those items have crashed so hard though as they are pretty commonly traded items.

Hmm, pretty small sample size so far, but keep in mind that by having 20 or so items you'll spread out the risk a lot more. I also suggest that this is short term investing, which means somewhere around the 5 day range. Hopefully they come up in the near future. It's extremely difficult to predict the future!

Antonio
03-25-2015, 08:37 PM
Hmm, pretty small sample size so far, but keep in mind that by having 20 or so items you'll spread out the risk a lot more. I also suggest that this is short term investing, which means somewhere around the 5 day range. Hopefully they come up in the near future. It's extremely difficult to predict the future!

Yeah i've had them for 2 days now so hopefully they rise within the next 3 was going to give it a week to see if the items are still going down or if they go back up so i'll report back in a few days!

killy1
04-13-2015, 05:49 AM
hey, i've just tried to set up the script for the first time and i got this error how would i go about fixing it?


Setting up INI file
Getting RS Prices, this may take a few minutes
[Hint] NumSamples overflow: Could only gather -1 samples
Error: "" is an invalid integer at line 997
Execution failed.
The following bitmaps were not freed: [Minimap Mask]

3Garrett3
04-13-2015, 02:14 PM
hey, i've just tried to set up the script for the first time and i got this error how would i go about fixing it?


Setting up INI file
Getting RS Prices, this may take a few minutes
[Hint] NumSamples overflow: Could only gather -1 samples
Error: "" is an invalid integer at line 997
Execution failed.
The following bitmaps were not freed: [Minimap Mask]

If this is the very first time you're running the script then it could be a little problem. That error means you've maxed out your RS price requests. If you actually ran the script once right before this, it would make sense. There is a warning in OP that tells you not to run the script over and over because RS has a limit of price grab requests. Try running the script again and see what happens.

rickhunley
05-19-2015, 09:57 AM
Quick question: Does the "first time using" terminology apply to each individual RS account you play with? i.e. Will it create a separate .ini file for each RS account you use with Simba? Bit of a noob here ha

3Garrett3
05-19-2015, 02:01 PM
Quick question: Does the "first time using" terminology apply to each individual RS account you play with? i.e. Will it create a separate .ini file for each RS account you use with Simba? Bit of a noob here ha

It will not create individual account .INI files, good question though. If you want to use two accounts I would suggest making separate folders, a copy of the script in each folder. It should save/load INI files from the folder the script is in, so they won't interfere with each other.

rickhunley
05-21-2015, 10:27 AM
It will not create individual account .INI files, good question though. If you want to use two accounts I would suggest making separate folders, a copy of the script in each folder. It should save/load INI files from the folder the script is in, so they won't interfere with each other.

Thanks for that. Is there a way to link our .ini to a stats website so we can compete against each other? Perhaps sometime in the future! Ha. I'm going to read through the script now. Does it take into account possible future variables such as double xp weekend etc? I'm interested in financial modelling. Incredible how the RS economy functions, 50K people online at any given time, all doing something...ha.

R3LAX
06-07-2015, 01:04 PM
Interesting script! Looking forward to testing it, provided it is still functional.

dodo
06-22-2015, 07:16 AM
Testing it now. Thanks for the Script!

MisterMason
06-30-2015, 09:58 PM
Not working for me, it says that it is getting rs prices on launch, then about 2 seconds after it says successfully executed. Then when i launch it (pressing no for first time) it only says successfully executed

3Garrett3
06-30-2015, 11:02 PM
Not working for me, it says that it is getting rs prices on launch, then about 2 seconds after it says successfully executed. Then when i launch it (pressing no for first time) it only says successfully executed

Is there anything else popping up at the bottom of the debug box right before it says Successfully Executed?

MisterMason
06-30-2015, 11:41 PM
Is there anything else popping up at the bottom of the debug box right before it says Successfully Executed?

Nope, nothing. Could it be that im launching the file straight out of the downloads folder or something of the sort?

3Garrett3
06-30-2015, 11:48 PM
Nope, nothing. Could it be that im launching the file straight out of the downloads folder or something of the sort?

It might, I would try putting everything in the proper folders (script in "Scripts" folder, simba in C drive). It should say SOMETHING. I've got about a million debugs in there so something should speak up haha.

MisterMason
07-01-2015, 01:02 AM
It might, I would try putting everything in the proper folders (script in "Scripts" folder, simba in C drive). It should say SOMETHING. I've got about a million debugs in there so something should speak up haha.

It's strange. I'm still getting no message at all.


Setting up INI file
Getting RS Prices, this may take a few minutes
Successfully executed.

3Garrett3
07-01-2015, 02:32 AM
It's strange. I'm still getting no message at all.

Hmm can you post your script settings at the top? Something weird is going on.

MisterMason
07-01-2015, 08:54 PM
Hmm can you post your script settings at the top? Something weird is going on.

Yep here you go.

isMember = True; //Are you an RS member
BuyPercentage = 20; //% of the day's starting cash per item it can spend - Also limited by trade limit
//This is experimentally determined to provide the best results while limiting risk

{Only Required for First-Time Run or backchecking}

startCash = 20000000; //In gp

{BackCheck Settings - Only required if testing algorithm settings}

backCheck = False;
simDays = 160; //How many days to simulate backchecking. No more than 160 days

{Blacklist Settings}

useBlacklist = False; //Do you want to blacklist the following items? Offers the ability to not trade some items. Can increase % of profitable trades, but will lower profits.
BlackList = ['Pure essence', 'Maple logs', 'Headless arrow', 'Vial', 'Arrow shaft', 'Broad arrowheads', 'Earth rune', 'Mind rune', 'Dragon bones', 'Fishing bait', 'Polypore spore', 'Mahogany plank', 'Body rune', 'Vial of water', 'Rune essence', 'Maple shieldbow (u)', 'Chaos rune', 'Pouch', 'Mithril arrow', 'Vibrant energy', 'Radiant energy', 'Lustrous energy', 'Adamantite ore', 'Ganodermic flake', 'Trading sticks', 'Rune arrow', 'Willow logs', 'Gold bar', 'Brilliant energy', 'Iron arrow', 'Adamant arrow', 'Mithril ore', 'Luminous energy', 'Broad-tipped bolts', 'Thread', 'Steel arrow', 'Blue dragon leather', 'Juju vial of water', 'Archery ticket', 'Bronze arrow', 'Eye of newt', 'Raw swordfish', 'Sparkling energy', 'Dark arrow', 'Unfinished broad bolts', 'Adamant bolts'];

{Algorithm Settings - Experimentally Determined - Changes allowed if desired}

MACDDays = 3; //In days
RSIDays = 3; //In days
StoKDays = 3; //In days
StoDDays = 4; //In days
AroonDays = 4; //In days
BollDays = 5; //In days

{Sorting Settings - Experimentally Determined - Changed allowed if desired}
PickDays = 15; //In days
PickPercent = 7;//In percent
ScoreRange = 3; //In days

//Currently there are no debugs to save so these do nothing
saveDebug = True; //Do you want to save all debugs into a .txt folder
fullDebug = False; //Have the whole debug written in the debug box?

bucko
08-05-2015, 08:47 AM
i can also agree, im using the default file and im getting exact same as Mister

Setting up INI file
Getting RS Prices, this may take a few minutes
Successfully executed.

enabled the debugs, still no additional info :S

3Garrett3
08-05-2015, 01:59 PM
i can also agree, im using the default file and im getting exact same as Mister

Setting up INI file
Getting RS Prices, this may take a few minutes
Successfully executed.

enabled the debugs, still no additional info :S

I'm fairly sure RS changed how their prices are stored. If I remember, I'll try to plug the fix into the script sometime next week.

bucko
08-12-2015, 03:03 AM
I'm fairly sure RS changed how their prices are stored. If I remember, I'll try to plug the fix into the script sometime next week.

How did you go?

3Garrett3
08-12-2015, 01:49 PM
How did you go?

Life has been getting in the way lately, I have written the fix but haven't been able to test it yet. I'll have time tomorrow after work to get on that and upload a new version. Thanks for the reminder!

BuffaloBill
08-12-2015, 09:19 PM
Life has been getting in the way lately, I have written the fix but haven't been able to test it yet. I'll have time tomorrow after work to get on that and upload a new version. Thanks for the reminder!

pshhh waht is this life you speak of! :P

bucko
08-13-2015, 10:20 AM
Life has been getting in the way lately, I have written the fix but haven't been able to test it yet. I'll have time tomorrow after work to get on that and upload a new version. Thanks for the reminder!

no worries, got a little over 1b, wanted to see how well this worked

3Garrett3
08-15-2015, 02:01 PM
no worries, got a little over 1b, wanted to see how well this worked

Full disclosure, I tried the fix that I thought would work and I still pulled no results. Back to the drawing board.

bucko
08-15-2015, 02:44 PM
Full disclosure, I tried the fix that I thought would work and I still pulled no results. Back to the drawing board.

:P

ill keep an eye on the thread then :P

Kratos
09-19-2015, 12:44 PM
Any updates on script status?

Kratos
09-23-2015, 01:38 PM
The problem seems to be around the TPortfolio.setup procedure.

3Garrett3
09-23-2015, 03:08 PM
The problem seems to be around the TPortfolio.setup procedure.

The problem lies in the data grabbing from RS and RSWikia, they've both changed their method of displaying information. It's a quick fix if you can follow the html code to find how they display data, but I haven't got a lot of time to be looking at it right now. I thought I'd fixed it before but it didn't end up working still. Try focusing on the parts that use "getPage" and you might be able to force it to work.

Kratos
09-23-2015, 03:19 PM
Thanks, ill take a look at it now but I cant promise anything as i'm not familiar with pascal yet (coming from python)

Kratos
09-23-2015, 04:49 PM
This is the new api format
{"daily":{"1427500800000":95612,"1427587200000":93288,"1427673600000":92157,"1427760000000":90548,"1427846400000":90873,"1427932800000":90873,"1428019200000":90242,"1428105600000":89253,"1428192000000":90403,"1428278400000":91126,"1428364800000":91955,"1428451200000":91843,"1428537600000":93472,"1428624000000":95958,"1428710400000":100347,"1428796800000":104028,"1428883200000":108611,"1428969600000":112268,"1429056000000":112566,"1429142400000":114246,"1429228800000":117057,"1429315200000":117604,"1429401600000":116435,"1429488000000":116922,"1429574400000":120968,"1429660800000":120152,"1429747200000":119715,"1429833600000":121123,"1429920000000":124372,"1430006400000":125877,"1430092800000":130283,"1430179200000":131951,"1430265600000":127673,"1430352000000":126016,"1430438400000":126016,"1430524800000":126701,"1430611200000":128945,"1430697600000":131139,"1430784000000":130325,"1430870400000":129528,"1430956800000":129528,"1431043200000":128121,"1431129600000":128209,"1431216000000":129137,"1431302400000":131375,"1431388800000":132652,"1431475200000":132054,"1431561600000":132054,"1431648000000":130189,"1431734400000":123679,"1431820800000":117921,"1431907200000":112772,"1431993600000":109001,"1432080000000":107576,"1432166400000":107041,"1432252800000":108085,"1432339200000":107635,"1432425600000":106203,"1432512000000":105767,"1432598400000":105689,"1432684800000":105733,"1432771200000":107461,"1432857600000":107461,"1432944000000":108004,"1433030400000":110517,"1433116800000":109954,"1433203200000":113470,"1433289600000":116940,"1433376000000":122458,"1433462400000":127052,"1433548800000":127334,"1433635200000":128280,"1433721600000":128204,"1433808000000":128356,"1433894400000":128356,"1433980800000":129001,"1434067200000":130790,"1434153600000":132202,"1434240000000":133286,"1434326400000":133512,"1434412800000":135672,"1434499200000":142042,"1434585600000":147888,"1434672000000":149745,"1434758400000":148222,"1434844800000":144348,"1434931200000":144348,"1435017600000":140750,"1435104000000":135850,"1435190400000":131569,"1435276800000":125670,"1435363200000":121694,"1435449600000":117640,"1435536000000":117637,"1435622400000":118393,"1435708800000":120809,"1435795200000":123511,"1435881600000":123511,"1435968000000":125227,"1436054400000":125133,"1436140800000":125759,"1436227200000":126429,"1436313600000":129943,"1436400000000":130636,"1436486400000":129875,"1436572800000":126408,"1436659200000":126251,"1436745600000":127784,"1436832000000":124425,"1436918400000":123693,"1437004800000":123579,"1437091200000":123213,"1437177600000":124714,"1437264000000":128760,"1437350400000":133482,"1437436800000":138138,"1437523200000":141651,"1437609600000":145896,"1437696000000":145806,"1437782400000":148715,"1437868800000":145645,"1437955200000":143665,"1438041600000":140539,"1438128000000":137931,"1438214400000":133694,"1438300800000":129262,"1438387200000":124065,"1438473600000":121754,"1438560000000":120252,"1438646400000":116585,"1438732800000":116585,"1438819200000":113684,"1438905600000":113853,"1438992000000":113635,"1439078400000":114435,"1439164800000":114616,"1439251200000":114509,"1439337600000":114567,"1439424000000":114049,"1439510400000":115617,"1439596800000":119171,"1439683200000":122952,"1439769600000":122621,"1439856000000":120257,"1439942400000":120127,"1440028800000":120069,"1440115200000":121600,"1440201600000":126056,"1440288000000":127983,"1440374400000":126202,"1440460800000":125651,"1440547200000":127352,"1440633600000":123305,"1440720000000":124359,"1440806400000":124359,"1440892800000":124422,"1440979200000":123553,"1441065600000":121741,"1441152000000":121741,"1441238400000":122866,"1441324800000":118604,"1441411200000":117735,"1441497600000":116773,"1441584000000":116773,"1441670400000":116228,"1441756800000":116183,"1441843200000":114771,"1441929600000":113870,"1442016000000":113870,"1442102400000":113921,"1442188800000":113946,"1442275200000":114424,"1442361600000":115795,"1442448000000":117254,"1442534400000":117254,"1442620800000":118186,"1442707200000":121281,"1442793600000":122543,"1442880000000":124867,"1442966400000":126172},"average":{"1427500800000":145750,"1427587200000":142700,"1427673600000":139530,"1427760000000":136307,"1427846400000":133140,"1427932800000":130082,"1428019200000":126885,"1428105600000":123696,"1428192000000":120614,"1428278400000":117713,"1428364800000":115018,"1428451200000":112502,"1428537600000":110224,"1428624000000":108178,"1428710400000":106436,"1428796800000":105000,"1428883200000":103920,"1428969600000":103121,"1429056000000":102452,"1429142400000":102002,"1429228800000":101766,"1429315200000":101702,"1429401600000":101622,"1429488000000":101605,"1429574400000":101813,"1429660800000":102135,"1429747200000":102549,"1429833600000":103067,"1429920000000":103767,"1430006400000":104663,"1430092800000":105818,"1430179200000":107107,"1430265600000":108291,"1430352000000":109473,"1430438400000":110645,"1430524800000":111839,"1430611200000":113129,"1430697600000":114525,"1430784000000":115856,"1430870400000":117136,"1430956800000":118388,"1431043200000":119598,"1431129600000":120756,"1431216000000":121862,"1431302400000":122896,"1431388800000":123850,"1431475200000":124631,"1431561600000":125291,"1431648000000":125878,"1431734400000":126193,"1431820800000":126222,"1431907200000":126061,"1431993600000":125813,"1432080000000":125501,"1432166400000":125037,"1432252800000":124635,"1432339200000":124232,"1432425600000":123735,"1432512000000":123115,"1432598400000":122442,"1432684800000":121623,"1432771200000":120807,"1432857600000":120133,"1432944000000":119533,"1433030400000":119016,"1433116800000":118458,"1433203200000":117942,"1433289600000":117469,"1433376000000":117207,"1433462400000":117124,"1433548800000":117051,"1433635200000":117056,"1433721600000":117056,"1433808000000":117030,"1433894400000":116929,"1433980800000":116808,"1434067200000":116766,"1434153600000":116771,"1434240000000":116874,"1434326400000":117202,"1434412800000":117793,"1434499200000":118769,"1434585600000":120065,"1434672000000":121471,"1434758400000":122843,"1434844800000":124052,"1434931200000":125276,"1435017600000":126428,"1435104000000":127430,"1435190400000":128293,"1435276800000":128958,"1435363200000":129432,"1435449600000":129771,"1435536000000":130092,"1435622400000":130355,"1435708800000":130717,"1435795200000":131051,"1435881600000":131271,"1435968000000":131363,"1436054400000":131299,"1436140800000":131246,"1436227200000":131185,"1436313600000":131243,"1436400000000":131319,"1436486400000":131369,"1436572800000":131283,"1436659200000":131132,"1436745600000":130984,"1436832000000":130689,"1436918400000":130362,"1437004800000":129958,"1437091200000":129331,"1437177600000":128558,"1437264000000":127859,"1437350400000":127368,"1437436800000":127161,"1437523200000":127071,"1437609600000":127242,"1437696000000":127574,"1437782400000":128146,"1437868800000":128811,"1437955200000":129544,"1438041600000":130307,"1438128000000":130984,"1438214400000":131494,"1438300800000":131775,"1438387200000":131794,"1438473600000":131735,"1438560000000":131569,"1438646400000":131284,"1438732800000":130979,"1438819200000":130554,"1438905600000":130018,"1438992000000":129451,"1439078400000":128936,"1439164800000":128543,"1439251200000":128152,"1439337600000":127711,"1439424000000":127365,"1439510400000":127096,"1439596800000":126949,"1439683200000":126940,"1439769600000":126871,"1439856000000":126587,"1439942400000":126142,"1440028800000":125540,"1440115200000":124871,"1440201600000":124210,"1440288000000":123616,"1440374400000":122866,"1440460800000":122199,"1440547200000":121655,"1440633600000":121081,"1440720000000":120628,"1440806400000":120317,"1440892800000":120156,"1440979200000":120139,"1441065600000":120138,"1441152000000":120188,"1441238400000":120397,"1441324800000":120465,"1441411200000":120600,"1441497600000":120697,"1441584000000":120802,"1441670400000":120861,"1441756800000":120914,"1441843200000":120922,"1441929600000":120899,"1442016000000":120893,"1442102400000":120837,"1442188800000":120663,"1442275200000":120378,"1442361600000":120151,"1442448000000":120051,"1442534400000":119955,"1442620800000":119892,"1442707200000":119881,"1442793600000":119764,"1442880000000":119660,"1442966400000":119659}} As you can see, the values for the 180-day average come after "average". i have tried using "Items := MultiBetween(RSPage, '"average":{"');" but am getting "Error: No default value for parameter 3 found at line 873". Any suggestions?

3Garrett3
09-23-2015, 06:21 PM
This is the new api format
{"daily":{"1427500800000":95612,"1427587200000":93288,"1427673600000":92157,"1427760000000":90548,"1427846400000":90873,"1427932800000":90873,"1428019200000":90242,"1428105600000":89253,"1428192000000":90403,"1428278400000":91126,"1428364800000":91955,"1428451200000":91843,"1428537600000":93472,"1428624000000":95958,"1428710400000":100347,"1428796800000":104028,"1428883200000":108611,"1428969600000":112268,"1429056000000":112566,"1429142400000":114246,"1429228800000":117057,"1429315200000":117604,"1429401600000":116435,"1429488000000":116922,"1429574400000":120968,"1429660800000":120152,"1429747200000":119715,"1429833600000":121123,"1429920000000":124372,"1430006400000":125877,"1430092800000":130283,"1430179200000":131951,"1430265600000":127673,"1430352000000":126016,"1430438400000":126016,"1430524800000":126701,"1430611200000":128945,"1430697600000":131139,"1430784000000":130325,"1430870400000":129528,"1430956800000":129528,"1431043200000":128121,"1431129600000":128209,"1431216000000":129137,"1431302400000":131375,"1431388800000":132652,"1431475200000":132054,"1431561600000":132054,"1431648000000":130189,"1431734400000":123679,"1431820800000":117921,"1431907200000":112772,"1431993600000":109001,"1432080000000":107576,"1432166400000":107041,"1432252800000":108085,"1432339200000":107635,"1432425600000":106203,"1432512000000":105767,"1432598400000":105689,"1432684800000":105733,"1432771200000":107461,"1432857600000":107461,"1432944000000":108004,"1433030400000":110517,"1433116800000":109954,"1433203200000":113470,"1433289600000":116940,"1433376000000":122458,"1433462400000":127052,"1433548800000":127334,"1433635200000":128280,"1433721600000":128204,"1433808000000":128356,"1433894400000":128356,"1433980800000":129001,"1434067200000":130790,"1434153600000":132202,"1434240000000":133286,"1434326400000":133512,"1434412800000":135672,"1434499200000":142042,"1434585600000":147888,"1434672000000":149745,"1434758400000":148222,"1434844800000":144348,"1434931200000":144348,"1435017600000":140750,"1435104000000":135850,"1435190400000":131569,"1435276800000":125670,"1435363200000":121694,"1435449600000":117640,"1435536000000":117637,"1435622400000":118393,"1435708800000":120809,"1435795200000":123511,"1435881600000":123511,"1435968000000":125227,"1436054400000":125133,"1436140800000":125759,"1436227200000":126429,"1436313600000":129943,"1436400000000":130636,"1436486400000":129875,"1436572800000":126408,"1436659200000":126251,"1436745600000":127784,"1436832000000":124425,"1436918400000":123693,"1437004800000":123579,"1437091200000":123213,"1437177600000":124714,"1437264000000":128760,"1437350400000":133482,"1437436800000":138138,"1437523200000":141651,"1437609600000":145896,"1437696000000":145806,"1437782400000":148715,"1437868800000":145645,"1437955200000":143665,"1438041600000":140539,"1438128000000":137931,"1438214400000":133694,"1438300800000":129262,"1438387200000":124065,"1438473600000":121754,"1438560000000":120252,"1438646400000":116585,"1438732800000":116585,"1438819200000":113684,"1438905600000":113853,"1438992000000":113635,"1439078400000":114435,"1439164800000":114616,"1439251200000":114509,"1439337600000":114567,"1439424000000":114049,"1439510400000":115617,"1439596800000":119171,"1439683200000":122952,"1439769600000":122621,"1439856000000":120257,"1439942400000":120127,"1440028800000":120069,"1440115200000":121600,"1440201600000":126056,"1440288000000":127983,"1440374400000":126202,"1440460800000":125651,"1440547200000":127352,"1440633600000":123305,"1440720000000":124359,"1440806400000":124359,"1440892800000":124422,"1440979200000":123553,"1441065600000":121741,"1441152000000":121741,"1441238400000":122866,"1441324800000":118604,"1441411200000":117735,"1441497600000":116773,"1441584000000":116773,"1441670400000":116228,"1441756800000":116183,"1441843200000":114771,"1441929600000":113870,"1442016000000":113870,"1442102400000":113921,"1442188800000":113946,"1442275200000":114424,"1442361600000":115795,"1442448000000":117254,"1442534400000":117254,"1442620800000":118186,"1442707200000":121281,"1442793600000":122543,"1442880000000":124867,"1442966400000":126172},"average":{"1427500800000":145750,"1427587200000":142700,"1427673600000":139530,"1427760000000":136307,"1427846400000":133140,"1427932800000":130082,"1428019200000":126885,"1428105600000":123696,"1428192000000":120614,"1428278400000":117713,"1428364800000":115018,"1428451200000":112502,"1428537600000":110224,"1428624000000":108178,"1428710400000":106436,"1428796800000":105000,"1428883200000":103920,"1428969600000":103121,"1429056000000":102452,"1429142400000":102002,"1429228800000":101766,"1429315200000":101702,"1429401600000":101622,"1429488000000":101605,"1429574400000":101813,"1429660800000":102135,"1429747200000":102549,"1429833600000":103067,"1429920000000":103767,"1430006400000":104663,"1430092800000":105818,"1430179200000":107107,"1430265600000":108291,"1430352000000":109473,"1430438400000":110645,"1430524800000":111839,"1430611200000":113129,"1430697600000":114525,"1430784000000":115856,"1430870400000":117136,"1430956800000":118388,"1431043200000":119598,"1431129600000":120756,"1431216000000":121862,"1431302400000":122896,"1431388800000":123850,"1431475200000":124631,"1431561600000":125291,"1431648000000":125878,"1431734400000":126193,"1431820800000":126222,"1431907200000":126061,"1431993600000":125813,"1432080000000":125501,"1432166400000":125037,"1432252800000":124635,"1432339200000":124232,"1432425600000":123735,"1432512000000":123115,"1432598400000":122442,"1432684800000":121623,"1432771200000":120807,"1432857600000":120133,"1432944000000":119533,"1433030400000":119016,"1433116800000":118458,"1433203200000":117942,"1433289600000":117469,"1433376000000":117207,"1433462400000":117124,"1433548800000":117051,"1433635200000":117056,"1433721600000":117056,"1433808000000":117030,"1433894400000":116929,"1433980800000":116808,"1434067200000":116766,"1434153600000":116771,"1434240000000":116874,"1434326400000":117202,"1434412800000":117793,"1434499200000":118769,"1434585600000":120065,"1434672000000":121471,"1434758400000":122843,"1434844800000":124052,"1434931200000":125276,"1435017600000":126428,"1435104000000":127430,"1435190400000":128293,"1435276800000":128958,"1435363200000":129432,"1435449600000":129771,"1435536000000":130092,"1435622400000":130355,"1435708800000":130717,"1435795200000":131051,"1435881600000":131271,"1435968000000":131363,"1436054400000":131299,"1436140800000":131246,"1436227200000":131185,"1436313600000":131243,"1436400000000":131319,"1436486400000":131369,"1436572800000":131283,"1436659200000":131132,"1436745600000":130984,"1436832000000":130689,"1436918400000":130362,"1437004800000":129958,"1437091200000":129331,"1437177600000":128558,"1437264000000":127859,"1437350400000":127368,"1437436800000":127161,"1437523200000":127071,"1437609600000":127242,"1437696000000":127574,"1437782400000":128146,"1437868800000":128811,"1437955200000":129544,"1438041600000":130307,"1438128000000":130984,"1438214400000":131494,"1438300800000":131775,"1438387200000":131794,"1438473600000":131735,"1438560000000":131569,"1438646400000":131284,"1438732800000":130979,"1438819200000":130554,"1438905600000":130018,"1438992000000":129451,"1439078400000":128936,"1439164800000":128543,"1439251200000":128152,"1439337600000":127711,"1439424000000":127365,"1439510400000":127096,"1439596800000":126949,"1439683200000":126940,"1439769600000":126871,"1439856000000":126587,"1439942400000":126142,"1440028800000":125540,"1440115200000":124871,"1440201600000":124210,"1440288000000":123616,"1440374400000":122866,"1440460800000":122199,"1440547200000":121655,"1440633600000":121081,"1440720000000":120628,"1440806400000":120317,"1440892800000":120156,"1440979200000":120139,"1441065600000":120138,"1441152000000":120188,"1441238400000":120397,"1441324800000":120465,"1441411200000":120600,"1441497600000":120697,"1441584000000":120802,"1441670400000":120861,"1441756800000":120914,"1441843200000":120922,"1441929600000":120899,"1442016000000":120893,"1442102400000":120837,"1442188800000":120663,"1442275200000":120378,"1442361600000":120151,"1442448000000":120051,"1442534400000":119955,"1442620800000":119892,"1442707200000":119881,"1442793600000":119764,"1442880000000":119660,"1442966400000":119659}} As you can see, the values for the 180-day average come after "average". i have tried using "Items := MultiBetween(RSPage, '"average":{"');" but am getting "Error: No default value for parameter 3 found at line 873". Any suggestions?

I *think* you want to be using the daily values, not the average ones. If you're not modifying my math, you want the daily ones. Here is what you need to do to go about the changes:

1) Find the part where it says "rsPage := getPage(X);" and change the link to use the API. I was using regular GE pages, not the API so it will have a different link. Make sure you insert the ID in the right location in the link.
2) From the above data, do something like rsPage := between(rsPage, '"daily":{', '},");
This will remove the average prices and make the string consistently "Time":"Price","Time":"Price" ...
3) To get the prices from this do priceArray := multiBetween(rsPage, '":"', '","Time');
This should create an array of strings which contain only the price. Instead of "priceArray" use whatever variable is found in the script (don't have simba access right now).
4) Convert the strings to integers and assign them to the proper TIntegerArray.

The reason your code threw an error above was you used multiBetween but you need 3 parameters: source string, left bound, right bound. Other than that you're on the right path.

Then you'll need to grab trade limits from the RSWikia page, which involves searching through the page source for "GE Limit" if my memory serves me right.

Good luck, keep posting code snippets as you move forward with it :)

Kratos
09-23-2015, 07:09 PM
26728 Right, I think I have gotten the pricegrab part down (huge thanks to you) but there seems to be an issue elsewhere in the code before that segment even runs, as when I put in debugging statements they didn't print out, and the only other instance of "GetPage" is still using an up-to-date link. Any ideas as to what might causing the program to stop?

Kratos
09-23-2015, 08:15 PM
Script stops somewhere here ...
for i := 0 to (h-1) do
begin
with TempItem do
begin
Name := ReadINI('Portfolio', toStr(i), ScriptPath + GlobalSuffix);
ID := ReadINI(Name, 'ID', ScriptPath + GlobalSuffix);

Prices := getPrices(Name);
TradeLimit := strToInt(ReadINI(Name, 'Trade Limit', ScriptPath + Globalsuffix));

AmountOwned := strToInt(ReadINI(Name, 'Amount', ScriptPath + GlobalSuffix));
Bought := strToInt(ReadINI(Name, 'Bought', ScriptPath + GlobalSuffix));
Members := strToBool(ReadINI(Name, 'Member', ScriptPath + GlobalSuffix))
end;

3Garrett3
09-23-2015, 09:52 PM
Script stops somewhere here ...
for i := 0 to (h-1) do
begin
with TempItem do
begin
Name := ReadINI('Portfolio', toStr(i), ScriptPath + GlobalSuffix);
ID := ReadINI(Name, 'ID', ScriptPath + GlobalSuffix);

Prices := getPrices(Name);
TradeLimit := strToInt(ReadINI(Name, 'Trade Limit', ScriptPath + Globalsuffix));

AmountOwned := strToInt(ReadINI(Name, 'Amount', ScriptPath + GlobalSuffix));
Bought := strToInt(ReadINI(Name, 'Bought', ScriptPath + GlobalSuffix));
Members := strToBool(ReadINI(Name, 'Member', ScriptPath + GlobalSuffix))
end;

It shouldn't be using the readINI code unless you say "NO" to "Is this your first time running?". If you've had problems getting everything set up (which we have) please delete the INI file and start the script, saying "YES" the next time. Other than that:

1) Find the file in your Scripts location with no file extension (this is the INI file). Open it with notepad and see if you have a bunch of items with their prices listed. If yes, then the script is breaking somewhere else. If no, then the problem is still in grabbing the items.

2) If there are no items listed in the INI file, try looking through the following function:


function RS_GetTopItems100(): Array of TStringArray;
var
i: Int32;
Str: string;
Strings : TStringArray;

function ForwardStrTo(const text, tag: string; After: Boolean = False): string;
var
p: Integer;
begin
p := pos(tag, text);
if After then
Result := copy(text, p + length(tag), length(text) - p - length(tag) + 1)
else
Result := copy(text, p, length(text) - p);
end;

begin
setLength(Result, 2);
Str := GetPage('http://services.runescape.com/m=itemdb_rs/top100?list=0&scale=2');
Str := Between('<th colspan="4">Trade Count</th>', '</tbody>', Str);
Str := ForwardStrTo(Str, '<tbody>');
Strings := MultiBetween(str, '<img src="http://services.runescape.com/', '">');
for i := 0 to High(Strings) do
begin
Result[0].Append(ForwardStrTo(Strings[i], 'alt="', True));
Result[1].Append(between('id=', '" alt', ForwardStrTo(Strings[i], 'id=')));
if not BackCheck then WriteINI(Result[0][i], 'Member', (isMemberItem(Str, Result[0][i])), ScriptPath + GlobalSuffix)
else WriteINI(Result[0][i], 'Member', (isMemberItem(Str, Result[0][i])), ScriptPath + GlobalSuffix)
end;
end;


I would *guess* that this isn't generating a proper item list. Try throwing some debugs in there after the text manipulation. I'd guess that the page loads differently and it isn't parsing item names out properly anymore.

3) If you have a bunch of item names but no price or trade limit information in the INI, I'd suggest rechecking the appropriate grab. Let me know if you need a hand with this.

Hopefully something there helps, I grabbed the code and reviewed in notepad but I can't really do a whole lot else right now.

kiwikiwi
09-23-2015, 10:30 PM
Just wondering if expected profit has increased from 1 - 2%?

3Garrett3
09-23-2015, 10:48 PM
Just wondering if expected profit has increased from 1 - 2%?

Has the market increased in volatility? I wouldn't expect a lot more than 2% without having a lot more risk. If you're more into high profits you should take up flipping, merching is only really better once you have more than a couple hundred million (rs3) because good flippable items start to run out at that price range.

That said, I haven't run this script in many months. If mohsen gets the script working (looks like he's on the right track) we can run the backchecker again and see if anything has changed over the last 6 months compared to previously.

Kratos
09-24-2015, 03:52 AM
Jackpot! The data wasn't being parsed correctly, nothing was in the .ini file (apart from player info, starting cash etc...) so I updated the parsing statement and now it's actually throwing an error
Error: "" is an invalid integer at line 867
Execution failed.
But itemdata has been written to the ini file, so i think this may just be an issue with formatting of the rswiki page, ill look into fixing it and keep you updated.

kiwikiwi
09-24-2015, 04:38 AM
Has the market increased in volatility? I wouldn't expect a lot more than 2% without having a lot more risk. If you're more into high profits you should take up flipping, merching is only really better once you have more than a couple hundred million (rs3) because good flippable items start to run out at that price range.

That said, I haven't run this script in many months. If mohsen gets the script working (looks like he's on the right track) we can run the backchecker again and see if anything has changed over the last 6 months compared to previously.

Not sure mate, but thanks for the overview. Something to think about. Wonder if there's a way to make profit within the fractions of volatility in big items etc.

3Garrett3
09-24-2015, 01:40 PM
Jackpot! The data wasn't being parsed correctly, nothing was in the .ini file (apart from player info, starting cash etc...) so I updated the parsing statement and now it's actually throwing an error
Error: "" is an invalid integer at line 867
Execution failed.
But itemdata has been written to the ini file, so i think this may just be an issue with formatting of the rswiki page, ill look into fixing it and keep you updated.

The error is related to receiving a blank string and attempting to turn it into an integer. Whatever is on line 867 is returning "" instead of the expected "X" where X is an int. Again, I don't have access to Simba so I'm not sure what 867 is, but you should look at the string parsing in that area to make sure it's all good.

If you're sure that it's right, you can do a debug (pardon the pseudocode):


writeln('Doing item: ' + item.Name);
getInfoForItem();

// Inside info grabbing (near line 867)

writeln('Text found is: ' + theString);
//failsafe below this
if theString = '' then theString := '0'; // The script wouldn't work because a value of 0 will make everything wonky, but it won't crash and you can find out what item (and what property) it fails on
integer := intToStr(theString); //Something of this sort is probably what is crashing line 867.


Basically you want a debug that says:

"Feather"
"Text: 10000"
"Boots"
"Text: "

and then you go into the RSWiki page for "Boots" and find out that the GE Limit isn't posted, or check the GE API and find out that it limits your page views and you're locked out of the system (therefore can't grab prices for all the items without adding some wait times in there).

Keep it up!

E:


Not sure mate, but thanks for the overview. Something to think about. Wonder if there's a way to make profit within the fractions of volatility in big items etc.

*Typically* the items you look for to merchant are high volume items. You want something that changes price on the GE every day. I recently made a script that produces a list of all items in RS that have changed value every day for the last 30 days and are worth >2M and <150M (arbitrary cut-off). There were still ~150 items to look through. I bet if you made a similar list for >200M you'd find there are many less items but still a good chunk of them that change prices frequently enough. Changing prices wildly (volatility) means more risk but more potential reward.

Kratos
09-24-2015, 01:57 PM
This is as far as i have gotten. the problem is at the strtoint statement at line 870 returning 0 every time, if someone could take a look and maybe find something im just not seeing.26729

3Garrett3
09-24-2015, 02:50 PM
This is as far as i have gotten. the problem is at the strtoint statement at line 870 returning 0 every time, if someone could take a look and maybe find something im just not seeing.26729

I'd guess that the problem is the line:


rplc := ExtractFromStr(Between('Exchange limit</a>:</b> ', '</li><li><b><a href="/wiki/GED#Categories" ', Page),0);


I can't access the RSWikia pagesource right now but I'd be willing to bet that you're missing something in the parse. I find the most sure-fire way to get this right is to add writeln(X) after each step. So in this case work backwards one step. Writeln what the final parsed text is. Then writeln what the step before that is. Try it without the "ExtractFromStr" because I'm not even sure if that's required (it might be to get rid of commas, not sure). Just rplc := between(X, Y, page);

Then try fiddling with X/Y until it grabs the right values.

Kratos
09-24-2015, 02:55 PM
Yes, I use it to get rid of commas, as otherwise the result would be 10,000 instead of 10000, which just throws an error at the strtoint part. The parse is working fine, as at first that was what i suspected too, but i checked and it gets the correct value. You sound like you are working from a phone, what happened to your PC?

3Garrett3
09-24-2015, 03:44 PM
Yes, I use it to get rid of commas, as otherwise the result would be 10,000 instead of 10000, which just throws an error at the strtoint part. The parse is working fine, as at first that was what i suspected too, but i checked and it gets the correct value. You sound like you are working from a phone, what happened to your PC?

I'm a little confused. You said it's returning 0 when you do strToInt(rplc); but you said rplc is the correct number every time? That's... extremely weird. I can't think of any reason that it would happen that way so can you explain what exactly is going wrong again?

I'm not on mobile, but I'm on a wireless network that blocks everything, so I can post here but I can't access anything useful to you.

Kratos
09-24-2015, 04:25 PM
Yeah, I'm confused too. It's exactly as you've just described it. Writeln('rplc'); writes the correct value of 10000 for spirit shards, but strtoint(rplc) gives an error mesage saying that "" is an invalid integer (It doesn't get past the first item as execution fails).

KeepBotting
09-24-2015, 04:27 PM
Yeah, I'm confused too. It's exactly as you've just described it. Writeln('rplc'); writes the correct value of 10000 for spirit shards, but strtoint(rplc) gives an error mesage saying that "" is an invalid integer (It doesn't get past the first item as execution fails).

strToIntDef(rplc, 0);

?

Kratos
09-24-2015, 04:32 PM
Trying it now keepbotting.

Kratos
09-24-2015, 04:35 PM
strToIntDef(rplc, 0);

?

HOLY SHIT IT WORKED!!! Thanks man.

Now it just keeps printing "[Hint] NumSamples overflow: Could only gather -1 samples" four times per item...

KeepBotting
09-24-2015, 04:37 PM
HOLY SHIT IT WORKED!!! Thanks man.

Now it just keeps printing "[Hint] NumSamples overflow: Could only gather -1 samples" four times per item...

Well that routine will simply return 0 instead of throwing errors if you pass it an unacceptable string.

It's just a fix for the error, I'm not sure how it will affect the rest of the script.

Kratos
09-24-2015, 04:41 PM
But for some reason it returns the correct values. Anyway, back to updating api parsing it is. Thanks so much for your help.

3Garrett3
09-24-2015, 05:19 PM
Now it just keeps printing "[Hint] NumSamples overflow: Could only gather -1 samples" four times per item...

This is what I talked about earlier, it is grabbing no items from the API page. RS has a pretty strict limit for how many times you can access their pages in rapid succession. You should add waiting between items. Even a few seconds might be enough - it will significantly increase the time that it takes to gather all prices though so be extra patient.

kiwikiwi
09-24-2015, 06:27 PM
The error is related to receiving a blank string and attempting to turn it into an integer. Whatever is on line 867 is returning "" instead of the expected "X" where X is an int. Again, I don't have access to Simba so I'm not sure what 867 is, but you should look at the string parsing in that area to make sure it's all good.

If you're sure that it's right, you can do a debug (pardon the pseudocode):


writeln('Doing item: ' + item.Name);
getInfoForItem();

// Inside info grabbing (near line 867)

writeln('Text found is: ' + theString);
//failsafe below this
if theString = '' then theString := '0'; // The script wouldn't work because a value of 0 will make everything wonky, but it won't crash and you can find out what item (and what property) it fails on
integer := intToStr(theString); //Something of this sort is probably what is crashing line 867.


Basically you want a debug that says:

"Feather"
"Text: 10000"
"Boots"
"Text: "

and then you go into the RSWiki page for "Boots" and find out that the GE Limit isn't posted, or check the GE API and find out that it limits your page views and you're locked out of the system (therefore can't grab prices for all the items without adding some wait times in there).

Keep it up!

E:



*Typically* the items you look for to merchant are high volume items. You want something that changes price on the GE every day. I recently made a script that produces a list of all items in RS that have changed value every day for the last 30 days and are worth >2M and <150M (arbitrary cut-off). There were still ~150 items to look through. I bet if you made a similar list for >200M you'd find there are many less items but still a good chunk of them that change prices frequently enough. Changing prices wildly (volatility) means more risk but more potential reward.

Mmmm. I'll go away and think about it. Thanksf

bucko
10-12-2015, 04:47 AM
But for some reason it returns the correct values. Anyway, back to updating api parsing it is. Thanks so much for your help.

So do you have a working version of this again? If so :p pls share haha

Kratos
10-12-2015, 01:13 PM
Nope. Gave up when school started again. :(

Saint//+
12-30-2015, 09:57 AM
Trying to figure this out, seems like its working. but .ini file is empty

Script starts.

Asks me if its my first time running script,
says getting prices,
then says successfully executed.

am i doing something wrong?

Spangly
03-07-2017, 05:54 AM
Can't get it to work, is the latest version ok?

Incurable
03-07-2017, 12:48 PM
Can't get it to work, is the latest version ok?

Read the thread.

Spangly
03-07-2017, 03:58 PM
Read the thread.

I have read all the thread, it says working on the main post but people report it's not working, so?

Incurable
03-09-2017, 02:02 AM
I have read all the thread, it says working on the main post but people report it's not working, so?

The last post was in December 2015 and the first post was last edited by 3Garrett3; in March that year. I would say that the script is outdated and that Garrett hasn't had the time/motivation to update it. It's always a good idea to check thread dates, especially last edited dates.