SRL Archive - Other Scripts

Facebook - Farmville Bot


nickrules

2009-10-12 21:27:30

pretty much bug free. although im not positive. anywho, its simple enough.

a form pops up, and you push the button for what you want to do.
╔-Performable Tasks:
╞—Collect whatever it is that animals make
╞—Plow land
╞—Plant seeds
╞—Pick plants
╞—Check Corners - 1.2 AND 1.4
╚—Debug box

╔-Features:
╞—Form
╞—Many tasks
╚—Fast.

INSTRUCTIONS
—
╔- PLANT
╚— Find the page and the slot (example: grapes are on page 3, in the 5th slot, so i would put in 3 for page, and 5 for slot.

╔-PLOW
╚— Hit the button, and watch….


╔-PICK
╞—A message dialog will appear telling you what to do. But it basically says this:
╞—"When you hit OK, the cursor will change to that of the color picker.Pick a color of the plant that isn't green. If it gets stuck, hit F4, and try a ╚—different color"

╔-Collect Animal Products
╞—Hit the button and watch.
╚ Note: This function is still buggy, after the new update for animals.

╔-Buy Lotsa Haybales
╞—A message dialog will appear, telling you what to do. It basically says "you MUST buy the haybale on your own. Then put the cursor to the ╚—top of the row of your choice and hit F4. It makes 25 haybales"

╔-Sell ALL haybales
╞—Sit back and watch :P
╚—NOTE: Takes forever… even with the bot

╔Clear & Close form
╞—Clear: clears the form debug box
╚—Close form: exactly what it says. Closes the form and terminates the script

—
NOTE: Latest release is BETA, but its mostly stable.
I added a wait to my clickmouse function (This makes it slower, but it also makes farmville lag less), and now it has stats uploaded to the interwebz automatically, when you close the forum, compliments of SMS. View them here: http://scriptmanager.freehostia.com/scripts.php?sid=34

If someone knows how to make an image which displays time Planted, Plowed, Harvested, Haybayles Created, and Animals Harvested, which updates every lets say… 12 hours, that would be win, as I have no idea how to.

:shifty:Have fun!:shifty:

Bugs, ideas etc appreciated!

UPDATE - Version 1.4 has been released:spot:. it is mostly stable, however it is beta. New form. picture removed, so now its a standalone file. Debug box added, new functions added. lots of things fixed feedback please!
if anyone posts about my standards again, these scripts will be removed. I'm tired of people complaining about them. I DON'T CARE HOW THEY LOOK. Fix them yourself if you really care that much.

Old 1.4 Had 193 DL's

Baked0420

2009-10-13 00:19:03

awesome bot, I tested it on my gf's facebook (she has a huge farm) it does really well, except for the top right and bottom left corner, if it reaches, it misses some, bout like 5-8 in each corner, maybe at the corner the colors aren't the same? well it made me harvest plow then replant her field very fast, I'll post the time running:

ran for 3 Minutes and 10 Seconds

somewhere around there since I watched it do the stuff. Nice script, should add onto it.

Narcle

2009-10-13 01:00:43

Oh nice I was thinking about doing this. I haven't started a farm yet but I'll look through script etc. ;)

cycrosism

2009-10-13 07:56:19

does it have antiban

nickrules

2009-10-13 08:08:23

Wow, glad you guys like it!
—
From: Baked0420
awesome bot, I tested it on my gf's facebook (she has a huge farm) it does really well, except for the top right and bottom left corner, if it reaches, it misses some, bout like 5-8 in each corner, maybe at the corner the colors aren't the same? well it made me harvest plow then replant her field very fast, I'll post the time running:

ran for 3 Minutes and 10 Seconds

somewhere around there since I watched it do the stuff. Nice script, should add onto it.


Yeah… forgot about the corners. those have always been a problem. i'll think of a way to fix that.

@baked I dont think they even ban… so no.

3Garrett3

2009-10-13 13:18:32

The plowing didn't work for me, but other than that it's really fast :)

tico2

2009-10-13 13:20:01

From: cycrosism
does it have antiban


I think you don't need that on facebook :)

nickrules

2009-10-13 16:16:50

From: 3Garrett3
The plowing didn't work for me, but other than that it's really fast :)


Thanks, its designed to be fast. originally, it used mouse, however it seemed like there was little point (no risk of ban). so i changed mouse to clickmouse, however that seemed to be too fast for the game to handle (wouldn't click), so i made my on little function. As for the plowing not working, change lines 69 and 72. you could try a tolerance, or just a different color.
The reason i didn't use tolerances, is because there were so many colors that are so close, but still different and it seemed like it might freak out. never tested though (dunno why).

3Garrett3

2009-10-13 17:14:24

From: nickrules
Thanks, its designed to be fast. originally, it used mouse, however it seemed like there was little point (no risk of ban). so i changed mouse to clickmouse, however that seemed to be too fast for the game to handle (wouldn't click), so i made my on little function. As for the plowing not working, change lines 69 and 72. you could try a tolerance, or just a different color.
The reason i didn't use tolerances, is because there were so many colors that are so close, but still different and it seemed like it might freak out. never tested though (dunno why).


I added a tol. After the stuffs grow to get harvested, I'll test it.

Baked0420

2009-10-13 21:54:26

From: nickrules
Wow, glad you guys like it!
—


Yeah… forgot about the corners. those have always been a problem. i'll think of a way to fix that.

@baked I dont think they even ban… so no.


I didn't ask bout antiban, and I don't think they do bans either, I wouldn't add antiban either, not much you can do for antiban anyway, no tabs to switch between, exp is always on top, you pretty see everything you need, only antiban you could add is random mouse movements for a game like farmville, but its not even needed

nickrules

2009-10-13 22:36:01

1.2 released! checks corners :D left seems to be the only unstable corner, but the rest seem to work. other than that, no fixes.

Post how corner checking (or anything else!) works out for you, after all i cant fix what i dont know about :p

edit - shortly after posting 1.2, i realized that animals ready to be…..collected(?) had been changed in a recent update. i fixed that in both 1.2 and 1.1

randy marsh

2009-10-14 20:32:01

dont worry about antiban

$!r@

2009-10-21 09:04:06

can anyone tell me how to use this script. step by step.

tico2

2009-10-21 09:13:24

From: $!r@
can anyone tell me how to use this script. step by step.


Install scar and set up SRL using this link. Then read the first post ;)

caused

2009-10-21 09:16:58

Gwah XD. I made one too. Mine even handles randoms(messageboxes of any kind), and sets itself up (zooms out and graphics on low-detail).

Gotta take a look at yours :).

~caused

nickrules

2009-10-21 16:26:25

From: caused
Gwah XD. I made one too. Mine even handles randoms(messageboxes of any kind), and sets itself up (zooms out and graphics on low-detail).

Gotta take a look at yours :).

~caused

