SRL Archive - Gaming

Fantasy Online script?


noodelz

2013-08-01 07:27:14

Hi, i just wanted to ask if anyone could be so kind and create me a quick script, since i have no idea what i'm doing.
fantasy online is a browsergame with very simple graphics. all i need is a script that automatically attacks mobs with cretain colors. the one i have doesn't work, it always clicks the top left of the screen. i'd appreciate your help :)


(the code that doesn't work):

procedure Attack;
begin
if FindColor 63994 then
begin
Writeln('Found NPC > Attacking!')
MoveMouse(x,y+random(3));
wait(randomrange(25,50));
ClickMouse(x,y,mouse_Left);

Wait(5000); //MS to wait. 1000 = 1sec
end;
end;

begin
repeat

Attack; //Procedure Attack

until(false);
end.

The Killer

2013-08-01 07:36:54

Firstly when posting code, please use simba tags.
Secondly, the problem you have is that it is not finding the colour properlly. Look at how you are searching for the colour. You're doing it incorrectly. The Parameters for are:
FindColor(var x, y:integer; color, xs, ys, xe, ye:integer):boolean;

noodelz

2013-08-01 07:40:09

From: The Killer
The Parameters for are:
FindColor(var x, y:integer; color, xs, ys, xe, ye:integer):boolean;

ok, but how do i find the right variables? i've already downloaded ACA, but i don't really get it. (i'm a huge coding noob)

noodelz

2013-08-01 08:53:50

ok i kinda got it to work now, but it takes about 20 seconds until it recognizes a mob, even though i have 20 of them standing around me… and it also keeps klicking on dead mobs. would it be possible to tell the script to stay on one mob until it makes a 90° fall (the dying animation)?



program AutoFighter;

var
x,y: Integer;



procedure Attack;
begin
If FindColorTolerance(x, y, 63994, 564, 214, 726, 451, 5) then
begin
Writeln('Found NPC > Attacking!')
MoveMouse(x,y+random(3));
wait(randomrange(25,50));
ClickMouse(x,y,mouse_Left);
ClickMouse(x,y,mouse_Left);

Wait(3000); //MS to wait. 1000 = 1sec
end;
end;

begin
repeat

Attack; //Procedure Attack

until(false);
end.

The Killer

2013-08-01 08:59:38

From: noodelz
ok i kinda got it to work now, but it takes about 30 seconds untill it recognizes a mob, even though i have 20 of them standing around me…



program AutoFighter;

var
x,y: Integer;



procedure Attack;
begin
If FindColorTolerance(x, y, 63994, 564, 214, 726, 451, 5) then
begin
Writeln('Found NPC > Attacking!')
MoveMouse(x,y+random(3));
wait(randomrange(25,50));
ClickMouse(x,y,mouse_Left);
ClickMouse(x,y,mouse_Left);

Wait(3000); //MS to wait. 1000 = 1sec
end;
end;

begin
repeat

Attack; //Procedure Attack

until(false);
end.


Looks better :), have a look if you can find better colours to speed it up, and are you using all the main screen and not a small area of it?
if like runescape your player is in the middle of the screen, you can use spiral versions of findcolor to make it click the one closest.

noodelz

2013-08-01 09:17:11

From: The Killer
Looks better :), have a look if you can find better colours to speed it up, and are you using all the main screen and not a small area of it?
if like runescape your player is in the middle of the screen, you can use spiral versions of findcolor to make it click the one closest.


spiraling works and speeds things up a bit, thanks. but i still have one problem becuase it keeps klicking on dead mobs. would it be possible to tell the script to stay on one mob until it makes a 90° fall or simply ignore mobs that changed their position in a 90°angle? (they fall over when dead)

The Killer

2013-08-01 09:39:22

From: noodelz
spiraling works and speeds things up a bit, thanks. but i still have one problem becuase it keeps klicking on dead mobs. would it be possible to tell the script to stay on one mob until it makes a 90° fall or simply ignore mobs that changed their position in a 90°angle? (they fall over when dead)

To ingore them you could you ATPA's however thats fairly advanced, I would try and use pixel shit to see if they make the fall if you want to make it simple.
Guide to pixel shit

noodelz

2013-08-01 09:57:30

From: The Killer
To ingore them you could you ATPA's however thats fairly advanced, I would try and use pixel shit to see if they make the fall if you want to make it simple.
Guide to pixel shit


ok thanks, i'll see if i can use that. another idea i had was to just make the player idle after every kill/ make the script click a random spot not too far away, becuase for one that + the spiraling will avoid the dead ones and for some reason it seems to make it easier to recognize mobs when i move around a bit. if you could help me out with that too, i'll probably be able to make a more or less working bot :D

The Killer

2013-08-01 09:58:59

From: noodelz
ok thanks, i'll see if i can use that. another idea i had was to just make the player idle after every kill/ make the script click a random spot not too far away, becuase for one that + the spiraling will avoid the dead ones and for some reason it seems to make it easier to recognize mobs when i move around a bit. if you could help me out with that too, i'll probably be able to make a more or less working bot :D


hmm have you got teamviewer? I could help you over it if you want
(pm me details if you wish to).

Also 300 post quotes :P

noodelz

2013-08-01 10:11:01

From: The Killer
hmm have you got teamviewer? I could help you over it if you want
(pm me details if you wish to).

Also 300 post quotes :P


you're welcome ;) my teamviewer id is 233 077 855