Results 1 to 6 of 6

Thread: New Function Help!

  1. #1
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default New Function Help!

    Function:
    SCAR Code:
    function WithdrawDTM(DTM1: integer; var Index:integer; Amount: integer; UpText: TStringArray): boolean;

    var
      x1, y1: integer;
      BankBox: TBox;
      Found: boolean;
     
    label
      Start;
     
    begin
      if (Index = 0) then
      begin
        Start:
        for Index := 1 to 50 do
        begin
          BankBox := BankIndexToMSBox(Index);
          if FindDTM(DTM1, x1, y1, BankBox.x1 , BankBox.y1, BankBox.x2, BankBox.y2) then
          begin
            MMouse(x1, y1, 4, 4);
            Wait(50+random(15));
            if IsUpTextMultiCustom(UpText) then
            begin
              Writeln('Found Item at Bank Slot ' + IntToStr(Index));
              Found := true;
              break;
            end else
              Writeln('Found Item, Incorrect UpText, moving.');
          end;
        end;
      end else
      begin
        BankBox := BankIndexToMSBox(Index);
        if FindDTM(DTM1, x1, y1, BankBox.x1, BankBox.y1, BankBox.x2, BankBox.y2) then
        begin
          MMouse(x1, y1, 4, 4);
          Wait(50+random(15));
          if IsUpTextMultiCustom(UpText) then
          begin
            Writeln('Found Item at Bank Slot ' + IntToStr(Index));
            Found := true;
          end;
        end else
        begin
          Writeln('DTM Moved, checking bank again.');
          GoTo Start;
        end;
      end;
      Wait(200+random(150));
      if Found then
      begin
        x := x1; y := y1;
        Mouse(x1, y1, 0, 0, false);
        Wait(200+random(200));
        if (Amount = 5) or (Amount = 10) then
          ChooseOption('Withdraw-' +IntToStr(Amount))
        else if Amount = 0 then
          ChooseOption('Withdraw-All')
        else
        if not(ChooseOption('Withdraw-' + IntToStr(Amount))) then
        begin
          ChooseOption('Withdraw-X');
          Wait(1000 + Random(100));
          TypeSend(IntToStr(Amount));
        end;
        Result := true;
      end else
      begin
        Index := 0;
        Writeln('Could not Find DTM in Bank.');
      end;
    end;

    Error:
    Seems like the uptext fails, as it doesn't find it. It moves the mouse to the dtm, but when the check is preformed it comes back false, when, at times, it is true!

    Thanks,

    Nava2
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  2. #2
    Join Date
    Jan 2008
    Location
    Frankfurt, Germany
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Use IsUpTextMultiCustom, dunno the difference, only that it works and yours appaeranlty doesn't ^^
    There is nothing right in my left brain and there is nothing left in my right brain.

  3. #3
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    uptext is case sensitive isnt it?

    nvm your problem is that you used break instead of exit;

    exit leaves a procedure/function
    break leaves the highest if or loop or for or whatever
    ~ Metagen

  4. #4
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Well, when I use IsUpTextMultiCustom, it works flawlessly, so.. I dunno

    Thanks Pure!

    Edit: It doesnt work. New version posted.

    Nava2
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  5. #5
    Join Date
    Feb 2007
    Location
    @ SRL
    Posts
    402
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol Nava2 you silly bugger,
    It takes around 80 - 90 ms for the UpText to appear, and your only waiting 50 - 75 ms, Change all the wait times just above where it checks for the uptext to
    SCAR Code:
    Wait(200 + Random(100));
    The game has an unexplainable attraction that convinces the player they are having fun, despite the fact that all they are doing is performing repetitive tasks to increase their statistics. "The game is actually a graphical nightmare and its gameplay is simple at best. Yet something, perhaps by subliminal means, forces the player - against his will - to play the game, and to believe that they are having fun".

  6. #6
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by turbobk View Post
    Lol Nava2 you silly bugger,
    It takes around 80 - 90 ms for the UpText to appear, and your only waiting 50 - 75 ms, Change all the wait times just above where it checks for the uptext to
    SCAR Code:
    Wait(200 + Random(100));
    If that's it I will cry .

    Nava2
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 02-27-2008, 05:20 PM
  2. Replies: 2
    Last Post: 02-26-2008, 08:26 PM
  3. Any function that does this?
    By shadowpwner in forum OSR Help
    Replies: 2
    Last Post: 08-14-2007, 03:15 AM
  4. [FUNCTION] FindDoorColour: integer; By ZephyrsFury [FUNCTION]
    By ZephyrsFury in forum Research & Development Lounge
    Replies: 10
    Last Post: 07-27-2007, 08:45 AM

Posting Permissions

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