Page 1 of 2

Archage harvest, plant, spamMSG & antiAFK support script

Posted: Mon Oct 27, 2014 4:04 pm
by d003232
HARVEST, PLANT, SPAM MESSAGE & ANTIAFK support script v1.51 for Archeage
================================================

Version 1.51 is the last update of the script. I decidedt to stop playing AA.

You need MM2 to use that script. Download MM2 here:

That script is not a BOT, it just supports some things:
- planting in rows and columns in plant mode
- spams the harvesting key in harvest mode
- spam messages to the chat
- presses an antiAFK key while in idle mode
- claim a spot by using design, place it at a spot and press confirmation button

You can toogle between different modes. In harvest mode there is a 'move forward' option to walk some steps after a spot is finished. Different options like field-size, distance between plant spots, start point, ... can be stored in plant-sets (you have to the script for that).

Default keys (edit the script to change that)
F4 - switch planting set
F5/F6 - increase/decrease x value between planting spots (columns)
F7/F8 - increase/decrease y value between planting spots (rows)
F10 - toogle mode: harvest / plant / message spam /claim spot/endless harvest&plant
F11 - start/pause
R - toogle 'move option' in harvest mode on/off
T - test key (show window/cursor information)
Y - (put your seeds to that key at the UI)
F - harvesting key

IMPORTANT:
  • In message spam mode no special characters (like %!()= etc) are supported!
  • It's not a ready to use script! You need to change the parameters to your needs. Depending from your plants, field-size, screen-size, viewpoint ...

Have Fun
Stephen

EDIT:
24.11 v1.51 add endless plant/harvest mode to just stands and plant/harvest around the character / add offset option for even&odd rows
18.11 v1.50 add claim spot mode, first test with pixel color
15.11 v1.41 add global script timer, use keyboard.virtualType to spam messages for MM2 v1.91 and higher
07.11 v1.4 add 'spam messages to chat mode', minor changes
05.11. v1.31 separate tuning factor for x & y / Test key will show cursor position / some little bugs in calcuation of distance between rows
03.11. v1.3 add new key to toggle 'move during harvest' on/off, new option to tune x/y distance depending from distance while planting
31.10. v1.2 add: anti afk, inc/dec x/y values with key, use planting sets for various fields/plants
28.10. v1.1 add an option to move forward during harvest

Credits to Lisa: I used his harvesting script as an template

Re: harvesting & planting support script

Posted: Mon Oct 27, 2014 6:35 pm
by lisa
I haven't tested it yet.

Code: Select all

	keyboard.virtualPress(win, p_harvestKey);		
	keyboard.virtualRelease(win, p_harvestKey);	
You can use the 3rd arg for virtualPress so you don't need the release. The way admin explained it is that default usage of press will press the key and then release it at the end of macro.main() but to make it release 50ms after pressing you add 3rd arg and have the value as false.

Code: Select all

	keyboard.virtualPress(win, p_harvestKey,false);	
Some things I considered when doing my planting script is that the planting is done according to position on screen and not how the game itself looks, so in order to work effectively you need to have camera in the same position each time, ie. directly above character and fully zoomed out, any adjustment to zoom or camera angle would affect if the planting is successful or not.

I also did some testing with manually planting and having the script record the location of the mouse when it clicks, so you basically save the location where you do plant things, so it would just repeat those locations each time, handy if your hidden and planting on a non flat surface. It was working pretty well but if you get bumped by any other people then it gets messed up.

For the shortcut key what I did was change to action bar 4 and just have the seeds in the action bar and use 1,2,3,4.. for each plant.

I think though at the end of the day since we can't get any info from the game any script for planting will be good for the person creating it but others might find it problematic unless they copy the exact circumstances of the creator.

Re: harvesting & planting support script

Posted: Tue Oct 28, 2014 7:47 am
by d003232
lisa wrote:

Code: Select all

	keyboard.virtualPress(win, p_harvestKey,false);	
Thx for that hint. I will test that.
lisa wrote:I think though at the end of the day since we can't get any info from the game any script for planting will be good for the person creating it but others might find it problematic unless they copy the exact circumstances of the creator.
Yes it not a ready usable script. One have to change the parameters depending from the own use. I mostly use if in open space areas. Not in my own garden. And I use small plants. One has to change all that parameters depending from the own needs.

Re: harvesting & planting support script

Posted: Thu Oct 30, 2014 4:56 am
by lisa
ok been testing/running it a bit and I have some suggestions you may or may not want to do, I already did them in mine =)

