Results 1 to 13 of 13

Thread: Mouse Goes to Top Left Corner Clicks, stops.

  1. #1
    Join Date
    Apr 2007
    Posts
    379
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Mouse Goes to Top Left Corner Clicks, stops.

    Well, I am working on a little death return thing for my script and I have hit a problem. This thing so to speak is just moving the mouse to the corner and clicking.

    I am using bitmaps and well here is the script. It is not meant to log you in yet or anything so please just bear with me.

    SCAR Code:
    program HomePort;

    {.include srl/SRL.scar}

    var tx, ty, MagicTab, HomePort: Integer;

    procedure DeclareBMP;
     begin
      MagicTab := BitmapFromString(4, 2, 'aC2B1278DA6DCB410AC02' +
           '00C44D12BC59A68B24CB4B9FF91EAB4502974F318183E11518E05' +
           '852EB8B6A5F009FD8071EFE6784DF72BA80EE5774BA26D8848CAC' +
           '4EE05CE0ED3A055BCC6FB550485F0521F1EDA6A7864D6305FF2D7' +
           '2E7F3ED505E0F');
      HomePort := BitmapFromString(4, 2, 'aA27EB78DA458C410EC02' +
           '00804BFB48AA0BD8AF2FF27D5D5A686644286090010BE80DE1624' +
           'B85ACA8B1A4636B2D8F526EC4DD9E756D8A8FFBD3141715EABF25' +
           'D9541DF7597B8FE615A3B3F606C5617956233784F1F27E7783648' +
           '87C7BFC06');
     end;

    procedure OpenMagicTab;
     begin
      If(FindBitmap(MagicTab, tx, ty)) then
       wait(100 + Random(150));
       Mouse(tx, ty, 6, 6, True);
       wait(100);
     end;

    Procedure CastHomePort;
     Begin
      If(FindBitmap(HomePort, tx, ty)) Then
       wait(100 + Random(150));
       Mouse(tx, ty, 5, 5, True);
       wait(100);
      end;

    Begin
     SetupSRL;
     DeclareBMP;
     OpenMagicTab;
     CastHomePort;
    end.

    Plus if it just has to do with the runescape update then please tell.

    Also I have tried A little debugging with the actual casting so here is what else I tried with it.

    SCAR Code:
    program New;

    {.include srl/SRL.scar}

    var tx, ty, HomePort: Integer;

    procedure DeclareBMP;
     begin
      HomePort := BitmapFromString(4, 2, 'aA27EB78DA458C410EC02' +
           '00804BFB48AA0BD8AF2FF27D5D5A686644286090010BE80DE1624' +
           'B85ACA8B1A4636B2D8F526EC4DD9E756D8A8FFBD3141715EABF25' +
           'D9541DF7597B8FE615A3B3F606C5617956233784F1F27E7783648' +
           '87C7BFC06');
     end;

    Procedure CastHomePort;
     Begin
      If(FindBitmapin(HomePort, tx, ty, 550, 22, 604, 27)) Then
       Status('Found BMP');
       wait(1000 + Random(150));
       Mouse(tx, ty, 5, 5, True);
       wait(1000);
       Status('Clicked');
      end;
    Begin
     SetupSRL;
     DeclareBMP;
     CastHomePort;
    end.

  2. #2
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    After if..then you need begins and ends to tell the script to do if it finds what you're looking for. It only does the first thing after the statement.

    Fixed:
    SCAR Code:
    program HomePort;
     
    {.include srl/SRL.scar}
     
    var tx, ty, MagicTab, HomePort: Integer;
     
    procedure DeclareBMP;
     begin
      MagicTab := BitmapFromString(4, 2, 'aC2B1278DA6DCB410AC02' +
           '00C44D12BC59A68B24CB4B9FF91EAB4502974F318183E11518E05' +
           '852EB8B6A5F009FD8071EFE6784DF72BA80EE5774BA26D8848CAC' +
           '4EE05CE0ED3A055BCC6FB550485F0521F1EDA6A7864D6305FF2D7' +
           '2E7F3ED505E0F');
      HomePort := BitmapFromString(4, 2, 'aA27EB78DA458C410EC02' +
           '00804BFB48AA0BD8AF2FF27D5D5A686644286090010BE80DE1624' +
           'B85ACA8B1A4636B2D8F526EC4DD9E756D8A8FFBD3141715EABF25' +
           'D9541DF7597B8FE615A3B3F606C5617956233784F1F27E7783648' +
           '87C7BFC06');
     end;
     
    procedure OpenMagicTab;
    begin
      If(FindBitmap(MagicTab, tx, ty)) then
      begin
        wait(100 + Random(150));
        Mouse(tx, ty, 6, 6, True);
        wait(100);
      end;
    end;
     
    Procedure CastHomePort;
    Begin
      If(FindBitmap(HomePort, tx, ty)) Then
      begin
        wait(100 + Random(150));
        Mouse(tx, ty, 5, 5, True);
        wait(100);
      end;
    end;
     
    Begin
     SetupSRL;
     DeclareBMP;
     OpenMagicTab;
     CastHomePort;
    end.

  3. #3
    Join Date
    Mar 2007
    Location
    Netherlands->Amersfoort.
    Posts
    1,615
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you din't make a fail save. so when it don't found the bitmaps the cords will be 0, 0. (the left top cornet).

    try this:

    SCAR Code:
    program New;
     
    {.include srl/SRL.scar}
     
    var tx, ty, HomePort: Integer;
     
    procedure DeclareBMP;
     begin
      HomePort := BitmapFromString(4, 2, 'aA27EB78DA458C410EC02' +
           '00804BFB48AA0BD8AF2FF27D5D5A686644286090010BE80DE1624' +
           'B85ACA8B1A4636B2D8F526EC4DD9E756D8A8FFBD3141715EABF25' +
           'D9541DF7597B8FE615A3B3F606C5617956233784F1F27E7783648' +
           '87C7BFC06');
     end;
     
    Procedure CastHomePort;
     Begin
      If(FindBitmapin(HomePort, tx, ty, 550, 22, 604, 27)) Then
       begin;
         Status('Found BMP');
         wait(1000 + Random(150));
         Mouse(tx, ty, 5, 5, True);
         wait(1000);
         Status('Clicked');
      end else
      begin;
        WriteLn('not found home teleport butten');
        //other fail save thigs you like;
      end;
    Begin
     SetupSRL;
     DeclareBMP;
     CastHomePort;
    end.

    edit: not fair 3 seconds

  4. #4
    Join Date
    Apr 2007
    Posts
    379
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the quick reply but I tried what you did and it didn't do anything.
    User specified a new RS window
    Successfully compiled
    SRL Compiled in 47msec.
    Successfully executed

  5. #5
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Yes, because it didn't find the stuff you were looking for.

  6. #6
    Join Date
    Apr 2007
    Posts
    379
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Gah well on program New;

    {.include srl/SRL.scar}

    var tx, ty, HomePort: Integer;

    procedure DeclareBMP;
    begin
    HomePort := BitmapFromString(4, 2, 'aA27EB78DA458C410EC02' +
    '00804BFB48AA0BD8AF2FF27D5D5A686644286090010BE80DE 1624' +
    'B85ACA8B1A4636B2D8F526EC4DD9E756D8A8FFBD3141715EA BF25' +
    'D9541DF7597B8FE615A3B3F606C5617956233784F1F27E778 3648' +
    '87C7BFC06');
    end;

    Procedure CastHomePort;
    Begin
    If(FindBitmapin(HomePort, tx, ty, 550, 22, 604, 27)) Then
    begin;
    Status('Found BMP');
    wait(1000 + Random(150));
    Mouse(tx, ty, 5, 5, True);
    wait(1000);
    Status('Clicked');
    end else
    begin;
    WriteLn('not found home teleport butten');
    //other fail save thigs you like;
    end;
    end; // forgot this :P
    Begin
    SetupSRL;
    DeclareBMP;
    CastHomePort;
    end.


    And Well I did the BMP's right but it hasn't found them? Should I make the BMPS bigger or what? I thought I did them Perfect... I had gotten so excited.

  7. #7
    Join Date
    Jul 2007
    Posts
    137
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    are you having problems with gametab? if so i can help... dtms can also be a nice alternative to bitmaps...
    Do not propose an idea of peculation without evidence of such action.

    http://cashcrate.com/704591 click here and make money!

  8. #8
    Join Date
    Apr 2007
    Posts
    379
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well Natuarally there wouldn't have been a problem with the casting but with the update, I have decided to take this piece into my own hands and try to do what I think would work for a gametab. Yeah DTMs work but it wouldn't really that great for the actuall casting.

    Ha Nevermind I found out my problem! Yes I forgot the Begins and Ends in the Ifs and yeah I didn't add failsaifs but it wasn't finding the BMP's too small I think. Well thanks for the help!

    Now just to implement this into my Lumbridge oak chopper and seller =)

  9. #9
    Join Date
    Jul 2007
    Posts
    137
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ill post something for you
    one second

    EDIT: here you go, you can also use the tab for other things, i edited it for all 14 tabs
    SCAR Code:
    program HomePort;

    {.include srl/SRL.scar}

    var tx, ty, MagicTab, HomePort: Integer;

    procedure DeclareDTM;
     begin
      HomePort := DTMFromString('78DA63B462626078CF8002FEFDFB07A619A17' +
           'C461BA09A3744A8F948408D25916ADE10A186909BAD89F4170135' +
           '00EC68213B');
     end;

    function Tab(number: Integer): Boolean;    //gametab from srl edited by omgwoot.
    var
      c: Integer;
    begin
      case number of
        1: if (not (GetColor(541, 174) = 1910385)) then
          begin
            repeat Mouse(541, 174, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        2: if (not (GetColor(573, 176) = 1778795)) then
          begin
            repeat Mouse(578, 185, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        3: if (not (GetColor(601, 175) = 1910385)) then
          begin
            repeat Mouse(607, 185, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        4: if (not (GetColor(633, 173) = 1976437)) then
           begin
             repeat Mouse(643, 186, 5, 5, True);
               c := c + 1;
            until (c >= 1)
          end;
        5: if (not (GetColor(665, 172) = 1910385)) then
          begin
            repeat Mouse(671, 184, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        6: if (not (GetColor(699, 174) = 1910385)) then
          begin
            repeat Mouse(706, 187, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        7: if (not (GetColor(732, 175) = 1910385)) then
          begin
            repeat Mouse(741, 185, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        8: if (not (GetColor(528, 474) = 1778795)) then
          begin
            repeat Mouse(537, 474, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        9: if (not (GetColor(622, 497) = 1910385)) then
          begin
            repeat Mouse(572, 480, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        10: if (not (GetColor(599, 470) = 1910385)) then
          begin
            repeat Mouse(609, 475, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        11: if (not (GetColor(631, 469) = 1778795)) then
          begin
            repeat Mouse(637, 476, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        12: if (not (GetColor(667, 472) = 1910385)) then
          begin
            repeat Mouse(669, 475, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        13: if (not (GetColor(698, 477) = 1910385)) then
          begin
            repeat Mouse(706, 485, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        14: if (not (GetColor(732, 471) = 1976437)) then
          begin
            repeat Mouse(740, 479, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        end;
        if (c < 3) then
        begin
          Result := True;
          Wait(10);
        end;
    end;

    Procedure CastHomePort;
     Begin
      tab(7);
      If(Finddtm(HomePort, tx, ty, 553, 206, 735, 460)) Then
        begin
          wait(100 + Random(150));
          Mouse(tx, ty, 5, 5, True);
          wait(100);
        end;
      end;

    Begin
     SetupSRL;
     Declaredtm;
     activateclient;
     wait(1000);
     CastHomePort;
    end.

    i'm sure that works

    I can also give you my equivalent to make compass.
    Do not propose an idea of peculation without evidence of such action.

    http://cashcrate.com/704591 click here and make money!

  10. #10
    Join Date
    Apr 2007
    Posts
    379
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program HomePort;

    {.include srl/SRL.scar}

    var tx, ty, MagicTab, HomePort, HomePortX: Integer;

    procedure DeclareBMP;
     begin
      MagicTab := BitmapFromString2(False, 'a6252478DA458CC11100' +
           '2108035B021194A7A8F45FD2191F278F9D4C76021131339D9B795' +
           '0C50EB56E7014306EB601EBFD599D87252E7BFD1B4D7C304C4979' +
           '2137FCB7D5C074D005D6EBB31D03D13B5BE849F6886E124E6D9B6' +
           '82ACB9C12EAF901F9B');
      HomePort := BitmapFromString2(False, 'a647A478DA7D8D510AC42' +
           '00C05AFF46C4CE27EAA6DEE7FA4FA2A6C05D9253084715400883E' +
           '80560624B85A3A06358C2C64B6D79BB037657F94CC46FBB73726C' +
           '89DA7AE7CCEE5A46FFA9478FD87A937BE80934C01AF5EA3EC1495' +
           '6CD7CAE9791769322ECE3CDDFD6A763FF775FEF7BFFEBD01421');
       HomePortX := BitmapFromString2(False, 'a56F8D78DAEDCDB115C5' +
           '200C43D1954CC086DFE224FB8F1444F13344DE2D54E8086366A51' +
           '45BF25E511516E558E9772887B2C5DB474DA50FF5A7FA63342D3D' +
           'FFAF42436BA94D771DED55D398BE97F6F63F4DFBDC174EED23E6C' +
           'A2BF79700000000000000000000000000000000BEEA01218');
     end;

    procedure OpenMagicTab;
    begin
     If(FindBitmap(MagicTab, tx, ty)) then
      begin
        wait(100 + Random(150));
        Mouse(tx, ty, 6, 6, True);
        wait(100);
      end else
       begin
        WriteLn('Didn''t Find The Magic Tab! ');
       end;
     end;


    Procedure CastHomePort;
     Begin
      If(FindBitmap(HomePort, tx, ty)) Then
       begin
        wait(100 + Random(150));
        Mouse(tx, ty, 5, 5, True);
        wait(15000);
        WriteLn('Successfully Teleported "Home"!');
      end else
        If(FindBitmap(HomePortX, tx, ty)) Then
         begin
          WriteLn('Didn''t Find The Spell, HomePort, or You Casted it Not To Long Ago!');
       end;
     end;


    Begin
     SetupSRL;
     DeclareBMP;
     OpenMagicTab;
     CastHomePort;
    end.

    Well If you see that failsaif the one where it says you casted it not to long ago. How would I add it. Because it doesn't look right and as long as it finds the BMP for it to teleport it won't go to that. Any Idea how I can do it?

  11. #11
    Join Date
    Jul 2007
    Posts
    137
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    well, if you cast homeport not too long ago, runescape displays a message i think... you could look for a dtm or bitmap of that. use the script i posted by the way... i can add some fail safes for you...
    Do not propose an idea of peculation without evidence of such action.

    http://cashcrate.com/704591 click here and make money!

  12. #12
    Join Date
    Apr 2007
    Posts
    379
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    omgwoot I like the way that works. Although I will use it eventually, I am not going to use it for this script just because I am going to make it all into 1 little thing to have the character if he gets lost to tele back and walk to the general store. I am not worried about fail safes for this thing because it is going to happen once every 2 hours or something like that so I am not going to really prep it up.

    Thanks for the ideas tho. HomePortX is the message. But I don't know how to make it so if it finds that after clicking the Home Port that it won't continue the wait set so it won't try to walk while it is casting.

  13. #13
    Join Date
    Jul 2007
    Posts
    137
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hold on
    I have an idea. but i'm running out of characters xD

    if the character can't use the spell yet, do you want him to log out and wait 30 mins?

    EDIT: this is what i have so far, if you have any more problems PM me, and i will try to help.


    SCAR Code:
    program HomePort;

    {.include srl/SRL.scar}

    var
      tx, ty, HomePort: Integer;

    procedure DeclareDTM;
    begin
      HomePort := DTMFromString('78DA63B462626078CF8002FEFDFB07A619A17' +
           'C461BA09A3744A8F948408D25916ADE10A186909BAD89F4170135' +
           '00EC68213B');
    end;

    function Tab(number: Integer): Boolean;    //gametab from srl edited by omgwoot.
    var
      c: Integer;
    begin
      case number of
        1: if (not (GetColor(541, 174) = 1910385)) then
          begin
            repeat Mouse(541, 174, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        2: if (not (GetColor(573, 176) = 1778795)) then
          begin
            repeat Mouse(578, 185, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        3: if (not (GetColor(601, 175) = 1910385)) then
          begin
            repeat Mouse(607, 185, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        4: if (not (GetColor(633, 173) = 1976437)) then
           begin
             repeat Mouse(643, 186, 5, 5, True);
               c := c + 1;
            until (c >= 1)
          end;
        5: if (not (GetColor(665, 172) = 1910385)) then
          begin
            repeat Mouse(671, 184, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        6: if (not (GetColor(699, 174) = 1910385)) then
          begin
            repeat Mouse(706, 187, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        7: if (not (GetColor(732, 175) = 1910385)) then
          begin
            repeat Mouse(741, 185, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        8: if (not (GetColor(528, 474) = 1778795)) then
          begin
            repeat Mouse(537, 474, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        9: if (not (GetColor(622, 497) = 1910385)) then
          begin
            repeat Mouse(572, 480, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        10: if (not (GetColor(599, 470) = 1910385)) then
          begin
            repeat Mouse(609, 475, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        11: if (not (GetColor(631, 469) = 1778795)) then
          begin
            repeat Mouse(637, 476, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        12: if (not (GetColor(667, 472) = 1910385)) then
          begin
            repeat Mouse(669, 475, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        13: if (not (GetColor(698, 477) = 1910385)) then
          begin
            repeat Mouse(706, 485, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        14: if (not (GetColor(732, 471) = 1976437)) then
          begin
            repeat Mouse(740, 479, 5, 5, True);
              c := c + 1;
            until (c >= 1)
          end;
        end;
        if (c < 3) then
        begin
          Result := True;
          Wait(10);
        end;
    end;

    Procedure CastHomePort;
    var c, p : integer;
     Begin
      c := 9938070;
      tab(7);
      lowestangle;
      If(Finddtm(HomePort, tx, ty, 553, 206, 735, 460)) Then
        begin
          wait(100 + Random(150));
          Mouse(tx, ty, 5, 5, True);
          wait(100);
            repeat
              wait(100);
              marktime(p);
            until findcolortolerance(x, y, 9938070, 246, 155, 301, 193, 5)or(TimeFromMark(p)>30000)
          if findcolortolerance(x, y, c, 246, 155, 301, 193, 5) then
            begin
              writeln('Successfully Teleported "Home"!');
              wait(17000+random(1500));
            end;
          if TimeFromMark(p)>30000 then
            begin
              WriteLn('Didn''t Find The Spell, HomePort, or You Casted it Not To Long Ago!');
              // put the actions you want to happen if you can't use spell here
            end;
        end;
    end;

    Begin
      SetupSRL;
      Declaredtm;
      activateclient;
      wait(1000);
      CastHomePort;
    end.


    Just in case here is my alternative to the MakeCompass procedure:

    SCAR Code:
    procedure compass( dir : string);
    begin
      case lowercase(dir) of
        'n':  if not finddtm(N, x, y, 540, 1, 579, 40) then
                begin
                  keydown(VK_LEFT);
                    repeat
                      wait(50);
                    until
                  finddtm(N, x, y, 540, 1, 579, 40);
                  keyup(VK_LEFT);
                end;

        's':  if not finddtm(S, x, y, 540, 1, 579, 40) then
                begin
                  keydown(VK_LEFT);
                    repeat
                      wait(50);
                    until
                  finddtm(N, x, y, 540, 1, 579, 40);
                  keyup(VK_LEFT);
                end;

        'e':  if not finddtm(E, x, y, 540, 1, 579, 40) then
                begin
                  keydown(VK_LEFT);
                    repeat
                      wait(50);
                    until
                  finddtm(E, x, y, 540, 1, 579, 40);
                  keyup(VK_LEFT);
                end;

        'w':  if not finddtm(W, x, y, 540, 1, 579, 40) then
                begin
                  keydown(VK_LEFT);
                    repeat
                      wait(50);
                    until
                  finddtm(W, x, y, 540, 1, 579, 40);
                  keyup(VK_LEFT);
                end;
      end;
    end;

    and here are the dtms:

    SCAR Code:
    procedure compbtmsdtms;
    begin
      N := DTMFromString('78DA633464626010614001DFBE7E04D38C503' +
           'E23488D00AA9AAD0E4E986AC450D518D8AD4151030082610607');
      S := DTMFromString('78DA633464626010614001DFBE7E04D38C503' +
           'E23488D38AA9AAD0E4E986A8450D518D8AD4151030083BA060A');
      E := DTMFromString('78DA63D4676260106640015B1D9CC0342394C' +
           'F6844580D006DF102FE');
      W := DTMFromString('78DA6334616260106140015B1D9CC0342394C' +
           'F6888A9E6DBD78FA86AF431D518D8AD4151030048F6060A');
    end;

    if you use them, be sure to give credits...
    Do not propose an idea of peculation without evidence of such action.

    http://cashcrate.com/704591 click here and make money!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. color coordinates and mouse clickS?
    By droppeD:) in forum OSR Help
    Replies: 5
    Last Post: 12-18-2008, 10:01 PM
  2. Replies: 2
    Last Post: 09-23-2008, 11:04 PM

Posting Permissions

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