• Log in or sign up for an account here: https://www.sythe.org/login

Help with hunting script

  • Thread starter Thread starter elan
  • Start date Start date
E

elan

Guest
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?
 
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.
 
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
 
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)
 
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.
 
Runescape Gamblingrunescape gambling
Back
Top