Results 1 to 9 of 9

Thread: FindCoins

  1. #1
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default FindCoins

    Whilst trying to figure out how to withdraw some coins i discovered that findcoins is broken....so I took some time...and I made a new one...using some functions...I wouldn't even have heard of yesterday...but it seems to do a good job... at this current stage it should work, and I do have a backup uptext check...but with some expert tweeking, that I am yet unable to do...it shouldn't need it...so without anymore rambling....

    SCAR Code:
    Function CoinFinder(var Tpoint:Tpoint):Boolean;
    var
      i:integer;
      Tpnt:TPoint;
      TPA:TPointArray;
      ATPA:T2DPointArray;
    begin
      Result := False
      Findcolorstolerance(TPA, 1540000, MBX1, MBY1, MBX2, MBY2, 10)
      ATPA := TPAtoATPAEx(tpa, 20, 30)
      for i:=0 to high(ATPA) do
        if high(ATPA[i])>10 then
        begin
          TPnt := MiddleTPA(ATPA[i]);
          MMouse(Tpnt.x, Tpnt.y, 5, 5)
          If isuptext('oins') then
          begin
            result := true
            TPoint:=TPnt
            exit;
          end;
        end;
    end;

    Currently working for the bank only...but should be able to be modded for invo use also...but I am tired... so I am going to bed...school starts day after tomorrow...so if I don't make it work with it by this time tomorrow, don't expect me to do it...sorry...
    Last edited by Bad Boy JH; 01-26-2010 at 11:16 AM. Reason: Didn't output variables...fixed now

  2. #2
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Simply make a DTM of the coins (avoiding the upper left hand corner) for it to check the inventory. The way this would work is..

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}

    var X, Y: Integer;

    procedure Example; //Our procedure to check inventory
      begin
        DTM HERE
       
          if FindDTM(DTM, X, Y, MIX1, MIY1, MIX2, MIY2) then
            //What to do if it finds the DTM.
      end;

    begin
    end.

    Isn't this what you're basically looking for?

  3. #3
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    A single dtm wouldn't work if your making it able to find smaller amouths of coins too. Like 1 gp

  4. #4
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yes, that was the main issue i was going for....i wanted it to be compatible for all the ammounts of coins.... 1-10 milllion and above...

  5. #5
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Then you would use colors.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  6. #6
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Did you read my function, it uses colors...

  7. #7
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I was replying to anti miies/Risk.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  8. #8
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok then... I'll try to remember not everything is about me!

  9. #9
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I figure a withdraw coins function would be useful as well, should that be made also, ie something like

    withdrawcoins(amount:integer) and that will withdraw the amount of coins, just a few extra lines of simple code...

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
  •