Results 1 to 9 of 9

Thread: Need some help.

  1. #1
    Join Date
    Oct 2016
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Question Need some help.

    Hello everyone I'm Dequality, Brand new in this forum think i registered yesterday? (22/10-16)
    Coded abit (VERY SIMPLE Scripts) in AutoIT now i saw Simba + SRL & so i decided to give it a shot, but i just can't seem to get it to work? my first procedure aint working..?

    Tried to make a simple procedure to teleport to Burthorpe (trying to make a troll hunter just to get started), it opens up the teleport screen but then gives me that error as seen on the picture 0,o
    mCMULSt.jpg

    Also tried to follow "The Mayor"? Tutorial about RS3 & SRL , but i couldnt make SPS work at all it ALWAYS ended up going somewhere else tried with bigger maps, less distance between dots, actually made it work but once my code got 'finished up' everything worked fine when testing it seperately it ALL broke once i made it into a infinite loop? can't figure out wether simba just HATES me or im a total retard? all help is HIGHLY appreciatet hope i explained my problems so they actually can be understood will drop my code from The Mayor's tutorial in a code block so u can see it and possibly help ( English ain't my native language so sorry for being bad at it )

    Code:
    program scriptTemplate;
    
    {$DEFINE SMART}              // Always have this to load smart
    {$I SRL-6/SRL.simba}         // To load the SRL include files
    {$I SPS/lib/SPS-RS3.Simba}   // To load the SPS include files
    
    procedure declarePlayers();
    begin
      setLength(players, 1);
      with players[0] do
      begin
        loginName := 'USER';
        password := 'PASS';
        isActive := true;
        isMember := false;
      end
      currentPlayer := 0;
    end;
    
    procedure tpToVarrock();
    var
     p: TPoint;
    begin
    if not isLoggedIn() Then
        exit;
      repeat
        lodestoneScreen.teleportTo(LOCATION_PORT_SARIM);
        wait(randomRange(14500, 16000));
    
      until (not isLoggedIn()) or minimap.findSymbol(p,MM_SYMBOL_SHOP_FISHING, minimap.getBounds());
    end;
    
    procedure runToClay
    var
      pathToMine: TPointArray;
    
    begin
      if not isLoggedIn() Then
        exit;
      pathToMine := [[213, 225], [198, 183], [189, 124], [172, 87], [130, 69], [78, 59], [40, 70], [47, 108], [70, 118], [80, 123]];
    
      if SPS.walkPath(pathToMine) Then
        minimap.waitPlayerMoving()
      else
        writeLn('We failed to walk to the clay');
    end;
    
    procedure mineRocks();
    var
      x, y, i: Integer;
      TPA: TPointArray;
      ATPA: T2DPointArray;
      mineTimer: TTimeMarker;
    begin
      if not isLoggedIn() Then
        exit;
      mineTimer.start();
    
      repeat
    
        findColorsSpiralTolerance(x, y, TPA, 4298938, mainScreen.getBounds(), 6, colorSetting(2, 0.48, 1.38));
    
        if (Length(TPA) < 1) then
          exit;
    
          ATPA := TPA.toATPA(30, 30);
          ATPA.filterBetween(0, 10); //I added this line
          ATPA.sortFromMidPoint(mainscreen.playerPoint);
          smartImage.debugATPA(ATPA);
    
          for i := 0 to high(ATPA) do
        begin
          mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
          if isMouseOverText(['Clay', 'lay'], 500) Then
          Begin
            fastClick(MOUSE_LEFT);
            smartImage.clear;
            break;
          end;
        end;
        tabBackpack.waitForShift(5000);
        claimSpinTicket();
      until tabBackpack.isFull() or (mineTimer.getTime() > 30000);
    end;
    
    procedure tpToPortSarim();
    var
      pathToDepositBox: TPointArray;
      p: TPoint;
    begin
      if not isLoggedIn() Then
        exit;
      repeat
        lodestoneScreen.teleportTo(LOCATION_PORT_SARIM);
        wait(randomRange(16000, 19000));
    
      until (not isLoggedIn()) or minimap.findSymbol(p,MM_SYMBOL_SHOP_FISHING, minimap.getBounds());
    
       pathToDepositBox := [[212, 224], [247, 222], [278, 207], [279, 171], [281, 136], [326, 134], [369, 137]];
    
      if SPS.walkPath(pathToDepositBox) Then
        minimap.waitPlayerMoving()
      else
        writeLn('We failed to walk to the deposit box =(');
    end;
    
    procedure depositClay();
    var
      bankTimer: TTimeMarker;
    
    begin
      if not isLoggedIn() then
        exit;
    
      if depositBox.isOpen() then
      begin
    
        bankTimer.start();
    
        repeat
          if (depositBox.count > 0) then
          begin
            depositBox.quickDeposit(QUICK_DEPOSITBOX_INVENTORY);
            wait(gaussRangeInt(500, 750));
          end;
        until(depositBox.isEmpty()) or (not isLoggedIn()) or (bankTimer.getTime() > 10000);
    
      end;
    
      depositBox.close();
    
    end;
    
    procedure findDepositBox();
    var
      x, y, i: Integer;
    begin
      if not isLoggedIn() Then
        exit;
      repeat
        mainscreen.findObject(x, y, 4411742, 7, colorSetting(2, 0.22, 1.75), mainscreen.playerPoint, 30, 50, 50, ['eposit', 'box'], MOUSE_LEFT); // 4872552, 5, colorSetting(2, 1.50, 0.34)
        wait(randomRange(1000, 2500));
        inc(i);
      until depositBox.isOpen() or (i >= 15);
    end;
    
    // main loop
    begin
      clearDebug();               // Clear the debug box
      smartEnableDrawing := true; // So we can draw on SMART
      setupSRL();                   // Load the SRL include files
      declarePlayers();             // Set up your username/pass
    
      //SPS.setup('PORT_SARIM', RUNESCAPE_OTHER); // My SPS Map for Clay
      SPS.setup('PORT_SARIM_MAP', RUNESCAPE_OTHER); // My SPS Map for Clay
      repeat
        if not isLoggedIn() then             // If player isn't logged in then
      begin
        players[currentPlayer].login();   // Log them in
        exitTreasure();            // Exit treasure hunter
        minimap.setAngle(MM_DIRECTION_NORTH);  // Make compass north and angle high
        mainScreen.setAngle(MS_ANGLE_HIGH);
      end;
      if tabBackpack.isFull() then
       begin
        tpToPortSarim();
        findDepositBox();
        depositClay();
       end;
    
        tpToVarrock();
        runToClay();
        mineRocks();
       until(false);
    end.

  2. #2
    Join Date
    Oct 2016
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Oh and, if anyone can help please make a example of how u would fix it / make it

    Ty in advance.

  3. #3
    Join Date
    Mar 2013
    Posts
    1,010
    Mentioned
    35 Post(s)
    Quoted
    620 Post(s)

    Default

    The treasure hunter box is breaking the func, hide/move it somewhere else.
    #slack4admin2016
    <slacky> I will build a wall
    <slacky> I will ban reflection and OGL hooking until we know what the hell is going on

  4. #4
    Join Date
    Oct 2016
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Harrier View Post
    The treasure hunter box is breaking the func, hide/move it somewhere else.
    Ty will try it straight away

  5. #5
    Join Date
    Oct 2016
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    5bYEgq5.png

    so i tried but its still not going to the correct point
    I won't quit but im close to .. xD so fkin annoying i've been messing around with it since yesterday and it just won't work..

  6. #6
    Join Date
    Oct 2016
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Angry Troll Hunting Script.

    Code:
    program scriptTemplate;
    
    {$DEFINE SMART}              // Always have this to load smart
    {$I SRL-6/SRL.simba}         // To load the SRL include files
    {$I SPS/lib/SPS-RS3.Simba}   // To load the SPS include files
    
    procedure declarePlayers();
    begin
      setLength(players, 1);
      with players[0] do
      begin
        loginName := 'username';
        password := 'password';
        isActive := true;
        isMember := true;
      end
      currentPlayer := 0;
    end;
    
    procedure tpToBurthorpe();
    var
     p: TPoint;
    begin
    if not isLoggedIn() Then
        exit;
      repeat
        lodestoneScreen.teleportTo(LOCATION_BURTHORPE);
        wait(randomRange(14500, 16000));
    
      until (not isLoggedIn());
    end;
    
    procedure walkToTrolls();
    var
      pathToTrolls: TPointArray;
      x, y: Integer;
      pathToSpot: TPointArray;
    begin
      if not isLoggedIn() Then
        exit;
    
      pathToTrolls := [[193, 212], [165, 207], [153, 196], [132, 176], [112, 163], [109, 143], [107, 119], [113, 94]];
    
      if SPS.walkPath(pathToTrolls) Then
        minimap.waitPlayerMoving()
        else
        writeLn('We failed to walk to decided point. :(');
        mainscreen.findObject(x, y, 8092787, 12, colorSetting(2, 3.63, 0.24), mainscreen.playerPoint, 30, 50, 50, ['Cave', 'ave', 'av'], MOUSE_LEFT);
    
        pathToSpot := [[132, 220], [133, 177], [136, 136], [152, 95], [134, 51]];
    end;
    
    procedure killTrolls();
    var
      x, y, i: Integer;
    
    begin
    
      repeat
        if FindColorspiralTolerance(x, y, 5605002, 0, 0, 575, 385, 16) then
    
       begin
         if isMouseOverText(['Attack', 'Att'], 500) Then
          Begin
           fastClick(MOUSE_LEFT);
            smartImage.clear;
           break;
          end;
         end;
        claimSpinTicket();
       wait(randomRange(1000, 2000));
      until(false);
    end;
    
    procedure lootBronzeStuff();
    begin
      // code here (Possibly making this)
    end;
    
    // main loop
    begin
      clearDebug();               // Clear the debug box
      smartEnableDrawing := true; // So we can draw on SMART
      setupSRL();                   // Load the SRL include files
      declarePlayers();             // Set up your username/pass
      SPS.setup('BURTHORPE_MAP', RUNESCAPE_OTHER); // My SPS MAP
      SPS.setup('TROLL_CAVE_BURTHORPE', RUNESCAPE_OTHER);
      if not isLoggedIn() then             // If player isn't logged in then
      begin
        players[currentPlayer].login();   // Log them in
        exitTreasure();            // Exit treasure hunter
        minimap.setAngle(MM_DIRECTION_NORTH);  // Make compass north and angle high
        mainScreen.setAngle(MS_ANGLE_HIGH);
      end;
    
      TpToBurthorpe();
      walkToTrolls();
      killTrolls();
    end.

    This is my troll hunting script all it does is it keeps teleporting to Burthorpe.. except now nothing works after i've tried to make it into a 'complete' script ... Simba just fkin hates me aight?

    This is what happens over & over & over .. http://i.imgur.com/TMtgXvq.gifv <- GIF file (mini video) showing what happens over & over..


    - Dequality.

  7. #7
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    You're loading two maps into one variable. Your 'BURTHORPE_MAP' is getting overwritten.
    Rather than use the predefined 'sps' variable, just make your own:
    Simba Code:
    var
      burth, cave: TSPSArea;
    ...

    burth.setup(..);
    cave.setup(..);
    ...

    burth.walkPath();
    etc.

    You should be using a lot more checks, e.g.
    Simba Code:
    if walkToCave() then
      if enterCave() then
        if walkToTrolls() then
          killTrolls();
    This applies to the code inside each function as well.
    Last edited by Citrus; 10-23-2016 at 12:11 PM.

  8. #8
    Join Date
    Oct 2016
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Citrus View Post
    You're loading two maps into one variable. Your 'BURTHORPE_MAP' is getting overwritten.
    Rather than use the predefined 'sps' variable, just make your own:
    Simba Code:
    var
      burth, cave: TSPSArea;
    ...

    burth.setup(..);
    cave.setup(..);
    ...

    burth.walkPath();
    etc.

    You should be using a lot more checks, e.g.
    Simba Code:
    if walkToCave() then
      if enterCave() then
        if walkToTrolls() then
          killTrolls();
    This applies to the code inside each function as well.
    Kinda confused with the map variable what should be inside the ()? Is it burth.Setup("BURTHORPE_MAP", RUNESCAPE_OTHER)?
    Kinda confused

  9. #9
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Quote Originally Posted by Dequality View Post
    Kinda confused with the map variable what should be inside the ()? Is it burth.Setup("BURTHORPE_MAP", RUNESCAPE_OTHER)?
    The TSPSArea variables should be global. The setup shouldn't change; just replace 'sps' with 'burth' or whatever you want to call your variable.

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
  •