I was gonna do that, but then i got lazy… I haven't bothered updating it lately, or ironing out bugs. But who knows, i might feel motivated some time in the near future ;)

Nadeem

2009-10-21 18:11:07

lol nice job nick rules :p i made a small bot aswell for me, buys/sells haysacks aswell for quick exp. i'll post it here if u want to take anything u find useful (:


procedure superplow;
// plow, plant, harvest plants, do whatever. just replace the color!
var i, x, y: Integer;
begin
while (i < 196) do // my farm is 14x14 so i have 196 fields plowed
begin
if FindColorTolerance(x, y, {color}865398{/color}, 40, 155, 613, 440, 3) then
begin
ClickMouse(x, y, true);
wait(100);
Inc(i);
end;
end;
end;

procedure sellallhaybales;
// sells all those haybales for u, where ever they are
var i, x, y: Integer;
begin
while (i < 100) do
begin
if FindColorTolerance(x, y, {color}4827630{/color}, 0, 30, 619, 443, 3) then
begin
ClickMouse(x, y, true);
wait(500);
ClickMouse(x+29, y+29, true);
wait(500);
ClickMouse(339, 389, true);
wait(500);
Inc(i);
end;
end;
end;

procedure buylotsahaybales;
// this won't work unless u correct the value of x and y, it'll
// place the haybales diagnolly on the far end right side, so get
// the position from the top right corner.
// .<-- from here
// tl/\tr
// bl\/br
var i, x, y: Integer;
begin
while (i < 100) do
begin
x := 114; // 114 = 1st row | 93 = 2nd row
y := 170;
x := x + (i*9);
if (i >= 13) then x := (x+39) + (i*9);
y := y + (i*5);
ClickMouse(x, y, true);
wait(100);
Inc(i);
end;
end;

begin
ActivateClient;
superplow;
//sellallhaybales;
//buylotsahaybales;
end.



~NS

caused

2009-10-21 18:33:04

Nice Collection we got here ;D.. I'll probably post my script later as well…

Anyone interested in becoming neigbors ? ;)

bestfrnd13

2009-10-22 12:32:52

i'm having problem with this bot, i'm new to using this. the application restarts before it can even enter the farm. help please.

jakeyboy29

2009-10-22 13:08:47

From: caused
Nice Collection we got here ;D.. I'll probably post my script later as well…

Anyone interested in becoming neigbors ? ;)


im with two girls in my picture ;)

caused

2009-10-22 13:53:37

From: jakeyboy29
'jacob anthony kelly' im with two girls in my picture ;)


Friend Request pending :D

bestfrnd13: You will have to be a bit more specific. Which version of scar do you use. Crosshair on farmville ? Does the Form Popup, when you click play ?

~caused

nickrules

2009-10-22 16:33:29

From: Nadeem
lol nice job nick rules :p i made a small bot aswell for me, buys/sells haysacks aswell for quick exp. i'll post it here if u want to take anything u find useful (:


~NS

Hmmmm….. i'll see if i can incorporate that. but first i have to figure out how to use it. looks simple enough…. oh wait…. i forgot about the glitch. i'll explain in a moment.

From: caused
Nice Collection we got here ;D.. I'll probably post my script later as well…

Anyone interested in becoming neigbors ? ;)

sure, if you want to post the script, that would be fine by me. as for invite, i'll find my profile link and PM you with it.

—- OK, here's my problem (the glitch as i mentioned above)
Farmville loads weird. the game is too small PICTURE

I was planning on makeing it buy plants too, but obviously, I cant if the game wont let me close the market or anything (X button is off screen!:duh:)

Nadeem

2009-10-22 17:19:20

From: nickrules
Hmmmm….. i'll see if i can incorporate that. but first i have to figure out how to use it. looks simple enough…. oh wait…. i forgot about the glitch. i'll explain in a moment.


sure, if you want to post the script, that would be fine by me. as for invite, i'll find my profile link and PM you with it.

—- OK, here's my problem (the glitch as i mentioned above)
Farmville loads weird. the game is too small PICTURE

I was planning on makeing it buy plants too, but obviously, I cant if the game wont let me close the market or anything (X button is off screen!:duh:)