Have it so when harvesting if the harvest key is pressed then it resets the time, (if you move manually you can do 1 key press and it will continue efficiently instead of wasting time.

Set up some keys to increase/decrease the x y distance for planting, so if you know your on a slope you can adjust the distances without having to edit the .lua and then restart the script.

Instead of purely waiting for the pause key to be pressed to continue, have it do anti afk code, so you never get booted.

Re: harvesting & planting support script

Posted: Thu Oct 30, 2014 5:17 am
by d003232
lisa wrote:Have it so when harvesting if the harvest key is pressed then it resets the time, (if you move manually you can do 1 key press and it will continue efficiently instead of wasting time.

Set up some keys to increase/decrease the x y distance for planting, so if you know your on a slope you can adjust the distances without having to edit the .lua and then restart the script.

Instead of purely waiting for the pause key to be pressed to continue, have it do anti afk code, so you never get booted.
Dmnd. I did'nt really understand what you are meaning with your first point? 'reset the time' ... One can set the parameter _move_for_harvest = false then the harvest key will always be spamed every ~300ms

Second point ok. Need 4 more key settings.

I also dont understand the third point. Isn't that the same as point one? Set parameter _move_for_harvest = false and it will be spamed endlessly.

You could post your code? :-)

Re: harvesting & planting support script

Posted: Thu Oct 30, 2014 5:35 am
by lisa
in macro.event()

Code: Select all

		if task == "harvest" and running and data1 == p_harvestKey then
			hf_lastActionTime = time.getNow()
		end
if you are in harvest mode and running and you press the key yourself that would harvest it resets the harvest timer.

At the moment if MM has nothing to harvest and you move then it will waste the 5 seconds because it thinks it is harvesting. With that code you can manually move and manually press harvest key, MM will continue on as is if it did the key press.

When you do this.

Code: Select all

		print("Planting finished")	
		printf("Press "..keyboard.getKeyName(pauseKey).." to restart/pause.\n");
Have it start code that is for anti idle, key presses occasionally like in Admins script.

Re: harvesting & planting support script

Posted: Thu Oct 30, 2014 1:58 pm
by d003232
lisa wrote:in macro.event()

Code: Select all

		if task == "harvest" and running and data1 == p_harvestKey then
			hf_lastActionTime = time.getNow()
		end
if you are in harvest mode and running and you press the key yourself that would harvest it resets the harvest timer.
I understand what you mean. I think its not needed anymore. I now spam the harvest key every ~300 ms. So there is no waste time or need to press the key manualy. Perhaps it would be helpful to have a key to change the mode to 'no automatic move'?

lisa wrote:Have it start code that is for anti idle, key presses occasionally like in Admins script.
You mean instead to go to a totaly pause mode to go to some idle mode with anti AFK? Means to press some button every 2 minutes?

Re: harvesting & planting support script

Posted: Thu Oct 30, 2014 7:05 pm
by d003232
Add v1.2.

See first post.

Re: harvesting & planting support script

Posted: Fri Oct 31, 2014 2:28 am
by franek
Well, I do not know how to properly use this script. Can you make a short video or something to show? Also, I do not get how to configure the whole script for other plants, etc.

EDIT: Nevermind, I do get it ;)

Re: harvesting & planting support script

Posted: Mon Nov 03, 2014 11:24 am
by wilifox
is possible to program a script to just click left mouse? ty

Re: harvesting & planting support script

Posted: Mon Nov 03, 2014 12:31 pm
by d003232
wilifox wrote:is possible to program a script to just click left mouse? ty
Sure. Take a look at the plant script and you will get how to click left / right mouse button.

Re: harvesting & planting support script

Posted: Mon Nov 03, 2014 12:49 pm
by wilifox
ok ty very much!! ;)

Re: harvesting,planting & antiAFK support script

Posted: Mon Nov 03, 2014 2:44 pm
by d003232
Add v1.3.

See first post.

Re: harvesting,planting & antiAFK support script

Posted: Mon Nov 03, 2014 4:22 pm
by wilifox
The next update ;) "Planting House" ;) Txy very much! ;)

Re: harvesting,planting & antiAFK support script

Posted: Mon Nov 03, 2014 9:40 pm
by ZZZZZ
wilifox wrote:The next update ;) "Planting House" ;) Txy very much! ;)
I found the mouse position and just added another hotkey to admins aaa script to spam click where the confirmation screen should be. Still has nothing against all these fkers using that land hack addon though :/

Code: Select all


if spamMouse == true then
					mouse.press(key.VK_LMOUSE)
				end

----

elseif( data1 == mouseSpamPos ) then
			if spamMouse == false then
				print("Spaming mouse at X: 916 / Y: 753")
				mouse.setPosition(916, 753)
				counter = 1
				spamMouse = true
			else
				spamMouse = false
			end
		elseif ( data1 == mouseCheckPos ) then
			print("Mouse Position: ", mouse.getPosition())
		end	
^ just the parts to deal with spamming it. Would have to add it in yourself and edit the mouse position etc.

Re: harvesting,planting & antiAFK support script

Posted: Tue Nov 04, 2014 2:50 pm
by wilifox
How to know what is my mouse position? Ty

Re: harvesting,planting & antiAFK support script

Posted: Wed Nov 05, 2014 3:26 am
by d003232
wilifox wrote:How to know what is my mouse position? Ty
See plant.lua v1.31 above. I added a test key (default T) witch will print the cursor position.

Code: Select all

hf_x, hf_y = mouse.getPosition()
			printf("window position "..wx.."/"..wy.." window size "..wwide.."/"..whigh)
			printf(" cursor position at "..hf_x.."/"..hf_y.."\n")

Re: harvesting,planting & antiAFK support script

Posted: Wed Nov 05, 2014 5:49 am
by wilifox
ty, only one question. Hackshield detect micromacro? :P

Re: harvesting,planting & antiAFK support script

Posted: Fri Nov 07, 2014 4:17 am
by Micke
d003232 wrote:I added a test key (default T) witch will print the cursor position.
someone know a way to open the window with the confirm button ? a call or extract it from the game_pak - to verify the button position.

Re: harvesting,planting, spamMSG & antiAFK support script

Posted: Fri Nov 07, 2014 3:01 pm
by d003232
Add v1.4.

New message spam mode.