Results 1 to 3 of 3

Thread: Clicking Problem

  1. #1
    Join Date
    Jan 2012
    Posts
    522
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Clicking Problem

    Today I have tried many times to try to fix up my script which doesn't seem to mine but it hovers over the ore in which I select. It only hovers but doesn't click on it.

    Simba Code:
    1:
      begin
       MakeCompass('N');
       SetAngle(SRL_ANGLE_HIGH);
       Wait(250+random(500));

        FindNormalRandoms;
      if FindCopper(x, y) then
        begin
         MMouse(x, y, 0, 0);
         if IsUpText('ine') then
         Writeln('Found Ore');
         Wait(150+random(50));
         if IsUpText('ine') then
         Mouse(x, y, 5, 5, True);
         Wait(10+random(25));

         end else Writeln('Cannot Find Ore');
         repeat
         until(InvFull);
    Previously known as "Phyaskou"

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

    Default

    Oh boy skippy, I love these issues!

    this is basically what you've got, but indented "correctly"
    Simba Code:
    begin
      MakeCompass('N');
      SetAngle(SRL_ANGLE_HIGH);
      Wait(250+random(500));

      FindNormalRandoms;
      if FindCopper(x, y) then
      begin
        MMouse(x, y, 0, 0);
        if IsUpText('ine') then
          Writeln('Found Ore');
        Wait(150+random(50));
        if IsUpText('ine') then
          Mouse(x, y, 5, 5, True);
        Wait(10+random(25));

      end else Writeln('Cannot Find Ore');
      repeat
      until(InvFull);

    There are a few things wrong, which would explain your issues here.

    If you use an if..then statement, and you want to do several lines of stuff if that if..then statement is true, then you must use begins and ends.

    If you do that right, it'd probably look something like this:
    Simba Code:
    begin
      MakeCompass('N');
      SetAngle(SRL_ANGLE_HIGH);
      Wait(250+random(500));

      FindNormalRandoms;
      if FindCopper(x, y) then
      begin
        MMouse(x, y, 0, 0);
        if IsUpText('ine') then
        begin
          Writeln('Found Ore');
          Wait(150+random(50));
          if IsUpText('ine') then
          begin
            Mouse(x, y, 5, 5, True);
            Wait(10+random(25));
          end;
        end;
      end else
      begin
        Writeln('Cannot Find Ore');
      end;

      repeat
      until(InvFull);

    Now, debugging time!

    Simba Code:
    begin
      MakeCompass('N');
      SetAngle(SRL_ANGLE_HIGH);
      Wait(250+random(500));

      FindNormalRandoms;
      if FindCopper(x, y) then
      begin
        writeln('FindCopper Resulted true!');
        MMouse(x, y, 0, 0);
        if IsUpText('ine') then
        begin
          Writeln('FindCopper resulted true, and the uptext is a match!');
          Wait(150+random(50));
          if IsUpText('ine') then
          begin
            writeln('FindCopper resulted true, the uptext is a match, and (for some reason we checked again, but we don''t need to) the uptext check still matches!');
            Mouse(x, y, 5, 5, True);
            Wait(10+random(25));
          end;
        end;
      end else
      begin
        Writeln('Cannot Find Ore');
      end;

      repeat
      until(InvFull);

    using this, you can figure out where it's going "wrong"

    Basically, each line will only be written IF the if..then is true - which means, if it isn't there's your issue.

    So, if the debug were to say this:
    Progress Report:
    FindCopper Resulted true!
    and nothing else, that means that the uptext didn't match.

    Also, you check the uptext twice, when you don't need to.
    Also, clickmouse2(x,y,mouse_left) will leftclick right where the mouse is (so you don't move it)

  3. #3
    Join Date
    Jan 2012
    Posts
    522
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by nickrules View Post
    Oh boy skippy, I love these issues!

    this is basically what you've got, but indented "correctly"
    Simba Code:
    begin
      MakeCompass('N');
      SetAngle(SRL_ANGLE_HIGH);
      Wait(250+random(500));

      FindNormalRandoms;
      if FindCopper(x, y) then
      begin
        MMouse(x, y, 0, 0);
        if IsUpText('ine') then
          Writeln('Found Ore');
        Wait(150+random(50));
        if IsUpText('ine') then
          Mouse(x, y, 5, 5, True);
        Wait(10+random(25));

      end else Writeln('Cannot Find Ore');
      repeat
      until(InvFull);

    There are a few things wrong, which would explain your issues here.

    If you use an if..then statement, and you want to do several lines of stuff if that if..then statement is true, then you must use begins and ends.

    If you do that right, it'd probably look something like this:
    Simba Code:
    begin
      MakeCompass('N');
      SetAngle(SRL_ANGLE_HIGH);
      Wait(250+random(500));

      FindNormalRandoms;
      if FindCopper(x, y) then
      begin
        MMouse(x, y, 0, 0);
        if IsUpText('ine') then
        begin
          Writeln('Found Ore');
          Wait(150+random(50));
          if IsUpText('ine') then
          begin
            Mouse(x, y, 5, 5, True);
            Wait(10+random(25));
          end;
        end;
      end else
      begin
        Writeln('Cannot Find Ore');
      end;

      repeat
      until(InvFull);

    Now, debugging time!

    Simba Code:
    begin
      MakeCompass('N');
      SetAngle(SRL_ANGLE_HIGH);
      Wait(250+random(500));

      FindNormalRandoms;
      if FindCopper(x, y) then
      begin
        writeln('FindCopper Resulted true!');
        MMouse(x, y, 0, 0);
        if IsUpText('ine') then
        begin
          Writeln('FindCopper resulted true, and the uptext is a match!');
          Wait(150+random(50));
          if IsUpText('ine') then
          begin
            writeln('FindCopper resulted true, the uptext is a match, and (for some reason we checked again, but we don''t need to) the uptext check still matches!');
            Mouse(x, y, 5, 5, True);
            Wait(10+random(25));
          end;
        end;
      end else
      begin
        Writeln('Cannot Find Ore');
      end;

      repeat
      until(InvFull);

    using this, you can figure out where it's going "wrong"

    Basically, each line will only be written IF the if..then is true - which means, if it isn't there's your issue.

    So, if the debug were to say this:
    Progress Report:
    FindCopper Resulted true!
    and nothing else, that means that the uptext didn't match.

    Also, you check the uptext twice, when you don't need to.
    Also, clickmouse2(x,y,mouse_left) will leftclick right where the mouse is (so you don't move it)
    No wonder....I totally forgot about that
    Rep+
    Previously known as "Phyaskou"

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
  •