Results 1 to 6 of 6

Thread: Help with script

  1. #1
    Join Date
    Jun 2014
    Posts
    144
    Mentioned
    0 Post(s)
    Quoted
    61 Post(s)

    Default Help with script

    Hey guys, so I'm trying to combine some of my code into smaller procedure(and fewer) so it doesn't look so messy and unprofessional. I'm currently using things like this and it's repetitive and incredibly messy. If it helps, I'm using an input query to to determine whether a guard or hero is going to be thieved. Is there a way to combine these two procedures?

    Simba Code:
    Procedure PickPocketGuard;
    var
      x, y:Integer;
    Begin
    Mouse(615, 21, 3, 3, true);
    KeyDown(38);
    Wait(1500);
    KeyUp(38);
    repeat
    repeat
      KeyDown(37);
    until(FindColorTolerance(X, y, 2248736, msx1, msy1, msx2, msy2, 5));

    Begin
      KeyUp(37);
      if FindObjEx(X, y, ['1IIac4'], [2248736], 5, 50, 155, 126, 546, 350) then
        Begin
          MoveMouse(X, y);
          Wait(50);
          ClickMouse(X, y, 0);
          Wait(100);
          ClickPickPocket;
          Wait(100);
          Stunned;
          Status := 'stealin geepee';
          ProggyGuard;
          Wait(1000);
        End;
    End;
    until(Iskeydown(113));
    End;

    Procedure PickPocketHero;
    var
      x, y:Integer;
    Begin
    Mouse(615, 21, 3, 3, true);
    KeyDown(38);
    Wait(1500);
    KeyUp(38);
    repeat
    repeat
      KeyDown(37);
    until(FindColorTolerance(X, y, 12293239, msx1, msy1, msx2, msy2, 5));

    Begin
      KeyUp(37);
      if FindObjEx(X, y, ['1IIac4'], [12293239], 5, 50, 155, 126, 546, 350) then
        Begin
          MoveMouse(X, y);
          Wait(50);
          ClickMouse(X, y, 0);
          Wait(100);
          ClickPickPocket;
          Wait(100);
          Stunned;
          Status := 'Stealin Stuff';
          ProggyHero;
          Wait(1000);
        End;
    End;
    until(Iskeydown(113));
    End;

  2. #2
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    You could use a case statement for your input query, like case(keydown) of 113:, 114: or w/e
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols

  3. #3
    Join Date
    Jun 2014
    Location
    EastCoast
    Posts
    76
    Mentioned
    0 Post(s)
    Quoted
    31 Post(s)

    Default

    Maybe something like that, couldn't really test it as i'm typing this in the browser. None the less its for a general idea and may or may not be useful in this occasion.
    Simba Code:
    program new;
    var
      X, Y, ColorCode: Integer;
      Guard, Hero:String

    procedure SetUp;
    begin
      PickTarget:='Hero';  //TargetName in this case either Guard or Hero
    end;

    procedure Loads;
    begin
      case PickTarget of
        'Guard':
          ColorCode:=2248736
        'Hero':
          ColorCode:=12293239

    end;


    procedure FindTarget;
    begin
      Mouse(615, 21, 3, 3, true);
      KeyDown(38);
      Wait(1500);
      KeyUp(38);
      repeat
        KeyDown(37);
      until(FindColorTolerance(X, y, ColorCode, msx1, msy1, msx2, msy2, 5));
    end;

    procedure PickPocket;
    begin
      FindTarget;
      KeyUp(37);
      if FindObjEx(X, y, ['1IIac4'], [ColorCode], 5, 50, 155, 126, 546, 350) then
        begin
          MoveMouse(X, y);
          Wait(50);
          ClickMouse(X, y, 0);
          Wait(100);
          ClickPickPocket;
          Wait(100);
          Stunned;
          Status := 'stealin geepee';
          ProggyGuard;
          Wait(1000);
        end;
    until(Iskeydown(113));
    end;


    begin
    end.

  4. #4
    Join Date
    Jun 2014
    Posts
    144
    Mentioned
    0 Post(s)
    Quoted
    61 Post(s)

    Default

    Thanks @Wire

    That was just the answer I was looking for

  5. #5
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by Spotify View Post
    Thanks @Wire

    That was just the answer I was looking for
    Mention like so:

    [.MENTION] name [./MENTION]

  6. #6
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    Mention like so:

    [.MENTION] name [./MENTION]
    that's the slow way,

    easiest way is

    (at) their name (semicolon)

    @ The Mayor ;

    @The Mayor;
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols

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
  •