Results 1 to 5 of 5

Thread: IsUpText not working for me?

  1. #1
    Join Date
    Jan 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default IsUpText not working for me?

    Hey I'm new to scripting, and I can't seem to make the IsUpText procedure to work...

    Maybe you guys can see where is my mistake. Thanks for your time

    The following code simply looks for a raw salmon in my bag (which he does just fine) and tries to click it if he finds the uptext (which he doesnt) - I've tried all kinds of text "aw salmon" "almon" nothing seems to work. HELP!

    Code:
    program New;
      {$DEFINE SMART8}
      {$I SRL-OSR/SRL.Simba}
      {$I SPS/sps-osr.simba}
    
      var
        Salmon : Integer;
    
    function CheckSalmon: boolean;
    var
      x, y  : Integer;
    
    begin
      Salmon := BitmapFromString(19, 13, 'meJxtkW1LwmAYhd2/CiIwUgwLNU' +
            'zEUipzS8T3FMuSbGGatkSzNxGVpmQlJUmJIKYkEX2IXv9PBx6SpXs' +
            '4X69d59yTSEQeJZFotLRKYx6R0mNy18RUQKEJK2cjKn18xpjWLWUX' +
            '7FeiFDIqs0sVXiBydWhSy07rYkD05twcXTQ7b+3rnWGKIONKn0wVh' +
            'AiI1pQxWPLzDG+yVSyeuiv0HNj9GKD6CEQoRhCjtYxuEK34m57wa3' +
            'Dvk/pfD8X6FhQDAsWio7rsrtHee9tae5V9CyW+hBRBsIXMxxZYoEA' +
            'xxtewBlqOja5/5z3M/aMIojZwKAYEW4BAgWKwACGj2OQ3JdiFIxOE' +
            'bEExIFDgbs7NnnvrhYyKpH+EFF4iVePSdweZeuqkcXjaPM61YOkHO' +
            'IyxzCCFB4phnAW+ky20z/ItBEZUJV9LHj3gg8MUAYvlLqh+cA0knr' +
            'yJJCrR/esYVxUFQeXOH4VBPQQisGy0tB3hRUGURIDzF0+lyx5OgVB' +
            '/f5ZE9P0CL1Tx1g==');
    
      if FindBitmapToleranceIn(Salmon, x, y, MIX1, MIY1, MIX2, MIY2, 15) then
        begin
           Writeln('Found Salmon!');
           MMouse(x, y, 3, 3);
           if IsUpText('lmon') then
           begin
             Wait(200 + Random(100));
             Mouse(x, y, 0, 0, True);
             Result := True;
           end else
             Writeln('Couldn''t find upText');
        end else
          Writeln('Couldn''t find Salmon!');
        FreeBitmap(Salmon);
    end;
    
    begin
      ClearDebug;
      SetupSRL;
      if CheckSalmon then
      begin
        Writeln('cool');
      end else
        Writeln('damn');
    end.
    And the debug box after running:

    Code:
    SRL Compiled in 0 msec
    Paired with SMART[4956]
    Found Salmon!
    Couldn't find upText
    damn
    Successfully executed.

  2. #2
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    After
    Simba Code:
    MMouse(x, y, 3, 3);
    put:
    Simba Code:
    writeln(GetUpText);
    See what it is reading

    Forum account issues? Please send me a PM

  3. #3
    Join Date
    Jan 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    LOL that was wierd, with that writeln it clicked the salmon o.O Waht is this sorcery...

    Code:
    SRL Compiled in 0 msec
    Paired with SMART[4956]
    Found Salmon!
    Use Raw salmon
    cool
    Successfully executed.

  4. #4
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Quote Originally Posted by Falreigimer View Post
    LOL that was wierd, with that writeln it clicked the salmon o.O Waht is this sorcery...

    Code:
    SRL Compiled in 0 msec
    Paired with SMART[4956]
    Found Salmon!
    Use Raw salmon
    cool
    Successfully executed.
    Hah, keep an eye on it, you might need to change it to a multi uptext if you keep getting different results :P

    Forum account issues? Please send me a PM

  5. #5
    Join Date
    Jan 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I just found out something interesting, when the salmon is on the bank here is what happens (tweaked the code to work withdraw a salmon)

    Code:
    Found Salmon!
    Withdraw 1 Raw salmc
    Couldn't find upText
    FAIL!
    Successfully executed.

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
  •