Help with hunting script

Discussion in 'Archives' started by elan, May 25, 2007.

Help with hunting script
  1. Unread #1 - May 25, 2007 at 3:26 PM
  2. elan
    Referrals:
    0

    elan Guest

    Help with hunting script

    Hey.
    I'm just a beginner in making SCAR scripts. But i tried to make a script.

    Code:
    program CombineExample1;
    
    var
    x,y: Integer;
    
    const
    MonsterColor1 = 2968917;
    MonsterColor2 = 5466738;
    MonsterColor3 = 8031148;
    
    begin
    if(FindColor(x,y,MonsterColor1,0,0,800,600))
    or(FindColor(x,y,MonsterColor2,0,0,800,600))
    or(FindColor(x,y,MonsterColor3,0,0,800,600))
    then
     begin
      MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
      Wait(100+random(10));
      ClickMouse(x,y,true);
     end;
    end.
    
    what it basically does now is that it looks for a colour on the Conquer Online screen and then clicks it. It works. But if there is no monster in the area, it just does nothing and i have to run the script again.

    What i want now is that it goes into a loop or something that it executes this script 1000 times. I also want this script to make me move somwhere else if it didnt find the color
    like: If findcolor blalbala
    then
    click on it
    else
    move to a random place on the screen and search again.

    Could you please help me?
     
  3. Unread #2 - May 25, 2007 at 3:32 PM
  4. Town
    Joined:
    Jan 21, 2007
    Posts:
    3,776
    Referrals:
    3
    Sythe Gold:
    5

    Town Grand Master
    Scar Programmers

    Help with hunting script

    Code:
    program CombineExample1;
    
    var
    x,y,i : Integer;
    
    const
    MonsterColor1 = 2968917;
    MonsterColor2 = 5466738;
    MonsterColor3 = 8031148;
    begin
    Whie(i < 1000) do
    begin
    if(FindColor(x,y,MonsterColor1,0,0,800,600))
    or(FindColor(x,y,MonsterColor2,0,0,800,600))
    or(FindColor(x,y,MonsterColor3,0,0,800,600))
    then
     begin
      MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
      Wait(100+random(10));
      ClickMouse(x,y,true);
     end;
     i := i + 1;
    end;
    end.
    Something like that.
     
  5. Unread #3 - May 26, 2007 at 12:00 AM
  6. Infantry001
    Joined:
    Mar 19, 2006
    Posts:
    90
    Referrals:
    0
    Sythe Gold:
    0

    Infantry001 Member

    Help with hunting script

    You can also use for..to..do loops.

    Code:
    program CombineExample1;
    
    var
    x,y,i,a,b: Integer;
    
    const
    MonsterColor1 = 2968917;
    MonsterColor2 = 5466738;
    MonsterColor3 = 8031148;
    
    begin
    for i := 1 to 1000 do
    begin
      Wait(10);
      if(FindColor(x,y,MonsterColor1,0,0,800,600))
      or(FindColor(x,y,MonsterColor2,0,0,800,600))
      or(FindColor(x,y,MonsterColor3,0,0,800,600))
      then
      begin
        MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
        Wait(100+random(10));
        ClickMouse(x,y,true);
      end else
      begin
        GetCLientDimensions(a,b);
        MoveMouseSmoothEx(Random(a),Random(b),20,40,45,25,20);
      end;
    end.
    And you wanted to move the mouse to a random area if you dont find the color? GetCLientDimensions gets the x,y coord of the last pixel in the client (known as the widht and length of client). THen, move the mouse to a random point in there (hence, the movemousesmoothex). Hope i helped!

    Btw, Town, put me on the list! lol
     
  7. Unread #4 - May 28, 2007 at 5:11 PM
  8. elan
    Referrals:
    0

    elan Guest

    Help with hunting script

    hey guys thanks for you help all :)
    But i got a new request... and i cant really figure it out.

    This is my code now:
    Code:
    program CombineExample1;
    
    var
    x,y,i,a,b: Integer;
    
    const
    MonsterColor1 = 1581148;
    MonsterColor2 = 1910091;
    SilverColor1 = 14079966;
    
    begin
    for i := 1 to 1000 do
    begin
      Wait(2500 + random(100));
      if(FindColor(x,y,MonsterColor1,0,0,800,600))
      or(FindColor(x,y,SilverColor1,0,0,800,600))
      or(FindColor(x,y,MonsterColor2,0,0,800,600))
      then
      begin
        MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
        Wait(100+random(10));
        ClickMouse(x,y,true);
      end else
      begin
        GetCLientDimensions(a,b);
        MoveMouseSmoothEx(Random(a),Random(b),20,40,45,25,20);
        ClickMouse(x,y,true);
      end;
      end;
    end.
    
    it checks if it finds colors of monster or money
    then clicks there
    if he doesnt find it, he moves a bit around

    but.. i can't go away from the computer now because my character can die.
    I want to make an function that whenever my HP is below 100 it must press f1 (hotkey for Food).
    This game, Conquer, has a health bar. So i thought that scar shud check at the point where your hp is 100, if the place is red or not red ( when its red he has over 100 hp).
    How should i do this?

    I also found the addresses for the health with cheat engine, but i dont really know how to use it with scar.
    Also sometimes there pops up a small window, which let's you walk faster. If it pops-up i want to click it. SHould i use bitmap for this??
    A lot of questions, i know:cool:

    well one last question, but it doesnt really ave anything to do with SCAR.
    I want to make my scar script into an executable program. Just like the auto-wood cutter of Sythe. that u can pick the colors , n then just click start. this way u dont have to open up scar and run the script.

    Thanks in advance :D ( sorry for my english, it's not my strongest point)
     
  9. Unread #5 - May 28, 2007 at 5:43 PM
  10. Town
    Joined:
    Jan 21, 2007
    Posts:
    3,776
    Referrals:
    3
    Sythe Gold:
    5

    Town Grand Master
    Scar Programmers

    Help with hunting script

    Sythe's Autowoodcutter is not made in Scar so to make a program like that, you would have to write it in C++ or Java or another language.

    Since it isn't in Runescape, you will have to use alot of Bitmaps.

    For the Healthbar question, use if (not (FindColor())). That will result true if it does not find the color you are looking for.

    This will help you too, http://wiki.srl-forums.com/index.php?title=Keyboard_Handling&direction=next&oldid=1917.
     
< sellin sms pin | Selling names!!! >

Users viewing this thread
1 guest


 
 
Adblock breaks this site