I am using the example script made by Vis,
so that the personagen flies up the site and then goes to the local procimo indicated without taking the herbs who are close to the location indicated in cordenadas made in the script Robot
# -*- coding: utf-8 -*-
# See
[Only registered and activated users can see links. Click Here To Register...] for a Scripting Tutorial
#
# this script farms some resources in the north of city of the lost
import time
# helper functions ################################################## ###########
# call a scriptapi function
def scriptapi_call(fnname, *params):
import zmq
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect('tcp://127.0.0.1:6000')
socket.send_pyobj([fnname] + list(params))
return socket.recv_pyobj()
# resource positions (name, x, z) ##############################################
resources = [['Antidoto', 359, 716],
['Antidoto', 343, 734],
['Antidoto', 313, 761],
['Antidoto', 310, 778],
['Antídoto', 302, 728]]
# resource farming ################################################## ###########
# do it forever
while True:
# for each resource:
for [name, x, z] in resources:
# walk to the coordinates
print 'walking to', name, 'at', [x, z]
scriptapi_call('do_player_moveto', [x, 0, z])
# find closest item by name (if any)
item = scriptapi_call('get_surr_item_closest_byname', name)
if item:
# walk closer to it, farm it, wait until done
print 'resource found:', name
scriptapi_call('do_player_moveto', item['pos'])
scriptapi_call('do_player_pick', item)
time.sleep(12)
scriptapi_call('set_player_targetid', 0)
print 'resource farmed:', name
#items = scriptapi_call('get_surr_items')
#scriptapi_call('do_player_moveto', items[0]['pos'])
#scriptapi_call('do_player_pick', items[0])