Thats not a glitch lol… you have to press ctrl+scroll up(or down) cuz your zoomed out of the game. I just tryed it to make sure im not lieing, the game is cut off when im zoomed out, so i had to zoom in for the game to display correct ratio (:



~NS

nickrules

2009-10-22 21:26:34

From: Nadeem
Thats not a glitch lol… you have to press ctrl+scroll up(or down) cuz your zoomed out of the game. I just tryed it to make sure im not lieing, the game is cut off when im zoomed out, so i had to zoom in for the game to display correct ratio (:


~NS


:duh::redface: i tried that… but differently. i use ctrl+0 because that turns it o normal display. i use a laptop pad, which is probably how that happened, and apparently, i have to do it your way, not ctrl+0:pinch:.
Thanks a mil, you have no idea how annoying that is

Updating time! expect something new in 2-4 days. kinda late, so expect something by late tmrw earliest.

Nadeem

2009-10-22 21:41:33

From: nickrules
:duh::redface: i tried that… but differently. i use ctrl+0 because that turns it o normal display. i use a laptop pad, which is probably how that happened, and apparently, i have to do it your way, not ctrl+0:pinch:.
Thanks a mil, you have no idea how annoying that is

Updating time! expect something new in 2-4 days. kinda late, so expect something by late tmrw earliest.


ahah np :p it happens lol. will be looking forward to ur next release (:



~NS

Terror Factor

2009-10-23 08:45:07

When I want to collect from animals, it clicks on one, and then it misclicks and it moves my farm out of view.

I'm using scar divi 3.21b, on windows 7, crosshair on farmville in firefox, farmville is zoomed out to the max and i've downloaded srl through scar.

caused

2009-10-24 17:10:11

From: Nadeem
lol nice job nick rules :p i made a small bot aswell for me, buys/sells haysacks aswell for quick exp. i'll post it here if u want to take anything u find useful (:
~NS



Hey there Nadeem and everyone!.

I just studied the exp-generating methods of farmville a bit. The following solution seems to be the best one:

1. Generate an empty field with the plowing tool. 1 exp - 15 g
2. Place Soy-Beans on that field. 2 exp - 15 g.
3. remove the soy-beans-field and goto 1.

that would be 30 g for 3 exp

1exp = 10 g

The math for hay bales is:
5 exp = 100 g

1 exp = 20 g

Meaning the method i'm suggesting is probably the best for exp. If someone knows a better method, please post!

~caused

Nadeem

2009-10-24 19:51:25

From: caused
Hey there Nadeem and everyone!.

I just studied the exp-generating methods of farmville a bit. The following solution seems to be the best one:

1. Generate an empty field with the plowing tool. 1 exp - 15 g
2. Place Soy-Beans on that field. 2 exp - 15 g.
3. remove the soy-beans-field and goto 1.

that would be 30 g for 3 exp

1exp = 10 g

The math for hay bales is:
5 exp = 100 g

1 exp = 20 g

Meaning the method i'm suggesting is probably the best for exp. If someone knows a better method, please post!

~caused


Im aware of this strategy (: i was thinking of making a bot for this but if nickrules already has this on mind then i wouldn't need to :p



~NS

Terror Factor

2009-10-24 21:38:32

Lol, here's the 'bot' for it:
program New;
begin
repeat
ClickMouse(693, 508, True); //plowtool
wait(1500);
ClickMouse(390, 315, True);//field
wait(1500);
ClickMouse(646, 506, True); //multitool
wait(1500);
ClickMouse(417, 277, True);//field
wait(2000);
ClickMouse(172, 545, True);//buy
wait(1500);
ClickMouse(736, 507, True);//deletetool
wait(1500);
ClickMouse(417, 277, True);//field
wait(1500);
ClickMouse(328, 389, True); //accept
wait(1500);
until(false);
end.

When you start farmville up, you're in the right startingposition. It has no failsafes, and timings could be ajusted a bit, I took quite long waitingtimes, because I run this in a vm, which gives a quite laggy result.

caused

2009-10-24 22:05:43

From: Terror Factor
Lol, here's the 'bot' for it:
program New;
begin
repeat
ClickMouse(693, 508, True); //plowtool
wait(1500);
ClickMouse(390, 315, True);//field
wait(1500);
ClickMouse(646, 506, True); //multitool
wait(1500);
ClickMouse(417, 277, True);//field
wait(2000);
ClickMouse(172, 545, True);//buy
wait(1500);
ClickMouse(736, 507, True);//deletetool
wait(1500);
ClickMouse(417, 277, True);//field
wait(1500);
ClickMouse(328, 389, True); //accept
wait(1500);
until(false);
end.

When you start farmville up, you're in the right startingposition. It has no failsafes, and timings could be ajusted a bit, I took quite long waitingtimes, because I run this in a vm, which gives a quite laggy result.


That won't work for long :P… Feel Free to add my "Anti Random Procedure". Here it is:

Function HandleRandoms:Boolean;
var
x,y,okbutton,coinsDTM: integer;
begin

If FindColor(x,y,3819203,0,195,xw,xh) then
begin
WriteLn('Some Window Random.. Killing');
ClickMouse(x,y,True);
end;

coinsDTM := DTMFromString('78DA634C626460E004622470F7C515300D136' +
'5AC06B25850D584CE9880AA2610C86226A02600C8E24355F3FFEF' +
'535435A540162F7E730066DF0C24');

okbutton := DTMFromString('78DA638C676460D809C448E0ED97FB0CAC401' +
'A24FA1F08186B81ACF5A86AA6EC7104D33051467722D458035947' +
'08A82926AC0600EF79128A');

If FindDtm(okbutton,x,y,0,0,xw,xh) then
begin
WriteLn('Ok Button Random');
ClickMouse(x,y,True)
freedtm(okbutton);
exit;
end;

freedtm(okbutton);
//facebook window
If FindColor(x,y,14203047,5,5,xw,xh) then
begin
WriteLN('Facebook Window Random');
ClickMouse(x,y,true);
result:=true;
exit;
end;



If FindDtm(coinsDTM,x,y,0,0,xw,xh) then
begin
WriteLn('BuyCoins Random Detected');
If FindColor(x,y,3819203,0,0,xw,xh) then
ClickMouse(x,y,True)
else
WriteLn('Could not solve Random');
end;
freedtm(coinsDTM);
result:=false;

end;

nickrules

2009-10-25 21:46:55

New version released! version 1.4 has a new form design, a built in debug box, functions have been improved, and added. Try it out for yourself, and post feedback please! Read the first post for download and more detail, as well as instructions

If some person with magical powers wouldn't mind updating the thread title to "[UPDATED 11/7] FB-Farmville Bot" that would be sweet. thanks

Nadeem

2009-11-07 20:19:38

ahah Nice :) Lotsa work has been put in I see.

Some stuff you can improve would be shortening down ur code for example, your pick procedure can be shortened down from:

procedure pick(Sender: TObject);
begin
ShowMessage('click an unusuall color of the plant your harvesting. basicly, not green...');
WriteLn('PROCEDURE pick(Sender: TObject); STARTED AT '+TheTime);
Wait(750)
pickcolor(c,x,y)
WriteDB('Picking All plants with that color!');
repeat
findcolor(x,y,c,0,0,662,440);
Popups;
Cmouse(x,y);
HandlePause;
until(not findcolor(x,y,c,0,0,662,440) or isfkeydown(4)) ;
L;
repeat
Popups;
findcolor(x,y,c,0,0,662,440);
Cmouse(x,y);
HandlePause;
until(not findcolor(x,y,c,0,0,662,440) or isfkeydown(4)) ;
D;
repeat
Popups;
findcolor(x,y,c,0,0,662,440);
Cmouse(x,y);
HandlePause;
until(not findcolor(x,y,c,0,0,662,440) or isfkeydown(4)) ;
UR;
repeat
Popups;
findcolor(x,y,c,0,0,662,440);
Cmouse(x,y);
HandlePause;
until(not findcolor(x,y,c,0,0,662,440) or isfkeydown(4)) ;
U;
repeat
Popups;
findcolor(x,y,c,0,0,662,440);
Cmouse(x,y);
HandlePause;
until(not findcolor(x,y,c,0,0,662,440) or isfkeydown(4)) ;
WriteLn('PROCEDURE pick(Sender: TObject); ENDED AT '+TheTime);
end;

to:

procedure pick(Sender: TObject);
var left, down, up, right: Boolean;
begin
ShowMessage('click an unusuall color of the plant your harvesting. basicly, not green...');
WriteLn('PROCEDURE pick(Sender: TObject); STARTED AT '+TheTime);
Wait(750)
pickcolor(c,x,y)
WriteDB('Picking All plants with that color!');
repeat
if Findcolor(x, y, c, 0, 0, 662, 440) then
begin
Popups;
Cmouse(x, y);
HandlePause;
end else
begin
if not left then L
else if not down then D
else if not up then U
else if not right then UR
else break;
end;
until (isfkeydown(4));
WriteLn('PROCEDURE pick(Sender: TObject); ENDED AT '+TheTime);
end;

And so on, there are quite a few methods that can be shortened and made a bit more efficient, and standardizing would help [UI]ALOT:)



~NS

Bubix

2009-11-08 17:29:25

sweet,I`m using this, its great :)

stein3

2009-11-08 18:20:24

hah, I have a friend who wanted me to play this. I was thinking, "wow, how stupid he is for just clicking a lot, I should make a script for it…"

I'll make a farm and try this out!

mrpickle

2009-11-08 23:28:06

THis thread makes me want to create Facebook bots. I'll start wih mafia.

Bebe

2009-11-09 02:49:18

Eww, properly format your code… holy hell it's rough on the eyes

*edit*
Enjoy:
program ByNickRules;
{.include srl/srl.scar}


var //FORM VARIABLES
EndInitForm : Boolean;
frmDesign : TForm;
Button1, Button2, Button3, Button4,
Button5, Button6, Button7, Button8 : TButton;
ComboBox1, ComboBox2 : TComboBox;
GroupBox1 :TGroupBox;
DBbox : TMemo;
Magnify, Close, closes, OOS,enhanced, x,y,c, popu : Integer; //SCRIPT VARIABLE
ThePlant : String;


{//////////////////basic procedures (all by me)\\\\\\\\\\\\\\\\\}
procedure Cmouse(x,y: integer);
begin
holdmouse(x,y,true)
wait(75)
releasemouse(x,y,true)
end;

Procedure WriteDB(S: String); {Writes in the form debug box}
begin
with DBbox.lines do
begin
add(s);
end;
end;

Procedure CDB(sender: TObject);
var
i: Integer;
begin
with DBbox.lines do
begin
clear;
end;
end;

procedure L; {search left}
var
x,y:integer;
begin
FindColorspiral(x,y,4758089,239,185,330,267)
HoldMouse(x, y, True);
MoveMouse(468, 171);
ReleaseMouse(468, 171, True);
end;

Procedure D; {search down}
var
x,y:integer;
begin
FindColorspiral(x,y,4758089,239,185,330,267)
HoldMouse(x, y, True);
MoveMouse(0, 107);
Wait(202);
ReleaseMouse(2, 107, True);
end;

Procedure UR; {search up and right}
var
x,y:integer;
begin
FindColorspiral(x,y,4758089,239,185,330,267)
HoldMouse(x, y, True);
MoveMouse(43, 320);
Wait(328);
ReleaseMouse(43, 320, True);
end;

Procedure U; {search up}
begin
FindColorspiral(x,y,4758089,239,185,330,267)
HoldMouse(x, y, True);
MoveMouse(540, 335);
ReleaseMouse(540, 335, True);
ReleaseMouse(540, 335, True);
end;

procedure HandlePause; {checks for F3}
begin
if isfkeydown(3) then
repeat
wait(500)
until(not isfkeydown(3))
end;
{End of basic procedures for script}

Procedure LoadDTMs;
begin
Magnify := DTMFromString('78DA639CCAC4C0709C910119FCFFFF1F4CC34' +
'419416A8EA1AAD9BD6C0AA69AA3A86ACA7C3451D5CC06AAB986AA' +
'66654D00AA9A8544983319A8E61C01352D4035E7F1FB0B007EAD1' +
'5E5');
OOS := DTMFromString('78DA63546564606803622430658F239886893' +
'2AA10A1A610C8FA82A2842174C6045435ED409632AA39FFFF3E45' +
'55730DC87A4EC09C2540D633026A4481AC7634BBFEFF4755230C6' +
'4F5E1F71700C794170E');
Close := DTMFromString('78DA639CCDC8C060CF8002FEFFFF0FA619A17' +
'CC649409603AA9AC36E56A86A9600598E04D42C00B25CF1DB0500' +
'7C590C03');
Enhanced := DTMFromString('78DA6374606460E8066224F0FFFF7F300D136' +
'53407B2A6A1AA99B2C711554D3A90658F66CEDFA7A86A9A812C5E' +
'5435A13326A0AA990F6409E2570300810F0DFC');
end;

Procedure Check2;
var
x,y:Integer;
begin
if(FindDTM(enhanced,x,y,0,0,747,480))then
begin
WriteLn('=========SCRIPT FAILER NOTICE=========');
WriteLn('=GAME ENGINE ENHANCED')
WriteLn('=TERMINATING SCRIPT');
WriteLn('=========END OF FAILER NOTICE=========')
terminatescript;
end;
end;

procedure Popups;
var
x,y: Integer;
begin
If(FindDTM(OOS,x,y,0,0,747,480))then
begin
WriteLn('=========SCRIPT FAILER NOTICE=========');
WriteLn('=THE GAME IS OUT OF SYNC WITH SERVER');
WriteLn('=TERMINATING SCRIPT');
WriteLn('=========END OF FAILER NOTICE=========')
TerminateScript;
end else
begin
If(FindDTM(close,x,y,0,0,747,480))then
begin
check2;
WriteLn('SUCCESFULY BLOCKED A POPUP.');
Inc(popup);
WriteLn('POPUP COUNT := '+ IntToStr(popup));
Cmouse(x,y)
end;
end;
end;

Procedure FindIt(P,sp: integer);
begin
WriteLn('PROCEDURE: FindIt(P,sp: integer); STARTED AT '+THetime);
sp:=0;
cmouse(684,558);
wait(5000)
for SP := -1 to P-1 do
begin
Cmouse(708,333);
sp:=sp+1;
wait(500)
end;
WriteLn('At page');
WriteLn('PROCEDDURE FindIt(P,sp: integer); ENDED AT '+tHEtime);
end;

Procedure BuyIt(Slot: integer);
begin
WriteLn('PPROCEDURE BuyIt(Slot: integer); STARTED AT '+TheTime);
case (slot) of
1: begin
Cmouse(170,351);
end;
2: begin
Cmouse(308,352);
end;
3: begin
Cmouse(446,351);
end;
4: begin
Cmouse(585,351);
end;
5:begin
cmouse(170,545);
end;
6: begin
cmouse(309,545);
end;
7: begin
cmouse(444,545);
end;
8: begin
cmouse(582,545);
end;
end;
WriteLn('PROCEDURE: BuyIt(Slot: integer); ENDED AT '+TheTime);
end;

Procedure CompleteIt(Page,Slot:Integer);
begin
WriteLn('PROCEDURE STARTED: CompleteIt(Page,Slot:Integer); AT '+TheTime)
FindIt(Page,1);
WriteLn('Going to page '+IntToStr(page))
writeDB('Going to page '+IntToStr(page))
wait(1000)
WriteDB('At page. Buying Seed from slot '+IntToStr(slot));
WriteLn('At page. Buying Seed from slot '+IntToStr(slot));
BuyIt(Slot);
WriteLn('PROCEDURE CompleteIt(Page,Slot:Integer); ENDED AT '+TheTime);
end;

procedure buylotsahaybales(sender:TObject); //Inspired by Nadeem :P
var
x,y,i: Integer;
begin
WriteLn('PROCEDURE buylotsahaybales(sender:TObject); STARTED AT '+TheTime);
showmessage('makes a line from top to Right and down (/). press F4 at where you want the top row to be. Makes 25 haybales.');
Repeat
GetMousePos(x,y)
wait(500)
Until(isFkeydown(4))
repeat
Clickmouse(x,y,true);
x := x-5;
y := y+3;
i := i+1;
until(i>= 25)
WriteDB('25 haybales placed!');
WriteLn('PROCEDURE buylotsahaybales(sender:TObject); ENDED AT '+TheTime);
end;

procedure SellAllHaybales(Sender: TObject);
begin
writeLn('PROCEDURE SellAllHaybales(sender: TObject); STARTED AT '+THETIME);
writeDB('Selling haybales!');
wait(500)
Cmouse(732,505);
repeat
FindColor(x,y,4304372,0,0,761,493);
Cmouse(x,y)
wait(400)
cmouse(301,392)
wait(400)
until(isfkeydown(4) or not FindColor(x,y,4304372,0,0,761,493))
WriteDB('Haybales Sold!');
writeLn('PROCEDURE SellAllHaybales(sender: TObject); ENDED AT '+THETIME);
end;

procedure pick(Sender: TObject);
begin
ShowMessage('click an unusuall color of the plant your harvesting. basicly, not green...');
WriteLn('PROCEDURE pick(Sender: TObject); STARTED AT '+TheTime);
Wait(750)
pickcolor(c,x,y)
WriteDB('Picking All plants with that color!');
repeat
findcolor(x,y,c,0,0,662,440);
Popups;
Cmouse(x,y);
HandlePause;
until(not findcolor(x,y,c,0,0,662,440) or isfkeydown(4)) ;
L;
repeat
Popups;
findcolor(x,y,c,0,0,662,440);
Cmouse(x,y);
HandlePause;
until(not findcolor(x,y,c,0,0,662,440) or isfkeydown(4)) ;
D;
repeat
Popups;
findcolor(x,y,c,0,0,662,440);
Cmouse(x,y);
HandlePause;
until(not findcolor(x,y,c,0,0,662,440) or isfkeydown(4)) ;
UR;
repeat
Popups;
findcolor(x,y,c,0,0,662,440);
Cmouse(x,y);
HandlePause;
until(not findcolor(x,y,c,0,0,662,440) or isfkeydown(4)) ;
U;
repeat
Popups;
findcolor(x,y,c,0,0,662,440);
Cmouse(x,y);
HandlePause;
until(not findcolor(x,y,c,0,0,662,440) or isfkeydown(4)) ;
WriteLn('PROCEDURE pick(Sender: TObject); ENDED AT '+TheTime);
end;

Procedure TS(sender:Tobject);
begin
frmDesign.ModalResult:= mrOk;
end;

Procedure plow(Sender: TObject);
Begin
WriteLn('PROCEDURE plow(Sender: TObject); STARTED AT '+TheTime);
WriteDB('Plowing land!');
wait(500);
Cmouse(637,504);
repeat
Popups;
findcolortolerance(x,y,1005420,0,32,662,440,25);
Cmouse(x,y);
HandlePause;
until(not findcolortolerance(x,y,1005420,0,32,662,440,25) or isfkeydown(4));
L;
repeat
Popups;
findcolor(x,y,1005420,0,32,662,440);
Cmouse(x,y);
HandlePause;
until(not findcolor(x,y,1005420,0,32,662,440) or isfkeydown(4)) ;
D;
repeat
Popups;
findcolor(x,y,1005420,0,32,662,440);
Cmouse(x,y);
HandlePause;
until(not findcolor(x,y,1005420,0,32,662,440) or isfkeydown(4)) ;
UR;
repeat
Popups;
findcolor(x,y,1005420,0,32,662,440);
Cmouse(x,y);
HandlePause;
until(not findcolor(x,y,1005420,0,32,662,440) or isfkeydown(4)) ;
U;
repeat
Popups;
findcolor(x,y,1005420,0,32,662,440);
Cmouse(x,y);
HandlePause;
until(not findcolor(x,y,1005420,0,32,662,440) or isfkeydown(4));
WriteLn('PROCEDURE plow(Sender: TObject); ENDED AT '+TheTime);
end;

Procedure Plant(Sender: TObject);
begin
WriteLn('PROCEDURE Plant(Sender: TObject); STARTED AT '+TheTime);
WriteDB('Planting!');
CompleteIt(StrToInt(ComboBox1.text),StrToInt(ComboBox2.text))
wait(1000);
repeat
Popups;
findcolor(x,y,2709397,0,0,662,440);
Cmouse(x,y);
HandlePause;
until(not findcolor(x,y,2709397,0,0,662,440) or isfkeydown(4)) ;
L;
repeat
Popups;
findcolor(x,y,2709397,0,0,662,440);
Cmouse(x,y);
HandlePause;
until(not findcolor(x,y,2709397,0,0,662,440) or isfkeydown(4)) ;
D;
repeat
Popups;
findcolor(x,y,2709397,0,0,662,440);
Cmouse(x,y);
HandlePause;
until(not findcolor(x,y,2709397,0,0,662,440) or isfkeydown(4)) ;
UR;
repeat
Popups;
findcolor(x,y,2709397,0,0,662,440);
Cmouse(x,y);
HandlePause;
until(not findcolor(x,y,2709397,0,0,662,440) or isfkeydown(4)) ;
U;
repeat
Popups;
findcolor(x,y,2709397,0,0,662,440);
Cmouse(x,y);
HandlePause;
until(not findcolor(x,y,2709397,0,0,662,440) or isfkeydown(4)) ;
WriteLn('PROCEDURE Plan(Sender: TObject); STARTED AT '+TheTime);
WriteDB('Planting finished!');
end;

Procedure SetupPlayer;
var
x,y:Integer;
begin
FindDTM(magnify,x,y,555,427,761,495)
Cmouse(x,y)
Cmouse(x,y)
Cmouse(x,y)
Cmouse(x,y)
Cmouse(x,y)
end;

Procedure Animals(sender: Tobject);
var
x,y,xx,yy:integer;
begin
WriteLn('PROCEDURE Animals(Sender: TObject); STARTED AT '+TheTime);
WriteDB('Collecting animal products!');
Repeat
If FindcolorTolerance(x,y,12559825,0,0,662,440,5) or FindcolorTolerance(x,y,8605387,0,0,662,440,5) then
Cmouse(x+8,y+8);
handlepause;
Getmousepos(xx,yy)
Cmouse(xx+40,yy+50)
handlepause;
Until(IsFkeydown(4) or not FindcolorTolerance(x,y,12559825,0,0,662,440,5) or Findcolortolerance(x,y,8605387,0,0,662,440,5))
WriteLn('PROCEDURE plow(Sender: TObject); ENDED AT '+TheTime);
WriteDB('Finished collecting animal products!');
end;

procedure InitFormOnClose(Sender : TObject; var Action : TCloseAction);
begin
if(not(frmDesign.ModalResult = 1))then
EndInitForm := True;
end;

procedure InitForm;
begin
frmDesign := CreateForm;
with frmDesign do
begin
OnClose := @InitFormOnClose;
BorderStyle := bsSingle;
BorderIcons := [biMinimize];
Left := 601;
Top := 103;
ClientWidth := 534;
ClientHeight := 306;
Caption := 'Farmville Bot PRO';
Color := clWhite;
Font.Color := clWindowText;
Font.Height := -11;
Font.Name := 'OCR A Extended';
Font.Style := [];
PixelsPerInch := 96;
end;
Button1 := TButton.Create(frmDesign);
with Button1 do
begin
Parent := frmDesign;
Left := 0;
Top := 64;
Width := 177;
Height := 57;
Caption := 'Plow';
TabOrder := 0;
OnClick := @plow;
end;
Button2 := TButton.Create(frmDesign);
with Button2 do
begin
Parent := frmDesign;
Left := 352;
Top := 64;
Width := 177;
Height := 57;
Caption := 'Pick';
OnClick := @Pick;
end;
Button3 := TButton.Create(frmDesign);
with Button3 do
begin
Parent := frmDesign;
Left := 176;
Top := 64;
Width := 177;
Height := 33;
Caption := 'Plant';
OnClick := @plant;
end;
Button5 := TButton.Create(frmDesign);
with Button5 do
begin
Parent := frmDesign;
Left := 0;
Top := 0;
Width := 177;
Height := 57;
Caption := 'Collect Animal Products';
OnClick := @animals;
end;
ComboBox1 := TComboBox.Create(frmDesign);
with ComboBox1 do
begin
Parent := frmDesign;
Left := 176;
Top := 96;
Width := 89;
Height := 20;
ItemHeight := 12;
TabOrder := 5;
Text := 'Page';
with Items do
begin
Add('1');
Add('2');
Add('3');
Add('4');
Add('5');
Add('6');
end;
end;
Button6 := TButton.Create(frmDesign);
with Button6 do
begin
Parent := frmDesign;
Left := 176;
Top := 0;
Width := 177;
Height := 57;
Caption := 'Buy lotsa haybales';
TabOrder := 6;
OnClick := @BuyLotsaHayBales;
end;
Button7 := TButton.Create(frmDesign);
with Button7 do
begin
Parent := frmDesign;
Left := 352;
Top := 0;
Width := 177;
Height := 57;
Caption := 'Sell ALL haybales';
TabOrder := 7;
OnClick := @SellAllHaybales;
end;
GroupBox1 := TGroupBox.Create(frmDesign);
with GroupBox1 do
begin
Parent := frmDesign;
Left := 0;
Top := 129;
Width := 529;
Height := 176;
Caption := 'Debug Box';
Color := clMedGray;
ParentColor := False;
TabOrder := 8;
end;
DBbox := TMemo.Create(GroupBox1);
with DBbox do
begin
Parent := GroupBox1;
Left := 0;
Top := 16;
Width := 529;
Height := 153;
ReadOnly := True;
TabOrder := 0;
ScrollBars := ssnone;
end;
Button4 := TButton.Create(frmDesign);
with Button4 do
begin
Parent := frmDesign;
Left := 448;
Top := 272;
Width := 81;
Height := 33;
Caption := 'Close Form';
TabOrder := 3;
OnClick := @TS;
end;
ComboBox2 := TComboBox.Create(frmDesign);
with ComboBox2 do
begin
Parent := frmDesign;
Left := 264;
Top := 96;
Width := 89;
Height := 20;
ItemHeight := 12;
TabOrder := 9;
Text := 'Slot';
with Items do
begin
Add('1');
Add('2');
Add('3');
Add('4');
Add('5');
Add('6');
Add('7');
Add('8');
end;
end;
Button8 := TButton.Create(GroupBox1);
with Button8 do
begin
Parent := GroupBox1;
Left := 200;
Top := 160;
Width := 89;
Height := 17;
Caption := 'Clear';
TabOrder := 1;
OnClick := @CDB;
end;
WriteDB('Thank you for using the farmville bot pro by Nickrules.');
WriteDB('For instructions, Or to post feedback/bugs, visit: ');
WriteDB('SRL-Forums >scar> Other Scripts> FB-Farmville Bot');
end;

procedure SafeInitForm;
var
v : TVariantArray;
begin
SetArrayLength(v, 0);
ThreadSafeCall('InitForm', v);
end;

procedure ShowInitFormModal;
begin
frmDesign.ShowModal;
end;

procedure SafeShowInitFormModal;
var
v : TVariantArray;
begin
SetArrayLength(v, 0);
ThreadSafeCall('ShowInitFormModal', v);
end;

procedure MainInitForm;
begin
try
SafeInitForm;
SafeShowInitFormModal;
finally
FreeForm(frmDesign);
except
WriteLn('An error seems to have occurred in: InitForm');
end;
end;


begin
setupsrl;
loadDTMs;
ClearDebug;
GetSelf.WindowState := wsMinimized;
MainInitForm;
GetSelf.WindowState := wsNormal;
if(EndInitForm) then
TerminateScript;
writeln('ran for '+ timerunning)
writeln('closed '+Inttostr(closes) +' popups');
end.

I properly formatted your code. :o

Some suggestions:
  • I would not recommend using x,y as both local and global variables. Change that.
  • Fix the form, it looks horrid
  • Make the hay bales selling procedure handle all colors of hay bales (I assume it only handles standard hay bales currently?)
  • Look for improvments in your code. Do you really need "Cmouse" when you can use a simple "clickmouse"…. Why reinvent the wheel?
  • Standardize the names for your procedures, haveing procedures named "L" and "D" is just ugly. Give your procedures/functions short descriptive names(i.e. insteed of "procedure L;) make that "procedure Search Left", etc.)
And several other things that I can pick at. But for a newer member this isn't bad work. Good Job.

*Edit Again*
I got bored so I rewrote you SellAllHayBails procedure

Procedure SellAllHayBales(Sender :Tobject);
var
Color: Array [0..7] of integer;
i,Bx,By: integer;
Begin
Color[0]:=4173295; //Normal
Color[1]:=2369966; //Red
Color[3]:=14140862; //White
Color[3]:=14832960; //Blue
Color[4]:=8289918; //black
Color[5]:=5293962; //pink
Color[6]:=12040945; //green
Clickmouse(732,505, true)
for i:=0 to 6 do
if(FindColor(Bx,By,Color[i],0,0,761,493))then
begin
Clickmouse(Bx, By ,true)
wait(400)
clickmouse(Bx + 16,By + 30, true)
end else
WriteDB('No Haybales found');
exit;
end;
I haven't tested it so I wouldn't trust those colors, I'd pick them yourself :o

nickrules

2009-11-09 07:27:06

From: Bebe
Eww, properly format your code… holy hell it's rough on the eyes

*edit*
Enjoy:


Some suggestions:
  • I would not recommend using x,y as both local and global variables. Change that.
  • Fix the form, it looks horrid
  • Make the hay bales selling procedure handle all colors of hay bales (I assume it only handles standard hay bales currently?)
  • Look for improvments in your code. Do you really need "Cmouse" when you can use a simple "clickmouse"…. Why reinvent the wheel?
  • Standardize the names for your procedures, haveing procedures named "L" and "D" is just ugly. Give your procedures/functions short descriptive names(i.e. insteed of "procedure L;) make that "procedure Search Left", etc.)
And several other things that I can pick at. But for a newer member this isn't bad work. Good Job.

*Edit Again*
I got bored so I rewrote you SellAllHayBails procedure

Procedure SellAllHayBales(Sender :Tobject);
var
Color: Array [0..7] of integer;
i,Bx,By: integer;
Begin
Color[0]:=4173295; //Normal
Color[1]:=2369966; //Red
Color[3]:=14140862; //White
Color[3]:=14832960; //Blue
Color[4]:=8289918; //black
Color[5]:=5293962; //pink
Color[6]:=12040945; //green
Clickmouse(732,505, true)
for i:=0 to 6 do
if(FindColor(Bx,By,Color[i],0,0,761,493))then
begin
Clickmouse(Bx, By ,true)
wait(400)
clickmouse(Bx + 16,By + 30, true)
end else
WriteDB('No Haybales found');
exit;
end;
I haven't tested it so I wouldn't trust those colors, I'd pick them yourself :o

*Already fixed standards the day after 1.4 was released….
* didn't know x,y WAS a global.. thats from the really old versions of the script (as in, no procedures, just one huge loop). I'll get to that
*I do need Cmouse, because my crapy computer cant handle the speed it clicks at, and therefore, does not click.
*I think the form looks fine, its not exactly meant to be super 'spify'. and its my second. and i hate forms with separate files.

Thanks for the advices and such. I added the sellhaybles procedure you made. personally, i dont see a reason to differently colored haybales though.
thanks again.

From: mrpickle
THis thread makes me want to create Facebook bots. I'll start wih mafia.

make it work with cuba and moscow. :P

caused

2009-11-09 07:30:11

Looking fine.

I tried it to collect animal stuffs :x.. It seems to fail when your animals are on a cluster though :/.

~caused

jassi32

2009-11-10 14:29:01

how to use the scirpt..pls help..newbie.:spongebob:………

bagofelix

2009-11-10 15:25:10

Heya,

I love the script. The only issue I've noticed is that it has large issues with animal picking. Perhaps you could look for the bitmap of that pink arrow and click on it?

Also, when planting it instead plows. I'm not sure why that is.

nickrules

2009-11-10 16:15:56

From: bagofelix
Heya,

I love the script. The only issue I've noticed is that it has large issues with animal picking. Perhaps you could look for the bitmap of that pink arrow and click on it?

Also, when planting it instead plows. I'm not sure why that is.

I found that (plow button plants) like 10 minuets after uploading, so i fixed that. do you have the latest version? I had to re-upload.
Or change line 450 to this:

    OnClick := @Plow;
I am aware of the animal collecting issues. The little symbol is slightly transparent though. thats why its caused so many issues.

From: jassi32
how to use the scirpt..pls help..newbie.:spongebob:………

As for you, You must have scar and SRL installed. Then drag the aimer looking thing over the game. Then click play, and click the button for the task you wish to do.

mrpickle

2009-11-10 16:36:39

Your standards are awful >.<.

Nadeem

2009-11-10 16:54:42

Suggestions:
- Look for the pink color whilst looking for animarl harvesting (choose the dark pink)
- When about to harvest plans, make sure its scrolled all the way out
- A good fail safe would be to check inflate the point by 6px and check if the color white or inflate by 3px if color brown exists. This is to make sure its not trying to plow/plant/harvest anything that cannot be done. (farmville draws a new cursor and hides ur real cursor whilst trying to do the actions, so your basically checking for their drawn cursor)
- Another way for the failsafe would be to check if the bracket exists when mouse hovers over
- Toggling display quality to low would help with colors :)
- For messages (expecially for buy sell etc…) check for the green/red buttons and wait for them to display/click and set a time outs, i've noticed it gets stuck alot ;)

Fun Stuff:
- Before and after experience count

Edit: I'll post my haybale sell/buy and also the soybeans plant/buy/sell when i get home in a few hours :)



~NS

barbarianl3t

2009-11-10 20:08:52

Quick question but do you guys have scar actually highlight only Farmville as of right now? Whenever I try to highlight Farmville the entire facebook gets highlighted. If that's the case for everyone then what size screen is being used? Because the planting procecdure is very messed up whenever I try to use it.

Nadeem

2009-11-10 20:19:08

From: barbarianl3t
Quick question but do you guys have scar actually highlight only Farmville as of right now? Whenever I try to highlight Farmville the entire facebook gets highlighted. If that's the case for everyone then what size screen is being used? Because the planting procecdure is very messed up whenever I try to use it.


That happens to me on linux, windows how ever is fine…



~NS

caused

2009-11-24 04:28:28

From: barbarianl3t
Quick question but do you guys have scar actually highlight only Farmville as of right now? Whenever I try to highlight Farmville the entire facebook gets highlighted. If that's the case for everyone then what size screen is being used? Because the planting procecdure is very messed up whenever I try to use it.

adjust your browser so that the farmville client is in the upper left corner to work around that problem ;).

My bot finds the farmville window itself so, it does not matter where on the screen it is, as long as its fully visible.

~caused

Demonghost76

2009-11-24 17:08:17

my mom prob like this

pitx

2009-11-26 18:58:56

how do i stop this error when trying to run/compile

Line 51: [Error] (51:11): Unknown identifier 'CreateTPAFromBMP' in script C:\Program Files\SCAR 3.22\includes\SRL\SRL\Core\Math.scar

caused

2009-11-26 19:09:47

From: pitx
how do i stop this error when trying to run/compile

Line 51: [Error] (51:11): Unknown identifier 'CreateTPAFromBMP' in script C:\Program Files\SCAR 3.22\includes\SRL\SRL\Core\Math.scar


I think 'CreateTPAFromBMP' is something from the wizzyplugin (?). If so you'd need to install that.

Can someone please verify ? XD

~caused

WT-Fakawi

2009-11-27 07:54:24

Interesting! Are there more people scripting for farmville? And is it fun (and profitable) to do? Because if it is, I am willing to open up a farmville section :) Lots of possibilities for this….

Dervish

2009-11-27 10:34:22

Why bot farmville though ? :S

You only farm and then have to wait no ?

WT-Fakawi

2009-11-27 12:15:46

Its just a thought. Plant do tkae forever to grow, indeed. Two days…three days..might not be worth running a script for such a long period of time. But on the other hand, since time is of no importance for us…..

Let me first play this game for a couple of days…ideas will pop up for sure!

Camaro'

2009-11-27 19:32:42

From: WT-Fakawi
Its just a thought. Plant do tkae forever to grow, indeed. Two days…three days..might not be worth running a script for such a long period of time. But on the other hand, since time is of no importance for us…..

Let me first play this game for a couple of days…ideas will pop up for sure!


Dont make a section, thats just plain stupid.

:duh:

mrpickle

2009-11-27 19:36:44

to make it more practical, get it to plant only the fastest, most profitable plant, strawberries. (Only four Hours).

caused

2009-11-27 20:57:38

From: WT-Fakawi
Its just a thought. Plant do tkae forever to grow, indeed. Two days…three days..might not be worth running a script for such a long period of time. But on the other hand, since time is of no importance for us…..

Let me first play this game for a couple of days…ideas will pop up for sure!


You could also add thousands of neighbors.

And while it sits around and waits for the crops to grow, It first spends the money it got for experience and than it could visit the neighbors farms and gain experience.

This kind of bot would be able to run effectively 24/7 !!

~caused

nickrules

2009-11-28 14:27:32

From: Dr D. Dervish
Why bot farmville though ? :S

You only farm and then have to wait no ?


The idea is, it takes maybe 20 minuets to manage your farm, if its really big. Sometimes, you just dont have that long. So, you would run this script, and it would quickly plant, plow, etc.

From: pitx
how do i stop this error when trying to run/compile

Line 51: [Error] (51:11): Unknown identifier 'CreateTPAFromBMP' in script C:\Program Files\SCAR 3.22\includes\SRL\SRL\Core\Math.scar

Yeah, caused is probably right about your problem, because my bot does not use TPAs or Bitmaps…. so yeah. lol

There will be a new version of this script soon by the way :D

pitx

2009-11-28 17:39:28

soo what should i do to be able to run the script? :S sorry im new to scar lol

Xanith

2009-11-30 21:24:02

Ohh my, this is simply amazing. It helped me get Grape mastery ^.^

I think I'm in love with you.

TravisV10

2009-12-04 21:58:24

Hi! I've been using your FarmVille bot for a while. (mostly version 1.2 i think)

I'd use it to occasionally pick for me and plow.

Now that I downloaded the new script, I have trouble targeting FarmVille. Any ideas?
(sorry I haven't been active at the forums so I'm a complete noob)

EDIT: It's not the script that has anything to do with targeting, I know that.

lordsaturn

2009-12-06 14:06:52

Fawki, if you're going to make a subforum for farmville, please expand it to facebook bots. Because there are plenty of games on fb like this one that have the potential to be automated.

WT-Fakawi

2009-12-06 14:31:43

Yep. Good thought. Will be done within a few weeks. Stay tuned.

mrpickle

2009-12-06 21:23:06

I 100% support this. :)

iden1050

2009-12-11 13:11:12

I've been looking for a script for farmville for so long!

sevalsancak

2009-12-22 17:41:48

I cant sell hayballs please help me ? what can I doing?

nickrules

2009-12-23 09:47:01

From: sevalsancak
I cant sell hayballs please help me ? what can I doing?


sure, thats an easy fix. I updated the procedure for you. All i really did was modify one line, but i dont know what line that is for you because i have a modified version of the script. Paste this in place of the procedure SellAllHaybales

procedure SellAllHaybales(Sender: TObject);
var left,right,up,down:Boolean;
var x,y: Integer;
begin
writeLn('PROCEDURE SellAllHaybales(sender: TObject); STARTED AT '+THETIME);
writeDB('Selling haybales!');
wait(500)
Cmouse(732,505);
repeat
if FindColor(x,y,1532070,0,0,761,493) then
begin
Cmouse(x,y)
wait(400)
cmouse(301,392)
wait(400)
end else
begin
if not left then L
else if not down then D
else if not up then U
else if not right then UR
else break;
end;
until (isfkeydown(4));
WriteDB('Haybales Sold!');
writeLn('PROCEDURE SellAllHaybales(sender: TObject); ENDED AT '+THETIME);
end;

mc_teo

2010-01-06 09:15:23

when i run the bot, and set the client as the flash game itself, it just moves the mouse to the top left of the screen, and clicks there repeatedly…

I have the Planter there, and i think the brown colour of the back is confusing it?

and then i cant get the bot to stop, using ctrl+alt+s…

is this a known bug, or something im doing wrong.

p.s. nice form

EDIT: Moved the Planter to the bottom and pressed F4 and it started properly. Worked great, except ive the biggest available size and most of it for crops, so the cornors, were left out, but i moved it over and reset it, and it worked grand. Planted perfect too

Wolvy

2010-01-09 20:19:32

I don't know if I am doing something wrong, but the script just clicks everywhere on my screen causing a chaos :D. Once it got stuck and I had to relog on my windows user.

nickrules

2010-01-20 08:04:26

From: Wolvy
I don't know if I am doing something wrong, but the script just clicks everywhere on my screen causing a chaos :D. Once it got stuck and I had to relog on my windows user.


I have never had issues with something like that, so its probably your fault, lol.

also, i have no idea how it would act in fullscreen… so i wouldn't suggest it.
sorry for any issues that may have caused for your farm. i know how long it takes to fix all that…

mrpickle

2010-01-20 21:20:13

I just took another quick browse through your script… and it's killer to the eyes!
"STANDARDS!!!!"



@ Wolvy
make sure you look at the "how to setup scar" tutorial :).
&
The stuck thing happens when you minimize and maximize the window after selecting the client.
It's when the mouse tries to click inside the targetted when it is "non-existant" so you get that mouse issue.
just press alt+F4 repeatly until you got scar stopped.

nickrules

2010-02-14 00:58:36

Updated…. Barely. Tell me bugs, or fix them yourself and post here ;) Mouse is slower to prevent lag. Stats uploaded to the internet.

Also, i would like a banner which displays the plowed, planted, harvested, haybayles created, and animal harvests from this page: http://scriptmanager.freehostia.com/scripts.php?sid=34 to a picture which updates like every 12 hours….. how can I do this? or can someone do it for me? that would be awesome, thanks.

From: mrpickle

@ Wolvy
make sure you look at the "how to setup scar" tutorial :).
&
The stuck thing happens when you minimize and maximize the window after selecting the client.
It's when the mouse tries to click inside the targetted when it is "non-existant" so you get that mouse issue.
just press alt+F4 repeatly until you got scar stopped.


F4 alone will stop any script I make, as i implement that as the stop key always. F3 will pause too, but it must be held down, which can cause problems with other windows.

Main

2010-02-15 20:54:59

I dowloaded 1.4 It didn't compile for moi, I am narb at scar :o