Results 1 to 2 of 2

Thread: Right-click Attack Script Help

  1. #1
    Join Date
    Mar 2012
    Location
    Australia
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default Right-click Attack Script Help

    Hi Guys,

    I'm a little lost on my script and need a bit of assistance, what I'm trying to create is a tool that waits until I right-click on the screen, and then selects the option 'attack' if it finds the DTM, seeing as this is for an RSPS and the text-finding tool thing doesn't work.

    This is what I've got so far, it finds the DTM without issue.

    Any and all help is appreciated!

    Simba Code:
    program rightclickattack;

    {$i srl/srl.simba}

    var
      Attack, X, Y: Integer;

    begin

      SetupSRL;

      attack := DTMFromString('m6wAAAHic42ZgYHjMyMBwF4ivA/FZKAbxnwPxByD+BsRfgfgTEG8Fqt8IxJuAeDMQ74TiXUgYpubYjqkM2uoyYBodo4uTAhhJwEgAAHfrJTw=');
      FindDTM (attack, x, y, MSX1, MSY1, MSX2, MSY2) then

    begin
      MMouse (x, y, 0, 0);
      Mouse (X, Y, 0, 0, True);
      end;
      FreeDTM(Attack);
    end.

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

    Default

    Try this buddy:
    Simba Code:
    program rightclickattack;
    {$i srl/srl.simba}

    var
      DTM_Attack: Integer;

    Procedure DefineGlobals;
    begin
      DTM_Attack := DTMFromString('m6wAAAHic42ZgYHjMyMBwF4ivA/FZKAbxnwPxByD+BsRfgfgTEG8Fqt8IxJuAeDMQ74TiXUgYpubYjqkM2uoyYBodo4uTAhhJwEgAAHfrJTw=');
    end;

    Procedure FreeGlobals;
    begin
      FreeDTM(DTM_Attack);
    end;

    Function ChooseAttack: Boolean;
    var
      X,Y: Integer;
    begin
      if not FindDTM(DTM_Attack, X, Y, MSX1, MSY1, MSX2, MSY2) then
        Exit;

      MMouse(X, Y, 0, 0);
      ClickMouse2(mouse_left);
      Result := True;
    end;


    begin
      SetupSRL;
      DefineGlobals;
      AddOnTerminate('FreeGlobals');

      if ChooseAttack then
        Writeln('Choose the "Attack" option!')
      else
        Writeln('Failed to find "Attack" option...');
    end.

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


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
  •