Results 1 to 21 of 21

Thread: Result := True

  1. #1
    Join Date
    May 2012
    Posts
    704
    Mentioned
    4 Post(s)
    Quoted
    147 Post(s)

    Default Result := True

    So I'm using ACA to find colors and the same code as in this thread. But something fails.

    My Function for Finding Furnace.
    Simba Code:
    Function FindFurnace(var x,y:Integer):boolean;
    var
      a:Integer;
      TPA:TPointArray;
      ATPA:T2DPointArray;
      MP:TPoint;
      tmpCTS:Integer;
      Box,SearchArea:TBox;
    begin
      if not LoggedIn then Exit;
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.15,1.38);
      SearchArea := IntToBox((MSCX - 200),(MSCY - 100),(MSCX),(MSCY + 150));
      SMART_DrawBoxEx(True,SearchArea,clPurple);
      FindColorsSpiralTolerance(MSCX,MSCY,TPA,3158066,MSCX -200,MSCY - 100 ,MSCX,MSCY + 150,9);
      SortTPAFrom(TPA,point(MSCX,MSCY));
      ATPA := TPAtoATPAEx(TPA,15,15);
      for a := 0 to High(ATPA) do
      begin
        MP := MiddleTPA(ATPA[a]);
        Box := IntToBox((MP.x - 20),(MP.y - 20),(MP.x + 20),(MP.y + 20));
        SMART_DrawBoxEx(True,Box,clYellow);
        MMouse(MP.x,MP.y,4,4);
        if(WaitUpText('rnace',1000))then
            begin
          x := MP.x; y := MP.y;
          Result := True
          SMART_ClearCanvas;
          Exit;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2,0.2);
    end;

    [Error] C:\Simba\Scripts\ProgressINSCrafter.simba(165:19): Unknown identifier 'x' at line 164
    Compiling failed.

    That is at my procedure for crafting ammys
    Simba Code:
    Procedure CraftDemAmmys;
    var
      TheRoad:TPointArray;
    begin
      SPS_Setup(RUNESCAPE_SURFACE,['12_9']);
      TheRoad := [Point(111, 396), Point(139, 383), Point(148, 345), Point(134, 320)];
      SPS_WalkPath(TheRoad);
      InvMouse(1,1);
      if (FindFurnace(x,y)), then
      begin
      If WaitColor(137, 228, 3358280, 0, 5000); then
      Mouse(32490324, 329034, 5, 5, True);
    end;

    Error is

    Simba Code:
    if (FindFurnace(x,y)), then

    wat do?

  2. #2
    Join Date
    Oct 2011
    Posts
    805
    Mentioned
    21 Post(s)
    Quoted
    152 Post(s)

  3. #3
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    Simba Code:
    var
      X, Y: Integer;
      TheRoad:TPointArray;
    begin
      SPS_Setup(RUNESCAPE_SURFACE,['12_9']);
      TheRoad := [Point(111, 396), Point(139, 383), Point(148, 345), Point(134, 320)];
      SPS_WalkPath(TheRoad);
      InvMouse(1,1);
      if (FindFurnace(x,y)), then
      begin
      If WaitColor(137, 228, 3358280, 0, 5000); then
      Mouse(32490324, 329034, 5, 5, True);
    end;
    Oh Hai Dar

  4. #4
    Join Date
    May 2012
    Posts
    704
    Mentioned
    4 Post(s)
    Quoted
    147 Post(s)

    Default

    Thank you very much guys.
    Now, I'm running into another problem which involves Progress Report

    Simba Code:
    Procedure ProgressReport;
    var
      XpH, AmmyCount, AmmysH:integer;
    begin
      XpH := round((Crafting_XP) / (GetTimeRunning / 360000.0));
      AmmyCount := round((Crafting_XP) / (30));
      AmmysH := round((AmmyCount) / (GetTimeRunning / 360000.0));
      ClearDebug;
      WriteLn('+-+-+-+-+-+-+ INS Crafter +-+-+-+-+-+-+');
      WriteLn('Time Running' +TimeRunning);
      WriteLn('XP Gained' +IntToStr(Crafting_XP));
      WriteLn('XP Per Hour' +IntToStr(XpH));
      WriteLn('Gold Ammys Crafted' +IntToStr(AmmyCount));
      WriteLn('Gold Ammys/h' +IntToStr(AmmysH));
      WriteLn('+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+');
    end;

    [Error] C:\Simba\Scripts\ProgressINSCrafter.simba(172:1): Identifier expected at line 171
    Compiling failed.

    That's
    Simba Code:
    Procedure ProgressReport;

    wat do now?

  5. #5
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Maybe you missed an end or begin before that procedure.

  6. #6
    Join Date
    May 2012
    Posts
    704
    Mentioned
    4 Post(s)
    Quoted
    147 Post(s)

    Default

    Quote Originally Posted by CephaXz View Post
    Maybe you missed an end or begin before that procedure.
    This. Thank you mate.

    Simba Code:
    Procedure MainLoop;
    var
      x,y:integer;
    begin
      FindingBank(x,y);
      Repeat
      WalkToFurnace;
      WalkToBank;
      CraftDemAmmys;
    end.

    [Error] C:\Simba\Scripts\ProgressINSCrafter.simba(199:1): Identifier expected at line 198
    Compiling failed.

    line 198
    Simba Code:
    end.

  7. #7
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Simba Code:
    Procedure MainLoop;
    var
      x,y:integer;
    begin
      FindingBank(x,y);
      Repeat // every repeat needs an until
        WalkToFurnace;
        WalkToBank;
        CraftDemAmmys;
      until(false); //maybe until(InvFull) ?
    end.
    Working on: Tithe Farmer

  8. #8
    Join Date
    May 2012
    Posts
    704
    Mentioned
    4 Post(s)
    Quoted
    147 Post(s)

    Default

    Quote Originally Posted by masterBB View Post
    Simba Code:
    Procedure MainLoop;
    var
      x,y:integer;
    begin
      FindingBank(x,y);
      Repeat // every repeat needs an until
        WalkToFurnace;
        WalkToBank;
        CraftDemAmmys;
      until(false); //maybe until(InvFull) ?
    end.
    Thank you, mate!

    Now I get this

    Simba Code:
    Procedure MainLoop;
    var
      x,y:integer;
    begin
      FindingBank(x,y);
      Repeat
        WalkToFurnace;
        WalkToBank;
        CraftDemAmmys;
      until(AllPlayersInactive);
    end.

    [Error] C:\Simba\Scripts\ProgressINSCrafter.simba(200:4): Semicolon (';') expected at line 199
    Compiling failed.

    line 199
    Simba Code:
    end.

  9. #9
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    The end should not end with a fullstop (.), should be a semicolon ( ; )

    You put all your mainloop into a procedure. So at the end of your script, you should have

    Simba Code:
    begin
      Mainloop;
    end.

    Which is not a procedure.
    Last edited by CephaXz; 05-26-2012 at 05:23 PM.

  10. #10
    Join Date
    May 2012
    Posts
    704
    Mentioned
    4 Post(s)
    Quoted
    147 Post(s)

    Default

    Quote Originally Posted by CephaXz View Post
    The end should not end with a fullstop (.), should be a semicolon ( ; )
    I know, but if I do it with a semicolon and then put end with a fullstop after, it says

    [Error] C:\Simba\Scripts\ProgressINSCrafter.simba(201:1): 'BEGIN' expected at line 200
    Compiling failed.

    :SSS

  11. #11
    Join Date
    Oct 2011
    Posts
    805
    Mentioned
    21 Post(s)
    Quoted
    152 Post(s)

    Default

    Simba Code:
    Procedure MainLoop; // this is procedure named MainLoop
    var
      x,y:integer;
    begin
      FindingBank(x,y);
      Repeat
        WalkToFurnace;
        WalkToBank;
        CraftDemAmmys;
      until(AllPlayersInactive)
    end; // on the end of procedure is ;

    begin  // this is "real" mainloop
      MainLoop;
    end.  // on the end you put dot

  12. #12
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sorry, just edited, read the post I edited.

    EDIT: Ninja-ed.

  13. #13
    Join Date
    May 2012
    Posts
    704
    Mentioned
    4 Post(s)
    Quoted
    147 Post(s)

    Default

    Quote Originally Posted by beginner5 View Post
    Simba Code:
    Procedure MainLoop; // this is procedure named MainLoop
    var
      x,y:integer;
    begin
      FindingBank(x,y);
      Repeat
        WalkToFurnace;
        WalkToBank;
        CraftDemAmmys;
      until(AllPlayersInactive)
    end; // on the end of procedure is ;

    begin  // this is "real" mainloop
      MainLoop;
    end.  // on the end you put dot
    Thank you !

    Holy hell, this programming stuff isn't that easy.
    Everything seems fine now, but when I ran, it said "Succesfully executed" and closed the same second.

    Okay, re-ran it.

    There are more errors going on, but I will try to figure them out myself. I think I should try to fix something itself instead asking you guys to do it.
    Last edited by Im New Sry; 05-26-2012 at 05:35 PM.

  14. #14
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Should post the whole script here, easier for us to spot whats wrong

  15. #15
    Join Date
    Oct 2011
    Posts
    805
    Mentioned
    21 Post(s)
    Quoted
    152 Post(s)

    Default

    Quote Originally Posted by CephaXz View Post
    Should post the whole script here, easier for us to spot whats wrong
    This.

    Everything seems fine now, but when I ran, it said "Succesfully executed" and closed the same second.
    Whole Simba closed?

    Propably u have SMART defined , but you didn't call (run) it.
    Simba Code:
    procedure start;
    begin
      Smart_Server := 10;
      Smart_Members := True;
      Smart_Signed := True;
      Smart_SuperDetail := False;
      SetupSRL;
    end;

  16. #16
    Join Date
    May 2012
    Posts
    704
    Mentioned
    4 Post(s)
    Quoted
    147 Post(s)

    Default

    Simba Code:
    program INSCrafter;
    {$DEFINE SMART}
    {$i SRL/srl.simba}
    {$i sps/SPS.simba}
    {$i srl/srl/misc/paintsmart.simba}

    var
       GoldBarDTM, GoldAmmyDTM, AmmyCraftDTM, Crafting_XP:integer;

    Procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0; // if you want to use the details which you enter below.

      Players[0].Name := ''; // your player's name
      Players[0].Pass := ''; // your player's password
      Players[0].Pin := ''; // your player's bank pin
      Players[0].BoxRewards := ['amp', 'owledg'];
      Players[0].Active := True; // set to false if you don't want to use player 0
      Players[0].LampSkill := SKILL_CRAFTING; // edit to any skill you want
    end;

    Procedure Start;
    begin
      ClearDebug;
      Smart_Server := 0;
      Smart_Members := False
      Smart_Signed := True
      Smart_SuperDetail := False
      SetupSRL;
      DeclarePlayers;
      LoginPlayer;
    end;

    Procedure LoadDTMs;
    begin
      GoldBarDTM := DTMFromString('mbQAAAHicY2VgYFBnYWDQBmIzINYAYnkgnsPEwLAciGcD8WQgXgLE0R48QNVMDNdWyTEsbBBjsDXgYMAGGLFgMAAAJz4ICA==');
      GoldAmmyDTM := DTMFromString('mbQAAAHicY2VgYAhiYWDwA+JwIA4DYl8gnsXEwDAPiqcD8TQgrqwXZDh+VIYhMoKHITaGl2HmdFEGbIARCwYDAMdSCj8=');
      AmmyCraftDTM := DTMFromString('mggAAAHicY2NgYOBgYWDgBWJuIGYBYmYgZgfiDUwMDGuBeCsQb4KyVwPx9oPSDAvmiTFsXC/B8Oq5AsODu/IMO7dLMeACjDgwBAAALYUOMQ==');
    end;

    Procedure FreeDaDTMs;
    begin
      FreeDTM(GoldBarDTM);
      FreeDTM(GoldAmmyDTM);
      FreeDTM(AmmyCraftDTM);
    end;

    Procedure WalkToBank;
    var
      myPath:TPointArray;
    begin
      SPS_Setup(RUNESCAPE_SURFACE,['12_9']);
      myPath := [Point(132, 318), Point(159, 330), Point(141, 367), Point(114, 397)];
      SPS_WalkPath(myPath);
      repeat
        wait(300);
      until(Not IsMoving);
    end;

    Procedure WalkToFurnace;
    var
      myPath:TPointArray;
    begin
      SPS_Setup(RUNESCAPE_SURFACE,['12_9']);
      myPath := [Point(111, 396), Point(139, 383), Point(148, 345), Point(134, 320)];
      SPS_WalkPath(myPath);
      repeat
        wait(300);
      until(Not IsMoving);
    end;

    Function FindingBank(var x,y:Integer):boolean;
    var
      a:Integer;
      TPA:TPointArray;
      ATPA:T2DPointArray;
      MP:TPoint;
      tmpCTS:Integer;
      Box,SearchArea:TBox;
    begin
        if not LoggedIn then Exit;
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.03,3.82);
      SearchArea := IntToBox((MSCX - 200),(MSCY - 100),(MSCX),(MSCY + 150));
      SMART_DrawBoxEx(True,SearchArea,clPurple);
        FindColorsSpiralTolerance(MSCX,MSCY,TPA,10143726,MSCX -200,MSCY - 100 ,MSCX,MSCY + 150,9);
        SortTPAFrom(TPA,point(MSCX,MSCY));
        ATPA := TPAtoATPAEx(TPA,15,15);
        for a := 0 to High(ATPA) do
      begin
        MP := MiddleTPA(ATPA[a]);
        Box := IntToBox((MP.x - 20),(MP.y - 20),(MP.x + 20),(MP.y + 20));
        SMART_DrawBoxEx(True,Box,clYellow);
        MMouse(MP.x,MP.y,4,4);
        if(WaitUpText('ooth',1000))then
        begin
          x := MP.x; y := MP.y;
          Result := True
          Mouse(x,y,1,1,1);
          if(WaitFunc(@BankScreen,10,4000)) then
          begin
            DepositAll;
            MouseBankSlot(1, mouse_Right);
            WaitOption('ithdraw-All', 500)
            SMART_ClearCanvas;
            Exit;
          end;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2,0.2);
    end;

    Function FindFurnace(var x,y:Integer):boolean;
    var
      a:Integer;
      TPA:TPointArray;
      ATPA:T2DPointArray;
      MP:TPoint;
      tmpCTS:Integer;
      Box,SearchArea:TBox;
    begin
      if not LoggedIn then Exit;
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.15,1.38);
      SearchArea := IntToBox((MSCX - 200),(MSCY - 100),(MSCX),(MSCY + 150));
      SMART_DrawBoxEx(True,SearchArea,clPurple);
      FindColorsSpiralTolerance(MSCX,MSCY,TPA,3158066,MSCX -200,MSCY - 100 ,MSCX,MSCY + 150,9);
      SortTPAFrom(TPA,point(MSCX,MSCY));
      ATPA := TPAtoATPAEx(TPA,15,15);
      for a := 0 to High(ATPA) do
      begin
        MP := MiddleTPA(ATPA[a]);
        Box := IntToBox((MP.x - 20),(MP.y - 20),(MP.x + 20),(MP.y + 20));
        SMART_DrawBoxEx(True,Box,clYellow);
        MMouse(MP.x,MP.y,4,4);
        if(WaitUpText('rnace',1000))then
            begin
          x := MP.x; y := MP.y;
          Result := True
          SMART_ClearCanvas;
          Exit;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2,0.2);
    end;

    Procedure CraftDemAmmys;
    var
      x,y:integer;
      TheRoad:TPointArray;
    begin
      SPS_Setup(RUNESCAPE_SURFACE,['12_8','12_9','12_10']);
      TheRoad := [Point(111, 396), Point(139, 383), Point(148, 345), Point(134, 320)];
      SPS_WalkPath(TheRoad);
      InvMouse(1,1);
      if (FindFurnace(x,y)) then
      begin
      If WaitColor(137, 228, 3358280, 0, 5000) then
      Mouse(32490324, 329034, 5, 5, True);
      end;
    end;

    Procedure ProgressReport;
    var
      XpH, AmmyCount, AmmysH:integer;
    begin
      XpH := round((Crafting_XP) / (GetTimeRunning / 360000.0));
      AmmyCount := round((Crafting_XP) / (30));
      AmmysH := round((AmmyCount) / (GetTimeRunning / 360000.0));
      ClearDebug;
      WriteLn('+-+-+-+-+-+-+ INS Crafter +-+-+-+-+-+-+');
      WriteLn('Time Running' +TimeRunning);
      WriteLn('XP Gained' +IntToStr(Crafting_XP));
      WriteLn('XP Per Hour' +IntToStr(XpH));
      WriteLn('Gold Ammys Crafted' +IntToStr(AmmyCount));
      WriteLn('Gold Ammys/h' +IntToStr(AmmysH));
      WriteLn('+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+');
    end;

    Procedure MainLoop;
    var
      x,y:integer;
    begin
      FindingBank(x,y);
      Repeat
        WalkToFurnace;
        WalkToBank;
        CraftDemAmmys;
      until(AllPlayersInactive);
      end;
      begin
      MainLoop;
    end.

    Error: Exception: Access violation at line 101

    Simba Code:
    function IsRealMouseInBox(B : TBox): Boolean;
    var
      P : TPoint;
    begin
      GetRealMousePos(P.X, P.Y);
      Result := PointInBox(P, B);
    end;

    problem with end;

    sorry for dumb questions, I'm really pretty new to all of this and I really want to start scripting.

  17. #17
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simba Code:
    Procedure MainLoop;
    var
      x,y:integer;
    begin
      FindingBank(x,y);
      Repeat
        WalkToFurnace;
        WalkToBank;
        CraftDemAmmys;
        ProgressReport; //Up to you where you want to put it, I put it here since you didnt include in your procedure
      until(AllPlayersInactive);
    end;

    begin
      Start;
      LoadDTMs;
      AddOnTerminate('FreeDaDTMs');
      Mainloop;
    end.

    Not sure if there are anything else I missed. But for access violation 101 error, it always means you have problem with your java. Uninstall your java if you had java 7, and install java 6u32

  18. #18
    Join Date
    May 2012
    Posts
    704
    Mentioned
    4 Post(s)
    Quoted
    147 Post(s)

    Default

    It works!!! No freakin way! It launched... Holy hell... Thank you all very much! Although it will have so much bugs that... But anyway, thank you all, very much.

  19. #19
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Glad you had it working

  20. #20
    Join Date
    May 2012
    Posts
    704
    Mentioned
    4 Post(s)
    Quoted
    147 Post(s)

    Default

    Yeah, it just doesn't detect colors... Oh well, some more ACAing for me then!

  21. #21
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    If you need more help you can check this link:
    http://villavu.com/forum/showthread.php?t=82793

    A lot of errors you came across are on that list

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
  •