Results 1 to 9 of 9

Thread: Only do 1 thing from procedure?

  1. #1
    Join Date
    Nov 2011
    Location
    Netherlands
    Posts
    156
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default Only do 1 thing from procedure?

    I made a huge procedure.


    But it only do the CreateGateStoneDTM

    Anyone know how to fix?

    Simba Code:
    Procedure ClickMagebane;
    Begin
    MagebaneDTM := DTMFromString('mQwAAAHicY2ZgYHBnZmBwBmIXII5gZGCIBOJQIC7LqmLorZvE0FXdz8AKVAfDjEgYCAD+RgaB');
      GameTab(Tab_Inv);
      if FindDTM(MagebaneDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
      Begin
           wait(randomrange(500,600));
        MMouse(X, Y + 3, 0, 0);
          wait(randomrange(350,400));
          ClickMouse2(false);
            Writeln ('Found seed, Time to farm!')
            wait(randomrange(200,300));
             ChooseOption('Use');

          wait(randomrange(300, 350));

            FreeDTM(MagebaneDTM);

    end else
    begin
    writeln ('Not found Magebane seed, buying new seeds!')
          wait(randomrange(100,200));
       GameTab(Tab_Magic);
       wait(randomrange(100,200));

       CreateGatestoneDTM := DTMFromString('mbQAAAHicY2VgYAhmYmAIBGJfIPYE4jAgtmZkYDAGYisgtmWE8KX3z2IIeX2HQfb1MQbx2c1gzAzUj44ZsWAwAACvCAqg');
       if FindDTM(CreateGatestoneDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
      Begin
                MMouse(X, Y + 3, 0, 0);
         If WaitUptextMulti(['Create','Gatestone'], 500) Then
                Begin

                  ClickMouse2(true);
                    wait(randomrange(1000,1500));

                    GameTab(Tab_Inv);

                    wait(randomrange(500,600));



     DropGateStoneDTM := DTMFromString('mggAAAHicY2NgYFjIxMCwEojXA/FmIF4LpU0YGRjUgVgPiM2BWAOIjYBYy9yYwcnXkyFv2RQG+/hQBnFleQafiBAGVqBZ2DAjDgwBALD5Crs=');
       if FindDTM(DropGateStoneDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
      Begin
                MMouse(X, Y + 3, 0, 0);
           wait(randomrange(200,300));
            If WaitUptextMulti(['Gatestone'], 500) Then
                Begin
           ClickMouse2(false);
           wait(randomrange(100,150));
             ChooseOption('Drop');
                    wait(randomrange(1000,1500));




      HomeTeleportDTM := DTMFromString('mWAAAAHicY2FgYPBmYmDwQ8KcjAwMHEDMDMTcQBwbuJTBQSmZoSxuBphmBupBxoxoGAQALoIFvg==');
      if FindDTM(HomeTeleportDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
      Begin
               MMouse(X, Y + 3, 0, 0);
                If WaitUptextMulti(['Dungeon', 'Home','Teleport'], 500) Then
                Begin

                  ClickMouse2(true);
                    wait(randomrange(6000,7000));



     TradeTheSmuggler := DTMFromString('mbQAAAHicY2VgYNBiZGAwB2IVILaCsicCxacC8QIgXg7EW4G4o8iXoS7LnSHUz4AhLcyKoTw/gIEVKI6OGbFgMAAAiQAJtg==');
      if FindDTM(TradeTheSmuggler, x, y, MSX1, MSY1, MSX2, MSY2) then
      Begin
               MMouse(X, Y + 3, 0, 0);
                If WaitUptextMulti(['Talk','Smuggler'], 500) Then
                Begin

                  ClickMouse2(false);
                  wait(randomrange(300,400));
                       ChooseOption('Trade');
                    wait(randomrange(1500,2000));


                   MMouse(503,312+ 3, 0, 0);
                   wait(randomrange(100,150));
                   ClickMouse2(false);
                  wait(randomrange(100,150));



    BuyMagebaneSeeds := DTMFromString('mQwAAAHicY2ZgYHABYlcgdgTiQiAug+Ke2okMHVW9DIsnrWRgBfJhmBEJAwEAGvwHRA==');
    if FindDTM(BuyMagebaneSeeds, x, y, MSX1, MSY1, MSX2, MSY2) then
      Begin
               MMouse(X, Y + 3, 0, 0);

                  ClickMouse2(false);
                  wait(randomrange(300,400));
                       ChooseOption('Buy 250');
                    wait(randomrange(1500,2000));

                     MMouse(507,53+ 3, 0, 0);
                     wait(randomrange(100,200));
                     ClickMouse2(true);


                      GameTab(Tab_Magic);


      UseGateStoneTeleport := DTMFromString('mWAAAAHicY2FgYEhmYmBIB+J8IM4BYhNGBgZbILYAYkMgLms7y+DmfJAhTH86Q8+0kwzMQD3ImBENgwAAzH0Iug==');
     if FindDTM(UseGateStoneTeleport, x, y, MIX1, MIY1, MIX2, MIY2) then
      Begin
                MMouse(X, Y + 3, 0, 0);
         If WaitUptextMulti(['Gatestone','Teleport'], 500) Then
                Begin

                  ClickMouse2(true);
                    wait(randomrange(1500,2000));

                    GameTab(Tab_Inv);

                    wait(randomrange(500,600));

                     FreeDTM(CreateGatestoneDTM);
                    FreeDTM(DropGateStoneDTM);
                    FreeDTM(HomeTeleportDTM);
                    FreeDTM(TradeTheSmuggler);
                    FreeDTM(BuyMagebaneSeeds);
                    FreeDTM(UseGateStoneTeleport);

                 //Restart this procedure from start
                 wait(randomrange(500,600));

                 ClickMagebane;

        end;
          end;
          end;
          end;
          end;
          end;
          end;
           end;
           end;
           end;
           end;
           end;
          end;
    I was away for a long time, but i'm back!

  2. #2
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Turn all of those into functions and call them in the main loop.. Format your code to a better style so that it's readable.. then we can help u.

  3. #3
    Join Date
    Nov 2011
    Location
    Netherlands
    Posts
    156
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Ill try that, didnt think of it thanks

    Edit:

    Added all in procedures.

    Getting the following error:
    [Error] (455:3): Identifier expected at line 454

    Whats wrong??

    Simba Code:
    procedure MainLoop;
    begin
       repeat
               GameTab(Tab_Inv);
         if (not FindDTM(MagebaneDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
            begin
           CreateGateStone;
             DropGateStone;
             HomeTeleport;
              TradeSmuggler;
              BuyMagebanes;
              UseTheGatestone;
         end else
             begin
           ClickMagebane;
          UseOnFarming;
            wait(randomrange(2000,2100));
             AntiBan;
                wait(randomrange(1000,1100));
                ClearDebug; //ADDED CLEAR DEBUG
                wait(randomrange(200,300));
              ProgressReport;
              wait(randomrange(1000,1100));
           HarvestPatch;

         CleaningHerbs;

        repeat
           HighAlchItem;
           wait(randomrange(400,500));
            AlchingTheHerbs;


    until (not FindDTM(CleanHerbDTM, x, y, MIX1, MIY1, MIX2, MIY2));
    FreeDTM(HighAlchDTM);
    FreeDTM(CleanHerbDTM);
     AntiBan;
     GameTab(Tab_Inv);


      until(false);

          end;
    Last edited by bas; 04-30-2012 at 05:56 AM.
    I was away for a long time, but i'm back!

  4. #4
    Join Date
    Feb 2012
    Location
    DON'T PM ME ASKING FOR STUFF
    Posts
    2,170
    Mentioned
    38 Post(s)
    Quoted
    423 Post(s)

    Default

    Simba Code:
    program Helpedscript;

    {$i SRL\SRL.simba}
    {$i sps/sps.simba}
    {$i ObjectDTM\ObjDTMInclude.simba}
    {$i SRL/SRL/Misc/Debug.simba}

    procedure MainLoop;
    var
    x,y,magebaneDTM,CleanHerbDTM,HighAlchDTM : Integer;
    begin
    MagebaneDTM := DTMFromString('mQwAAAHicY2ZgYHBnZmBwBmIXII5gZGCIBOJQIC7LqmLorZvE0FXdz8AKVAfDjEgYCAD+RgaB');
    CleanHerbDTM := DTMFromString('mQwAAAHicY2ZgYHBnZmBwBmIXII5gZGCIBOJQIC7LqmLorZvE0FXdz8AKVAfDjEgYCAD+RgaB');
    HighAlchDTM := DTMFromString('mQwAAAHicY2ZgYHBnZmBwBmIXII5gZGCIBOJQIC7LqmLorZvE0FXdz8AKVAfDjEgYCAD+RgaB');
       repeat
               GameTab(Tab_Inv);
         if (not FindDTM(MagebaneDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
            begin
           //CreateGateStone;
             //DropGateStone;
             //HomeTeleport;
              //TradeSmuggler;
              //BuyMagebanes;
              //UseTheGatestone;
         end else
             begin
           //ClickMagebane;
          //UseOnFarming;
            wait(randomrange(2000,2100));
             //AntiBan;
                wait(randomrange(1000,1100));
                ClearDebug; //ADDED CLEAR DEBUG
                wait(randomrange(200,300));
              //ProgressReport;
              wait(randomrange(1000,1100));
           //HarvestPatch;

         //CleaningHerbs;
          end;
        repeat
           //HighAlchItem;
           wait(randomrange(400,500));
            //AlchingTheHerbs;


    until (not FindDTM(CleanHerbDTM, x, y, MIX1, MIY1, MIX2, MIY2));
    FreeDTM(HighAlchDTM);
    FreeDTM(CleanHerbDTM);
     //AntiBan;
     GameTab(Tab_Inv);
      until(false);
     end;


     begin
      MainLoop;
     end.

    every procedure i didn't have i //'d out. This compiles for me...

  5. #5
    Join Date
    Nov 2011
    Location
    Netherlands
    Posts
    156
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Can i PM you the whole script so u can see whats wrong???
    I dont get it lol
    I was away for a long time, but i'm back!

  6. #6
    Join Date
    Feb 2012
    Location
    DON'T PM ME ASKING FOR STUFF
    Posts
    2,170
    Mentioned
    38 Post(s)
    Quoted
    423 Post(s)

    Default

    Quote Originally Posted by kipjes bende View Post
    Can i PM you the whole script so u can see whats wrong???
    I dont get it lol
    go ahead but im on phone waiting for bus haha

  7. #7
    Join Date
    Nov 2011
    Location
    Netherlands
    Posts
    156
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Oh lol. PMing you in a sec
    I was away for a long time, but i'm back!

  8. #8
    Join Date
    May 2008
    Location
    ;)
    Posts
    576
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Use writeln's and if then statements to isolate the issue, like this:

    if not(finddtm(XY,blahblahblah... ) then
    writeln('DTM XYZ not found!');

    Odds are, you need DTMs with a higher tolerance

  9. #9
    Join Date
    Jun 2011
    Location
    Anywhere that has WIFI
    Posts
    669
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You do know that you can just have them setup a farming patch inside the main room right? Just destroy the group gatestone portal and choose build. Then you wouldn't need anything to do with a gatestone.

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
  •