Page 2 of 3 FirstFirst 123 LastLast
Results 26 to 50 of 51

Thread: Grand Exhange Merchant

  1. #26
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by blabla7 View Post
    In the grandexchange.scar functions there is no way to check the amount of money received back, neiter is there in text.scar.
    Could you please explain me how to do this?
    It may be a bit challenging to get it to work properly, but you could use the fonts to search for text on the screen.

  2. #27
    Join Date
    May 2011
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by DeSnob View Post
    It may be a bit challenging to get it to work properly, but you could use the fonts to search for text on the screen.
    I tried doing that, but Ibelieve none of the standard ported fonts were the same

  3. #28
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    I made one of these with reflection....

  4. #29
    Join Date
    May 2011
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mormonman View Post
    I made one of these with reflection....
    So did I, its easy when you can use interfaces etc. to get these numbers, but without them; it ain't.

  5. #30
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    check amount.simba for coin related functions

    -RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  6. #31
    Join Date
    May 2011
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sir R. M8gic1an View Post
    check amount.simba for coin related functions

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

  7. #32
    Join Date
    May 2011
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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
    Code:
    619237109 x Coins.
    I will want to do something like this:

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

  8. #33
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    Quote Originally Posted by blabla7 View Post
    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
    Code:
    619237109 x Coins.
    I will want to do something like this:

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


    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.
    Can you post what you wan't the result be?

    ~Home
    Last edited by Home; 10-31-2011 at 11:15 AM.

  9. #34
    Join Date
    May 2011
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Home View Post
    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.
    Can you post what you wan't the result be?

    ~Home
    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 the
    Code:
     x Coins.
    from this string, so that the only part left is 6917239. I will then use
    Code:
    strtoint(thestring)
    to store the amount of cash into an integer.


    EDIT: when I edit your
    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', '.'];
    to
    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', '.', ' '];[
    (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?

    I know that FindBlackChatMessage('') does not return the string but just checks it...
    Last edited by blabla7; 10-31-2011 at 11:28 AM.

  10. #35
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    i believe theres a function in simba to retrieve just the numbers from a string

    -RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  11. #36
    Join Date
    May 2011
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sir R. M8gic1an View Post
    i believe theres a function in simba to retrieve just the numbers from a string

    -RM
    That doesn't really matter as that problem is resolved now.
    But I would still like to know how to copy the last servermessage into a string...
    Please?

  12. #37
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    Quote Originally Posted by blabla7 View Post
    That doesn't really matter as that problem is resolved now.
    But I would still like to know how to copy the last servermessage into a string...
    Please?
    Use GetChatBoxText



    ~Home

  13. #38
    Join Date
    May 2011
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks a lot! Rep++'ed!
    You really helped me out!

  14. #39
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by Home View Post
    Use GetChatBoxText



    ~Home
    Careful, there's been some very recent reports of the OCR not working correctly.

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


  15. #40
    Join Date
    May 2011
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Home View Post
    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.
    Can you post what you wan't the result be?

    ~Home
    The replace method seems to be overriden in SRL.

    Code:
    Compiled successfully in 15 ms.
    619237109
    Successfully executed.
    But as soon as I include
    Code:
    {.Include SRL/SRL.SCAR}
    I get
    Code:
    [Error] (13:80): Invalid number of parameters at line 12
    Compiling failed.
    EDIT1:
    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:
    Code:
    Error: Exception: "?'??'4??" is an invalid integer at line 49
    I do understand the error. (by the way the 4 is correct).
    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.

  16. #41
    Join Date
    May 2011
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    BUMP with the same question.

  17. #42
    Join Date
    Aug 2011
    Location
    Spooner Street
    Posts
    309
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by blabla7 View Post
    BUMP with the same question.
    Double post. >.< You don't have to bump a thread you posted in yesterday...

    Yours truly,
    Forum Police

  18. #43
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

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

  19. #44
    Join Date
    May 2011
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Zyt3x View Post
    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...
    It does return some of the number correctly so I don't think those coordinates are off.

    And I thought you were allowed to BUMP every day if no-one has responded since. At least thats at most forums.

  20. #45
    Join Date
    Oct 2011
    Location
    England
    Posts
    401
    Mentioned
    10 Post(s)
    Quoted
    176 Post(s)

    Default

    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

  21. #46
    Join Date
    May 2011
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by divina commedia View Post
    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
    Reflection is way easier with hooks and interfaces than using color..
    Nevertheless I got it all in my head. I know exactly how to make it and got quite some experience with pascalscript, its just all functions that I could use are broken...

  22. #47
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    Quote Originally Posted by blabla7 View Post
    its just all functions that I could use are broken...
    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!.

  23. #48
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    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.

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  24. #49
    Join Date
    Nov 2011
    Location
    Louisiana
    Posts
    881
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sir R. M8gic1an View Post
    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
    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.

  25. #50
    Join Date
    Oct 2010
    Posts
    1,255
    Mentioned
    0 Post(s)
    Quoted
    15 Post(s)

    Default

    Quote Originally Posted by shstiger2009 View Post
    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.
    That undercut is ridiculous, wtf.

    Either cut it by 1gp or stay the same price.
    I'm back

Page 2 of 3 FirstFirst 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •