Results 1 to 6 of 6

Thread: Not Clicking

  1. #1
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default Not Clicking

    Simba Code:
    program KingsDragons;
    {$DEFINE SMART}
    {$i SRL/srl.simba}
    {$i SRL/SRL/skill/fighting.simba}
    {$i SRL/SRL/skill/magic.simba}
    {$i sps/sps.simba}

    var
      x, y, T, DTMHouse: integer;




    procedure DeclarePlayers;
    Begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      With Players[0] Do
      Begin
        Name        := '';     //Player username.
        Pass        := '';     //Player password.
        Nick        := ''; //Player nickname - 3-4 letters of Player username.
        Active      := True;
      end;

    end;

    procedure LoadDTMs;
      begin

       DTMHouse := DTMFromString('mWAAAAHicY2FgYLBhYmBwAGJnILYA4idAsZdA/AiI3wCxnoYBgwSrPEN32zGGrMgDDPxAMWTMiIZBAADlWQj7');

      end;

    procedure ReleaseDTMS;
      begin
        FreeDTM(DTMHouse);
      end;

    function TeleportToEdge:Boolean;
      begin
        writeln('Could not find bank, teleporting to Edgeville and walking to bank');
        wait(500+random(50));
        GameTab(tab_Magic);
        wait(1000+random(50));
        if FindDTM(DTMHouse, x, y, MIX1, MIY1, MIX2, MIY2) then
          begin
             Mouse(x, y, 0, 0, True);
          end else
            begin
              writeln('Could not find spell');
            end;
      end;

    function AtBank:Boolean;
      begin
        if FindSymbol(x, y, Symbol_Furnace) then
          begin
            Result:= True;
            writeln('Found the bank');
          end else
          begin
            Result:= False;
            writeln('We could not find the bank');
          end;
      end;


    function WalkToBank:Boolean;
      begin
        wait(250 + random(50));
          if TeleportToEdge then
          if not AtBank then
            begin
              MarkTime(T);
              repeat
                wait(50);
              until(AtBank or (TimeFromMark(T)>= 120000));
            end else
              begin
                TerminateScript;
              end;
      end;


    procedure MainLoop;
      begin
        if AtBank then
          begin
           // Banking;
          end else
          begin
            WalkToBank;
          end;
      end;
    procedure SetupChar;

    begin
    SetupSRL();
    SetupMagic();
    SetAngle(0);
    ClickNorth(0);
    end;


    procedure Startup;
    begin
      Smart_Server := 10;
      Smart_Members:= true;
      Smart_Signed := true;
      Smart_SuperDetail := false;
      SetupSRL;
      DeclarePlayers;
      LogInPlayer;
    end;

    begin
      Startup;
      SetupChar;
      MainLoop;
      ReleaseDTMS;
    end.

    Finds the DTM in the editor everytime but it says that it cannot find it in the client or in SMART, am I scripting something wrong? I am redoing my beginning of the GDK right now. Any help? (:

  2. #2
    Join Date
    May 2007
    Location
    England/Liverpool
    Posts
    1,004
    Mentioned
    9 Post(s)
    Quoted
    106 Post(s)

    Default

    Your not loading your DTM

    Also try to load and free your DTM in the same Function/procedure
    example:

    Simba Code:
    function TeleportToEdge:Boolean;
    begin
        DTMHouse := DTMFromString('mWAAAAHicY2FgYLBhYmBwAGJnILYA4idAsZdA/AiI3wCxnoYBgwSrPEN32zGGrMgDDPxAMWTMiIZBAADlWQj7');
        writeln('Could not find bank, teleporting to Edgeville and walking to bank');
        wait(500+random(50));
        GameTab(tab_Magic);
        wait(1000+random(50));
      if FindDTM(DTMHouse, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
        Mouse(x, y, 0, 0, True);
      end else
      begin
        writeln('Could not find spell');
        FreeDTM(DTMHouse);
      end;
    end;
    Last edited by Mark; 07-08-2012 at 07:54 PM.

  3. #3
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    Quote Originally Posted by CRU1Z1N View Post
    Your not loading your DTM

    Also try to load and free your DTM in the same Function/procedure
    example:

    Simba Code:
    function TeleportToEdge:Boolean;
    begin
        DTMHouse := DTMFromString('mWAAAAHicY2FgYLBhYmBwAGJnILYA4idAsZdA/AiI3wCxnoYBgwSrPEN32zGGrMgDDPxAMWTMiIZBAADlWQj7');
        writeln('Could not find bank, teleporting to Edgeville and walking to bank');
        wait(500+random(50));
        GameTab(tab_Magic);
        wait(1000+random(50));
      if FindDTM(DTMHouse, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
        Mouse(x, y, 0, 0, True);
      end else
      begin
        writeln('Could not find spell');
        FreeDTM(DTMHouse);
      end;
    end;

    Thankyou..I knew it was something stupid XD

  4. #4
    Join Date
    May 2007
    Location
    England/Liverpool
    Posts
    1,004
    Mentioned
    9 Post(s)
    Quoted
    106 Post(s)

    Default

    there is alot to improve in that just to give you an idea

  5. #5
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    If it's a small DTM, one that you won't use for extended periods of time. (Over twenty seconds), do it locally, or else make a procedure for calling all your DTMs, then another procedure to Free them all, Add the free one like this:
    Simba Code:
    addonterminate("FreeDTMz")
    So your DTMs always get freed

  6. #6
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    Simba Code:
    program KingsDragons;
    //{/$DEFINE SMART}
    {$i SRL/srl.simba}
    {$i SRL/SRL/skill/fighting.simba}
    {$i SRL/SRL/skill/magic.simba}
    {$i sps/sps.simba}


    const

      FoodType ='';//Enter the type of food to use here



    var
      x, y, T, DTMHouse, DTMEdgeville: integer;




    procedure DeclarePlayers;
    Begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      With Players[0] Do
      Begin
        Name        := '';     //Player username.
        Pass        := '';     //Player password.
        Nick        := ''; //Player nickname - 3-4 letters of Player username.
        Active      := True;
      end;

    end;

    procedure LoadDTMs;
      begin
       DTMHouse     := DTMFromString('mWAAAAHicY2FgYLBhYmBwAGJnILYA4idAsZdA/AiI3wCxnoYBgwSrPEN32zGGrMgDDPxAMWTMiIZBAADlWQj7');
       DTMEdgeville := DTMFromString('mrAAAAHic42BgYFBmhGBNINYGYg0glgNiKSieCVSzHIgXAvF0IJ4AxL1Q/hwgXrX9IMPUOYsZdDQ1GXQSEhlEDcIYHIvyGYLFpcAYH+AHYkYCGAYA98kONA==');
      end;

    procedure ReleaseDTMS;
      begin
        FreeDTM(DTMHouse);
        FreeDTM(DTMEdgeville);
      end;


    Function CheckForFood:Boolean;
      begin
        if IsUpText(FoodType) then
          begin
            result:= True;
          end else
            begin
              result:= False;
            end;
      end;

    function TeleportToEdge:Boolean;
      begin
        writeln('Could not find bank, teleporting to Edgeville and walking to bank');
        wait(500+random(50));
        GameTab(tab_Magic);
        wait(1000+random(50));
        if FindDTM(DTMHouse, x, y, MIX1, MIY1, MIX2, MIY2) then
          begin
             Mouse(x, y, 0, 0, True);
             wait(1200+random(200));
          end else
            begin
              writeln('Could not find spell');
            end;
               if FindDTM(DTMEdgeville, x, y, MSX1, MSY1, MSX2, MSY2) then
                  begin
             Mouse(x, y, 0, 0, True);
             if not FindSymbol(x, y, Symbol_Shop) then
              begin
                MarkTime(T)
                  repeat
                    wait(50);
                   until(FindSymbol(x, y, Symbol_Shop) or (TimeFromMark(T)>= 120000))
          end else
            begin
              writeln('Could not find location');
            end;
         end;
        end;

    function AtBank:Boolean;
      begin
        if FindSymbol(x, y, Symbol_Furnace) then
          begin
            Result:= True;
            writeln('Found the bank');
          end else
          begin
            Result:= False;
            writeln('We could not find the bank');
          end;
      end;


    function WalkToBank:Boolean;
      begin
        wait(250 + random(50));
          if TeleportToEdge then
          if not AtBank then
            begin
              MarkTime(T);
              repeat
                wait(50);
              until(AtBank or (TimeFromMark(T)>= 120000));
            end else
              begin
                TerminateScript;
              end;
      end;


    procedure MainLoop;
      begin
        if AtBank then
          begin
           // Banking;
          end else
          begin
            WalkToBank;
          end;
      end;
    procedure SetupChar;

    begin
    SetupSRL();
    SetupMagic();
    SetAngle(0);
    ClickNorth(0);
    LoadDTMs;
    end;


    procedure Startup;
    begin
      Smart_Server := 10;
      Smart_Members:= true;
      Smart_Signed := true;
      Smart_SuperDetail := false;
      SetupSRL;
      DeclarePlayers;
      LogInPlayer;
    end;

    begin
      Startup;
      SetupChar;
      MainLoop;
      addonterminate('ReleaseDTMS');
    end.

    This is what I have rewritten so far, I'm also using custom SPS maps for the walking and probably some TPAs to fight the dragons ect?

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
  •