I made one of these with reflection....
Is this function also able to calculate the amount of coins in millions?
For example, 4145000 coins would show up as 4m coins.
EDIT:
Tried it and this function will not return the exact amount of coins when you have more then 1000 gp.
It will round it to 1000's and 1000000's of coins
Is there any other way I can check the amount of coins I received back?
EDIT: Tried using:
Simba Code:B := IntToBox(402, 280, 435, 315);
writeln(GetAmountBox(B));
But it is always returning me 0.
Even though the amount of gold received back is not 0....
The coords in Tbox B are the coords of the box where the gold is returned.
Last edited by blabla7; 10-30-2011 at 11:35 PM.
I think I found a way.
I've tried messing around with text.scar, but I need some help.
Is there any way to check the chatbox's last message for a specific part of that string?
I would examine the coins, so it will for example say
I will want to do something like this:Code:619237109 x Coins.
Simba Code:r : String;
r:=GetLastChatMessage('Coins');
r := r - substring(-7) (to remove the last 7 digits).
Something similar can be done in java, wondering how to do it in pascalscript...
Can you post what you wan't the result be?Simba Code:function TrimLetters(s : string) : string;
var
LetterArray: TStringArray;
i: Integer;
begin
LetterArray := ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o',
'p','q','r','s','t','u','v','w','x','y','z', '.'];
result := s;
for i := 0 to Length(LetterArray) - 1 do
result := Replace(result, LetterArray[i], '', [rfReplaceAll, rfIgnoreCase]);
end;
begin
Writeln(TrimLetters('619237109 x Coins.'));
end.
~Home
Last edited by Home; 10-31-2011 at 11:15 AM.
Thanks a lot for your imput.
I'd like to examine the coins, so the chatmessage would become:
6917239 x Coins.
I'd like to store this message into a string and remove thefrom this string, so that the only part left is 6917239. I will then useCode:x Coins.to store the amount of cash into an integer.Code:strtoint(thestring)
EDIT: when I edit yourtoCode:LetterArray := ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o', 'p','q','r','s','t','u','v','w','x','y','z', '.'];(note that I added the spaces) I will only have the numbers left. Now is there any way I can read the last message and store it in a string?Code:[LetterArray := ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o', 'p','q','r','s','t','u','v','w','x','y','z', '.', ' '];[
I know that FindBlackChatMessage('') does not return the string but just checks it...
Last edited by blabla7; 10-31-2011 at 11:28 AM.
i believe theres a function in simba to retrieve just the numbers from a string
-RM
Thanks a lot! Rep++'ed!
You really helped me out!
Current projects:
[ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]
"I won't fall in your gravity. Open your eyes,
you're the Earth and I'm the sky..."
The replace method seems to be overriden in SRL.
But as soon as I includeCode:Compiled successfully in 15 ms. 619237109 Successfully executed.I getCode:{.Include SRL/SRL.SCAR}EDIT1:Code:[Error] (13:80): Invalid number of parameters at line 12 Compiling failed.
Nevermind figured it out.
EDIT2:
Now thats great... GetChatBoxText seems to be broken.
Simba Code:function TrimLetters(s : string) : string;
var
LetterArray: TStringArray;
i: Integer;
begin
LetterArray := ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o',
'p','q','r','s','t','u','v','w','x','y','z', '.', ' ', 'A', 'B', 'C', 'D', 'E',
'F', 'G','H','I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'X', 'Y', 'Z'];
result := s;
for i := 0 to Length(LetterArray) - 1 do
result := Replace(result, LetterArray[i], '');
end;
Function CountMoney: boolean;
var
r : string;
x: integer;
begin
MouseItem(1,false);
wait(1000+random(200));
Chooseoption('Examine');
wait(1000+random(2000));
r := GetChatBoxText(8,clBlack);
x:= strtoint(TrimLetters(r));
writeln(x);
end;
Returns this:
I do understand the error. (by the way the 4 is correct).Code:Error: Exception: "?'??'4??" is an invalid integer at line 49
But since GetChatBoxText does not return the correct amount of money and cannot identify the numbers this method is useless![]()
Last edited by blabla7; 10-31-2011 at 12:50 PM.
BUMP with the same question.
blabla7: Yes, unfortunately there is some troubles with Simba's OCR at the moment
Either that or the coordinates passed on to FindTextTPA in GetChatBoxText is off by some pixels..
If it's the OCR then there isn't much you can do, I'm afraid...
I made one of these in reflection a few years ago. It would be great to make one again. Just need to get into Pascalscript :L
http://villavu.com/forum/showthread....177#post838177 report them pleaaasee, I'd love to fill the entire list with red![]()
I made a new script, check it out!.
Ok so yesterday I was flipping for a bit, mithril ores, to test out the concept and see how this works. I got dragged in into I guess what might've been a big mistake.... I was both buying (cheap) ABOVE MED PRICE and selling high, above med price.
Someone came, dumped ores at market price and I got f*cked. I'm guessing never buy above market price? Mithril Ores are on the rise, so I was like... yeh fair enough that they're buying above mid price... but then I saw through action the big flaw in that.
Should it be a sort of rule that if they're buying above market price then it's no good to flip? On the other hand, the price I as buying them at is now Market Price, so I'm all profit. What I'm thinking is that there might be a need to keep a few ores behind to monitor the market, cus we don't want to have goods sitting still in a script, and keeping some behind would allow us to know when the market is no longer favorable, switch items, and get back to that one later.
So an f2p version would probably merchant 3/4 items, and a p2p version would probably merchant 10 - 12 items, rotating them as the market floats.
~RM
Last edited by Sir R. M8gic1an; 12-05-2011 at 12:39 PM.
You've got it pretty much, but I know when I flip, all I do is this.
1. Buy high.
2. Sell low.
At this point, you're going to lose money, whatever you're flipping.
3. Check my "history" and see what I bought and sold for. If I bought for 3,400 and sold for 2,800, there's my window. I then know I can buy at 2,850 and sell at 3,350. Those numbers are both 50 + and - the original values.
4. Buy whatever item it is at the low price, and sell at the high price.
What you said about buying above market price...sometimes it's actually good and means the item is rising. The key for a script would just be recognizing the number you buy high at and the number you sell low at, and buy at the low number and sell at the high number.
There are currently 1 users browsing this thread. (0 members and 1 guests)