How to use the TurnTo function from bindings

Find comprehensive JavaScript bindings.TurnTo code examples handpicked from public code repositorys.

130
131
132
133
134
135
136
137
138
139
cga.turnDir = function(dir){
        var xy = cga.GetMapXY();
        var x = xy.x;
        var y = xy.y;
        switch(dir){
                case 0: cga.TurnTo(x+2, y);break;
                case 1: cga.TurnTo(x+2, y+2);break;
                case 2: cga.TurnTo(x, y+2);break;
                case 3: cga.TurnTo(x-2, y+2);break;
                case 4: cga.TurnTo(x-2, y);break;
fork icon35
star icon0
watch icon1

+ 15 other calls in file

205
206
207
208
209
210
211
212
213
214
        }
}
        
cga.turnDir = cga.turnOrientation = (orientation, offset = 2) => {
        var pos = cga.getOrientationPosition(orientation, offset);
        cga.TurnTo(pos[0], pos[1]);
}

/*  异步登出回城
        由于2022年1月18日的一次更新之后登出回城有可能失败,故所有脚本中的登出回城操作均推荐更改为异步操作
fork icon33
star icon44
watch icon5

+ 7 other calls in file

Other functions in bindings

Sorted by popularity

function icon

bindings.createKey is the most popular function in bindings (8616 examples)