b0r3d0m wrote:...simple way to write scripts (even if you don't know much about programming at all)...
![Trollface ¦]](./images/smilies/troll.gif)
As I spent evening yesterday I wasn't able to stop coming back to this line. Well done, Sir

I'm pretty sure you're overestimating the audience ))
anyhow... you said we can ask for help.
here is n00b question:
I took your sample code, commented out all hooks (insides) except onLoad and tried to make it to walk.
- Code: Select all
var zero_x = null;
var zero_y = null;
....
function onGameLoaded(game) {
print('Game loaded');
g = game;
print('Starting autowalking...');
// g.sendVillageChatMessage ('Accepting coordinates as relative zero point...')
var playerCoords = g.getPlayerCoords();
print('start: [' +playerCoords.x + ' , ' + playerCoords.y + ']');
setZeroCoords(g.getPlayerCoords());
goTo(15,15);
goTo(15,-15);
goTo(-15,-15);
goTo(-15,15);
goTo(15,15);
playerCoords = g.getPlayerCoords();
print('new: [' +playerCoords.x + ' , ' + playerCoords.y + ']');
//startAutoWalking();
}
.......
function setZeroCoords(coords){
zero_x = coords.x;
zero_y = coords.y;
}
function goTo(x,y){
print('walking to ['+ x +','+ y +']');
g.goTo(zero_x+x,zero_y+y);
g.waitForPf;
}
Expectation:
Character should
- report starting coordinates
- walk in a square loop reporting each time.
- report end coordinates
Actual result:
- report starting coordinates
Character does one move, probably the first one, calls all other steps and doesn't move.
- report end coordinates
-------
What am I doing wrong?