My bad, mistery solved
Thanks b0r3d0m o/
Code: Select all
var g = null;
var autoWalkingTimerId = null;
function onClientStarted() {
var options = {
renderingEnabled: true
};
return options;
}
function onLogin() {
print('Logging in...');
var credentials = {
login: 'x',
password: 'x'
};
return credentials;
}
function onCharSelect() {
print('Selecting character...');
return 'x';
}
function onGameLoaded(game) {
print('Game loaded');
g = game;
for (i = 0; i < 48; i++){
lc()
sleep(500);
pieprz(i);
sleep(500);
}
}
function pieprz(rid){
var kolba = g.getMapObjects('trellis');
g.mapObjectRightClick(kolba[rid].id);
g.chooseFlowerMenuOption(Harvest);
g.waitForPf();
g.waitForTaskToFinish();
}
function lc(){
var skrzynia = g.getMapObjects('largechest');
g.mapObjectRightClick(skrzynia[0].id);
g.waitForPf();
g.transferItems('peppercorn');
g.waitForTaskToFinish();
sleep(500);
}
function picie(){
if (g.getStamina() < 50){
print('Brak staminy');
g.drink();
}
}
This line seems to be defective.UzU123 wrote:
g.chooseFlowerMenuOption(Harvest);
I think you mean that I forgot to write like this ('Harvest') with "" but I added it and still it doesn't work. Bot opens LC, puts harvested (by me manually) pepper, tries to go to trellis but after it reaches one of many trellises stops and comes back to LC, opens it and etc.Granger wrote:This line seems to be defective.UzU123 wrote:
g.chooseFlowerMenuOption(Harvest);
Tried it also. I changed "trellis" to "pepper" and still nothing.Granger wrote:Maybe you should target the plant, not the trellis.
Code: Select all
var stojak = g.getMapObjectsByFullName('gfx/terobjs/plants/pepper');You should use that so it doesn't get confused with pepper on the floor. You should also check if the pepper is harvestable (correct stage). I can't help you test this ingame at the moment, sorry.UzU123 wrote:Tried it also. I changed "trellis" to "pepper" and still nothing.Granger wrote:Maybe you should target the plant, not the trellis.
Should I use something like this? Or it won't work?Code: Select all
var stojak = g.getMapObjectsByFullName('gfx/terobjs/plants/pepper');
Code: Select all
var g = null;
var autoWalkingTimerId = null;
function onClientStarted() {
var options = {
renderingEnabled: true
};
return options;
}
function onLogin() {
print('Logging in...');
var credentials = {
login: 'x',
password: 'x'
};
return credentials;
}
function onCharSelect() {
print('Selecting character...');
return 'x';
}
function onGameLoaded(game) {
print('Game loaded');
g = game;
for (i = 0; i < 48; i++){
lc()
sleep(500);
pieprz(i);
sleep(500);
}
}
function pieprz(rid){
var kolba = g.getMapObjectsByFullName('gfx/terobjs/plants/pepper');
g.mapObjectRightClick(kolba[rid].id);
g.chooseFlowerMenuOption('Harvest');
g.waitForPf();
g.waitForTaskToFinish();
}
function lc(){
var skrzynia = g.getMapObjects('largechest');
g.mapObjectRightClick(skrzynia[0].id);
g.waitForPf();
g.transferItems('peppercorn');
g.waitForTaskToFinish();
sleep(500);
}
function picie(){
if (g.getStamina() < 50){
print('Brak staminy');
g.drink();
}
}