Jump to content
infinitejl

How do I find a color, and then search for a different color in range.

Recommended Posts

Like title say.

 

lets take an example of blue and red.

 

I need my script to find the color blue, once it find that blue, it looks for a specific range (above it) and click the 2nd color (red).

example again:

 

botjc.png

 

 

now, i already made a script that click the monster itself (monster color is 12968173, you will see in script), problem is it click monster that look the same as him, but is lower level(level 2, and the regular one is level 3), so i don't gain exp and money, which really hurts the profit from my bot (i only attack one level 3 each 3-4 monsters because the map is packed with those damn lvl 2).

if it would've check the writing first, it would've find only the level 3 monster.

 

anyways, now i leveled, and this bot is going to be used in somewhere else, problem is, that now i am going to attack the level's 4, and there are levels 5 on the map, which isn't the same as attacking one monster below you, and ill probablly keep dying each time he will attack the level 5.

 

here is my script, might seems confusing because Scar is actually my first programming language.. and i keep quitting and coming back but become better each time lol...

 

http://pastebin.com/cs2UFaTC

 

 

 

 

if anyone could tip me on how to make my script easier to read, and tips for stuff that i probablly messed up (like, stuff i can delete from my bot and it will stay the same, or even better) It will be great.

 

 

 

oh and the script is working perfect, i left it for 3 days in a row so..

 

Thank you ^_^

Link to comment
Share on other sites

Tried it, had lot's of problem understanding how it works, But it's ok because before you answered i found the solution.

 

procedure monster;

var

huntx,hunty:integer;

x, y: Integer;

 

 

begin

if FindColor(x,y,65484,581, 249,1307, 965) then

begin

end;

if FindColor(huntx,hunty,12968173,x-50, y-50,x+50, y) then

begin

clickmouse(huntx,hunty,true);

clickmouse(huntx,hunty,true);

clickmouse(huntx,hunty,true);

wait(5000);

end;

end;

 

 

 

 

Thanks freddy.

Link to comment
Share on other sites

i think pastebin is good enough.. but:

 

 

[scar]

program Skeleton_warriors;

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

function Loc:integer;

var

locationx,locationy:integer;

huntx,hunty:integer;

battlex,battley:integer;

battlexx,battleyy:integer;

 

begin

if findcolor(locationx,locationy,12230849,1026, 184,1026, 184) then

begin

result := 1;

end else

if findcolor(huntx,hunty,0,972, 230,972, 230) then

begin

result := 2;

end else

if findcolor(battlex,battley,136791,473, 198,473, 198) then

begin

result := 3;

end else

if findcolor(battlexx,battleyy,4873384,970, 679,970, 679) then

begin

result := 4;

end;

 

 

 

end;

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

function hunting:integer;

var

huntx,hunty:integer;

 

begin

if findcolor(huntx,hunty,12968173,581, 249,1307, 965) then

begin

result :=1;

end else

result :=2;

 

end;

 

 

procedure monster;

var

huntx,hunty:integer;

x, y: Integer;

 

begin

if FindColor(x,y,65484,581, 249,1307, 965) then

begin

if FindColor(huntx,hunty,12968173,x-50, y-50,x+50, y) then

begin

clickmouse(huntx,hunty,true);

clickmouse(huntx,hunty,true);

clickmouse(huntx,hunty,true);

wait(5000);

end;

end else

begin

clickmouse(831, 135,true);

end;

end;

 

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

function turn:integer;

var

turnx,turny:integer;

victoryx,victoryy:integer;

errorx,errory:integer;

victoryxX,victoryyY:integer;

errorxx,erroryy:integer;

errorxxx,erroryyy:integer;

 

 

begin

if findcolor(turnx,turny,16053492,460,390,485,415) then

begin

result :=1;

end else

if findcolor(victoryx,victoryy,49279,507,365,507,365) then

begin

result :=2;

end else

if findcolor(errorx,errory,6894524,525,307,527,309) then

begin

result :=3

end else

if findcolor(victoryxX,victoryyY,47482,549, 469,549, 469) then

begin

result :=4;

end else

if findcolor(errorxx,erroryy,12379646,645, 503,645, 503) then

begin

result :=5

end else

if findcolor(errorxxx,erroryyy,2752702,578, 412,578, 412) then

begin

result :=6

end;

 

end;

 

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////

var

combo1x,combo1y,combo2x,combo2y,combo3x,combo3y,combo4x,combo4y:integer;

 

begin

 

 

 

while 0 = 0 do

begin

while loc = 1 do

begin

wait(100);

clickmouse(832, 130,true); // clicked hunting

wait(5000);

end;

 

while loc = 2 do

begin

if hunting = 2 then

begin

wait(100);

clickmouse(832, 130,true); // clicked hunting

wait(5000);

end;

if hunting = 1 then

begin

monster;

wait(5000);

end;

end;

wait (1000);

if loc = 3 then

begin

while loc = 3 do

begin

 

while turn = 1 do

begin

if findcolor(combo1x,combo1y,1474380,441,488,441,488) then

begin

clickmouse(495, 355,true);

end

else

if findcolor(combo2x,combo2y,2001744,461,486,461,486) then

begin

clickmouse(494, 452,true);

end

else

if findcolor(combo3x,combo3y,1474380,483,490,483,490) then

begin

clickmouse(530, 403,true);

end

else

if findcolor(combo4x,combo4y,2001744,505,484,505,484) then

begin

clickmouse(495, 355,true);

end;

end;

 

 

 

 

 

 

if turn = 2 then

begin

clickmouse(840, 139,true);

wait(2000);

end;

if turn = 3 then

begin

clickmouse(840, 139,true);

wait(2000);

end;

if turn = 4 then

begin

clickmouse(840, 139,true);

wait(2000);

end;

if turn = 5 then

begin

clickmouse(840, 139,true);

wait(2000);

end;

if turn = 6 then

begin

clickmouse(840, 139,true);

wait(2000);

end;

 

end;

 

wait (30000);

end;

 

while loc = 4 do

begin

clickmouse(960, 678,true);

wait(500);

end;

 

end;

end.

 

[/scar]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...