Results 1 to 3 of 3

Thread: Double Click bug!

  1. #1
    Join Date
    Mar 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Double Click bug!

    My Script is Double clicking when i want it to click once. I am fairly new so my script is sloppy.

    Code:
    program XenoFighter;
    
    {.include SRL/SRL.scar}
    {.include srl/srl/Skill/Fighting.scar}
    
    var
     x, y, cx, cy: Integer;
    
     MonsterColor : Array [0..2] of Integer;
     i :Integer;
    
    {*******////Setup\\\\********}
    
    Procedure Setup;
     begin
       MonsterColor[0]:=1450142; //Color 1
       MonsterColor[1]:=1384347;  // Color 2
       MonsterColor[2]:=4772077;   //Color 3
     end;
    
    const
     MonsterName = 'hicken';  //Partial Name of monster
     WaitTime = 4000;
     RandomTime = 3000;
     
     {*******///End Setup\\\*******}
     
    
     Procedure KillMonster;
     begin
      for i:= 0 to 2 do
    
      begin
       if(FindColor(x, y, MonsterColor[i], 0,0, 511, 338))then
        begin
         MMouse(x, y, 2,2);
         wait(50+random(50));
         If(IsUpText(MonsterName))then
          begin
           GetmousePos(cx, cy);
           wait(100+random(100));
           Clickmouse(cx,cy, true);
    
    
          end;
        end;
      end;
     end;
    
    
    begin
    SetupSRL;
    Setup;
    
    repeat
    wait(WaitTime+random(RandomTime));
    KillMonster;
    until false;
    end.

  2. #2
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It is because for I := 0 to 2 will repeat that code twice. Just take out the for loop and it will only do it once.

    Also, ClickMouse is a BIG no no for Runescape. You had the right idea with MMouse to move the mouse, but to click, use:

    SCAR Code:
    Mouse(x,y,0,0,true);

    Instead of ClickMouse. the 0,0, are the randomness parameters on where to click, but in this case, you want them to be 0 so that it clicks the same spot you moved the mouse to.

    So just change KillMonster to:
    SCAR Code:
    Procedure KillMonster;
     begin
       if(FindColor(x, y, MonsterColor[i], 0,0, 511, 338))then
        begin
         MMouse(x, y, 2,2);
         wait(50+random(50));
         If(IsUpText(MonsterName))then
          begin
           GetmousePos(cx, cy);
           wait(100+random(100));
           Mouse(cx, cy, 0, 0, true);
          end;
        end;
     end;

  3. #3
    Join Date
    Mar 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you very much !!!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •