Moderator: Phades
XXXXX
XLLLX
XLCLX
XLLLX
XXXXX
XLLLX
XLCLX
XLLLX
XLLLX
XXXXX
private Coord localToReal(Coord lc) {
Gob pl = ui.sess.glob.oc.getgob(mv.playergob);
if (pl == null) return Coord.z;
// MAGIC!~
return pl.rc.add(lc.sub(pl.rc.div(tileSize).add(mv.mc.div(tileSize).add(off.div(scales[scale])).inv()).add(sz.div(scales[scale]).div(2))).mul(tileSize));
}
public void draw(GOut og) {
double scale = getScale();
Coord hsz = sz.div(scale);
Coord tc = mv.mc.div(tileSize).add(off.div(scale));
Coord ulg = tc.div(cmaps);
while ((ulg.x * cmaps.x) - tc.x + (hsz.x / 2) > 0)
ulg.x--;
while ((ulg.y * cmaps.y) - tc.y + (hsz.y / 2) > 0)
ulg.y--;
if (!hidden) {
Coord s = bg.sz();
for (int y = 0; (y * s.y) < sz.y; y++) {
for (int x = 0; (x * s.x) < sz.x; x++) {
og.image(bg, new Coord(x * s.x, y * s.y));
}
}
}
GOut g = og.reclip(og.ul.mul((1 - scale) / scale), hsz);
g.gl.glPushMatrix();
g.scale(scale);
synchronized (caveTex) {
for (int y = ulg.y; (y * cmaps.y) - tc.y + (hsz.y / 2) < hsz.y; y++) {
for (int x = ulg.x; (x * cmaps.x) - tc.x + (hsz.x / 2) < hsz.x; x++) {
Coord cg = new Coord(x, y);
if (mappingStartPoint == null) {
mappingStartPoint = new Coord(cg);
}
Grid grid;
synchronized (ui.sess.glob.map.req) {
synchronized (ui.sess.glob.map.grids) {
grid = ui.sess.glob.map.grids.get(cg);
if (grid == null)
ui.sess.glob.map.request(cg);
}
}
Coord relativeCoordinates = cg.sub(mappingStartPoint);
String mnm = null;
if (grid == null) {
mnm = coordHashes.get(relativeCoordinates);
} else {
mnm = grid.mnm;
}
Tex tex = null;
if (mnm != null) {
caveTex.clear();
if (!gridsHashes.containsKey(mnm)) {
if ((Math.abs(relativeCoordinates.x) > 450)
|| (Math.abs(relativeCoordinates.y) > 450)) {
newMappingSession();
mappingStartPoint = cg;
relativeCoordinates = new Coord(0, 0);
}
gridsHashes.put(mnm, relativeCoordinates);
coordHashes.put(relativeCoordinates, mnm);
} else {
Coord coordinates = gridsHashes.get(mnm);
if (!coordinates.equals(relativeCoordinates)) {
mappingStartPoint = mappingStartPoint
.add(relativeCoordinates
.sub(coordinates));
}
}
tex = getgrid(mnm);
if ((tex == null) && (grid != null)) {
tex = grid.getTex();
}
} else {
if (grid != null) {
tex = grid.getTex();
if (tex != null) {
caveTex.put(cg, tex);
}
}
tex = caveTex.get(cg);
}
// caveTex.isEmpty();
if (tex == null)
continue;
if (!hidden)
g.image(tex, cg.mul(cmaps).add(tc.inv())
.add(hsz.div(2)));
}
}
}
// grid
if (grid && !hidden) {
g.chcolor(200, 32, 64, 255);
Coord c1, c2;
c1 = new Coord();
c2 = new Coord(hsz.x, 0);
for (int y = ulg.y + 1; (y * cmaps.y) - tc.y + (hsz.y / 2) < hsz.y; y++) {
c1.y = (y * cmaps.y) - tc.y + (hsz.y / 2);
c2.y = c1.y;
g.line(c1, c2, 1);
}
c1 = new Coord();
c2 = new Coord(0, hsz.y);
for (int x = ulg.x + 1; (x * cmaps.x) - tc.x + (hsz.x / 2) < hsz.x; x++) {
c1.x = (x * cmaps.x) - tc.x + (hsz.x / 2);
c2.x = c1.x;
g.line(c1, c2, 1);
}
g.chcolor();
}
// end of grid
if ((!plx.loading) && (!hidden)) {
synchronized (ui.sess.glob.party.memb) {
for (Party.Member m : ui.sess.glob.party.memb.values()) {
Coord ptc = m.getc();
if (ptc == null)
continue;
ptc = ptc.div(tileSize).add(tc.inv()).add(hsz.div(2));
g.chcolor(m.col.getRed(), m.col.getGreen(),
m.col.getBlue(), 128);
g.image(plx.layer(Resource.imgc).tex(),
ptc.add(plx.layer(Resource.negc).cc.inv()));
g.chcolor();
}
}
}
if (!hidden) {
if (Config.show_minimap_radius) {
KerriUtils.drawVisSquare(g, tc, hsz);
}
if (Config.show_minimap_profits) {
KerriUtils.drawProfitMinimap(g, tc, hsz);
KerriUtils.drawHerbsMinimap(g, tc, hsz);
}
if (Config.show_minimap_players) {
KerriUtils.drawPlayersAtMinimap(g, tc, hsz);
}
}
g.gl.glPopMatrix();
super.draw(og);
}
//#! tooltip = Chop trees and stack them
//#! name = Chop trees and stack them
//#! uniq = dfccd2e6-1cd5-495d-8947-chopper
/********** Usage recommendation : **********
- chop a tree, and place one log somewhere.
- launch the script select the log.
- your character will gather nearby logs, and if can't find / or reach any, will chop a tree, and repeat this.
*/
include("jBotAPI");
var work = jSelectObject("Select an object where you'll work.");
trees_names = [
'terobjs/trees/fir/fir06',
'terobjs/trees/pine/06'
];
function main(){
PFto(work);
while(1){
PFto(work);
gather_logs();
PFto(work);
cut_tree();
}
}
function cut_tree(){
sayArea("I'll fell some tree");
trees = jGetObjects(5000, jCoord(0,0), trees_names);
lowest_distance = 9999999999;
sayArea("Hmm, which one is the closest of these "+ trees.length + "?");
for(var i = 0; i < trees.length; i++){
try{
distance = trees[i].position().dist(work.position());
if(distance < lowest_distance){
target_tree = trees[i];
lowest_distance = distance
}
}catch(e){}
}
sayArea("I'll go for this one ("+lowest_distance+")...");
PFto(target_tree)
jSleep(500);
target_tree.doClick(3,0);
jSleep(500);
jWaitPopup();
jSelectContextMenu("Chop");
jWaitProgress(35000);
}
function gather_logs(){
all_logs = get_logs_away_from_work();
for(var i = 0; i < all_logs.length; i++){
log_item = all_logs[i];
if(!log_item){continue;}
if(PFto(log_item)){
jSendAction("carry");
jWaitCursor("chi");
log_item.doClick(1, 0);
jWaitMove();
jSleep(200);
PFto(work);
}
}
sayArea("Ah, there are no around, chopping time.");
}
function PFto(item){
jAbsClick(item.position(), 1, 0);
jSleep(500);
jWaitEndMove(50000);
jPFClick(item.getID());
old_distance = 9999999999;
distance = 0;
while(distance + 1 < old_distance){
old_distance = jMyCoords().dist(item.position());
item.doClick(1,0);
jPFClick(item.getID());
jSleep(2500);
distance = jMyCoords().dist(item.position());
}
jClosePopup();
if(distance > 20){
sayArea("I can't reach this place :(");
return false;
}else{
return true;
}
}
function get_logs_away_from_work(){
var logs = jGetObjects(5000, jCoord(0,0), "/trees/log");
log("[+]There are " + logs.length + " logs nearby.");
all_logs = [];
for(var i = 0; i < logs.length; i++){
distance = logs[i].position().dist(work.position());
if(distance > 5){
sayArea("Cool, I've found a log");
all_logs.push(logs[i]);
}
}
return all_logs;
}
function go_to_ground_object_with_pathfinding(item){
if (item == null){
return false;
}
jPFMove(item.position());
waitPFEndMove();
if(jMyCoords().dist(item.position()) < 40){
error_log("I'm on it");
return true;
}else{
error_log("Can't reach it");
return false;
}
}
function checkInventory() {
if(!jHaveWindow("Inventory")) {
jToggleInventory();
while(!jHaveWindow("Inventory")) jSleep(100);
}
return jGetWindow("Inventory").getInventories()[0];
}
function log(text){
jInGamePrint(text);
jSleep(500);
}
function error_log(text){
jPlayBeep(500);
jInGamePrint('[!] ' + text);
jSleep(5000);
}
function resetCursor() {
if (!jIsCursor("arw")) {
jAbsClick(jCoord(0, 0), 3, 0);
jWaitCursor("arw", 500);
}
}
function waitPFMove(){
jWaitStartMove(300);
jSleep(100);
while (true) {
jWaitEndMove(10000);
jSleep(200);
if (!jIsMoving()) {
return;
}
}
}
main();
Mernil wrote:I did look at clients geolocation, it's often by uploading tiles to a map server to get it's position on global map, so that won't help.
Here is a script to chop and haul treees.
Even though it has issues with stones and sometime with path finding It works quite well.
I had issues with pathfinding main function so I used PFClick (which does the trick).
Usage :
- chop a tree, and place one log somewhere.
- launch the script select the log.
- your character will gather nearby logs, and if can't find / or reach any, will chop a tree, and repeat this.
TODO :
- remove stones
- equip shovel if any, remove stumps and stack blocks somewhere (maybe a woodwall initial corner post).
- drink water when neeeded.
- stop working when too hungry.
- Code: Select all
//#! tooltip = Chop trees and stack them
//#! name = Chop trees and stack them
//#! uniq = dfccd2e6-1cd5-495d-8947-chopper
/********** Usage recommendation : **********
- chop a tree, and place one log somewhere.
- launch the script select the log.
- your character will gather nearby logs, and if can't find / or reach any, will chop a tree, and repeat this.
*/
include("jBotAPI");
var work = jSelectObject("Select an object where you'll work.");
trees_names = [
'terobjs/trees/fir/fir06',
'terobjs/trees/pine/06'
];
function main(){
PFto(work);
while(1){
PFto(work);
gather_logs();
PFto(work);
cut_tree();
}
}
function cut_tree(){
sayArea("I'll fell some tree");
trees = jGetObjects(5000, jCoord(0,0), trees_names);
lowest_distance = 9999999999;
sayArea("Hmm, which one is the closest of these "+ trees.length + "?");
for(var i = 0; i < trees.length; i++){
try{
distance = trees[i].position().dist(work.position());
if(distance < lowest_distance){
target_tree = trees[i];
lowest_distance = distance
}
}catch(e){}
}
sayArea("I'll go for this one ("+lowest_distance+")...");
PFto(target_tree)
jSleep(500);
target_tree.doClick(3,0);
jSleep(500);
jWaitPopup();
jSelectContextMenu("Chop");
jWaitProgress(35000);
}
function gather_logs(){
all_logs = get_logs_away_from_work();
for(var i = 0; i < all_logs.length; i++){
log_item = all_logs[i];
if(!log_item){continue;}
if(PFto(log_item)){
jSendAction("carry");
jWaitCursor("chi");
log_item.doClick(1, 0);
jWaitMove();
jSleep(200);
PFto(work);
}
}
sayArea("Ah, there are no around, chopping time.");
}
function PFto(item){
jAbsClick(item.position(), 1, 0);
jSleep(500);
jWaitEndMove(50000);
jPFClick(item.getID());
old_distance = 9999999999;
distance = 0;
while(distance + 1 < old_distance){
old_distance = jMyCoords().dist(item.position());
item.doClick(1,0);
jPFClick(item.getID());
jSleep(2500);
distance = jMyCoords().dist(item.position());
}
jClosePopup();
if(distance > 20){
sayArea("I can't reach this place :(");
return false;
}else{
return true;
}
}
function get_logs_away_from_work(){
var logs = jGetObjects(5000, jCoord(0,0), "/trees/log");
log("[+]There are " + logs.length + " logs nearby.");
all_logs = [];
for(var i = 0; i < logs.length; i++){
distance = logs[i].position().dist(work.position());
if(distance > 5){
sayArea("Cool, I've found a log");
all_logs.push(logs[i]);
}
}
return all_logs;
}
function go_to_ground_object_with_pathfinding(item){
if (item == null){
return false;
}
jPFMove(item.position());
waitPFEndMove();
if(jMyCoords().dist(item.position()) < 40){
error_log("I'm on it");
return true;
}else{
error_log("Can't reach it");
return false;
}
}
function checkInventory() {
if(!jHaveWindow("Inventory")) {
jToggleInventory();
while(!jHaveWindow("Inventory")) jSleep(100);
}
return jGetWindow("Inventory").getInventories()[0];
}
function log(text){
jInGamePrint(text);
jSleep(500);
}
function error_log(text){
jPlayBeep(500);
jInGamePrint('[!] ' + text);
jSleep(5000);
}
function resetCursor() {
if (!jIsCursor("arw")) {
jAbsClick(jCoord(0, 0), 3, 0);
jWaitCursor("arw", 500);
}
}
function waitPFMove(){
jWaitStartMove(300);
jSleep(100);
while (true) {
jWaitEndMove(10000);
jSleep(200);
if (!jIsMoving()) {
return;
}
}
}
main();
Pickard wrote://////////////////////////////////////////////
// Bunin Flameforge
//////////////////////////////////////////////
This is intellectual property theft
Because
//////////////////////////////////////////////
// cdev
//////////////////////////////////////////////
originally![]()
PS Isnt ForagingBotMaker beautiful?
PPS There are How To Use docs
Foraging_howto.txt:
- Code: Select all
The bot, which collects all the useful Curio everywhere + can guard area from rams. (v3.0)
How to configure:
I. Copy ForagingBotMaker.jbot and JBotAPI.japi into scripts folder (works with 7.2c). if you try to launch it using older
version client - add the lines after //cdev into your version's JBotAPI,japi.
II. Make an cool alt with a badass name, survival, perception and trespassing if you’re going to forage claimed area.
Do not forget to buy “Foraging” skill. For a mountain you’ll need exp*perc 6400, 2100 for a swamp, 440 for the
bolletes and floatsoams, 3040 for river pearl mussels.
III. Put a fire near the swamp (deeper into the swamp - better, less chance to be fucked by a bear) on the mountain and so on.
At the lake you can put a fire on the beach, but there is a chance that your boat will be stolen. So it is better
to put it deeper in the forest but place it where there is nothing between the HF and the water. Moreover, it is
better to personal claim the path from the HF to the river which decreases the chance of the boat being stolen or
meeting a wild animal.
IV. Run the script "Foraging Bot Maker"
V. Select the needed collection mode: “Mountain”, “Swamp”, “Cave”, “Forest”, “Lake”, “OmgWipe”.
“OmgWipe” include - WWW (swamp, forest, meadow, prairie), Nettle (the forest), Clover (prairie, steppes)
and Candleberry (swamp).
VI. Write the name of the region in the first field, such as Mountain [33, 80] or Stinky swamp.
VII. Enter your account name and the name of your character in the second and third fields (of course without a
password/ braces/ gaps/ and other crap) exactly as it appears in the union client. By the way, the character
names (logged in at least once) can be seen as buttoms on the started menu of the Union client.
VIII. Select the needed curiosities and minimal quality for each. Everything lower quality will be thrown away.
It is suitable for gathering spider webs. For instance you could gather WWW or blueberries in the forrest, but
make the minimal quality for it as 100.
IX. Click Start, and wait for the teleport to the hearth fire.
X. Now you need to specify the path. To do this, stand next to the character path point and click AddPoint.
There should be nothing large (howses, walls, cloffs) between the current and the next points.
Trees, rocks, fires, and frogs are allowed – the bot will pass them.
The distance between the points is for you to choice, the best distance is about 40 cells, in the mountains
as little as possible but too often it is not necessary.
Returning to the heart fire is not necessary, the path can end on the other side of the mountain.
Important notes:
---------------
A. On the mountain - not necessarily making a detailed path through everything, even the finest passages.
It’s enough to pass for the largest ones.
This will save time for the walking -> more runs -> profit!
B. In the swamp/ meadow/ forest/ steppe - try to not have cliffs in the visible distance.
If a curious will appear on the reverse side of the cliff, your char is likely to stuck in it. In my point
of view, it is easy to find places without cliffs.
C. On the lake - the starter point should be in the middle of the shallow water. Your character will put its
boat to there and sit in it.
The last point must also be in the middle of the shallow water. It is the place where the character gets off
the boat and lifts it.
When you run the forager bot, the boat should be near the fire.
XI. When the route has covered the entire area - click on “Save”.
XII. There will appear a file called "New_Forager.jbot" in your Union client folder. Name it whenever
you’d fap to and put into the “Scripts” folder.
XIII. Reload this da fuk client.
XIV. Run the script with the name <name of the character> - <name of the region>.
The script teleports the character to the hearth fire, and will enable criminals, and begins to move along the path you’ve created.
At the end of the path the character automatically logs out. After 17 minutes the character will log on on the hearth fire to repeat the path again.
After filling the pack the script logs out the character and shuts down the client (so it is recommended to use the traveler sacks).
The script is a defense against bears and wild boar - not 100% effective, but it usually helps.
For two weeks I have not lost any character. However, Ravian was sexually raped by a bear within 1 week.
Added defence against people. Still not 100% reliable, but better then nothing. Not afraid of own villagers and green kins.
Careful select the gathering place - if there are 2 bots running at the same time you will get nothing.
-----------------------------------------------------------------------------------------------------------
Бот, который собирает все полезные курио отовсюду + умеет проверять территорию на тараны. (v3.0)
Как настраивать:
1. Копировать ForagingBotMaker.jbot и jBotAPI.japi в папку /scripts (jBotAPI.japi для версии 7.2c, если у вас какая-то другая версия
или были изменения - в конец вашего файла добавить код из моего, между метками "// cdev" и "// cdev end")
2. Взять твинка c достаточным сурвом, не забыть вкачать навык Foraging, с достаточным perc*exp (6400 гора, 2100 болото, 440 флотсамы и bolete, 3040 ракушки)
и треспассом, если на территории есть клаймы.
3. Поставить костер около болота (желательно поглубже внутри, меньше шанс нарватся на медведа), на горе и тд.
На озере костер можно поставить на берегу, но есть шанс что утащат лодку, или в глубже в лесу,
но чтобы перс мог дойти от костра до берега по прямой. Желательно заклаймить дорогу - лучше сохранность лодки, меньше шанс встретить хищника.
4. Запустить скрипт "Foraging Bot Maker"
5. Выбрать нужный режим сбора: Гора, Болото, Пещера, Лес, Озеро, Нуборесурсы, ОхранаОтТаранов.
Нуборесурсы включают в себя - WWW (болото, лес, луг, степь), Nettle (лес), Clover (луг, степь) и Candleberry (болото).
5. Написать имя региона в первое поле ввода, например Mountain [33, 80] или Stinky swamp
6. Ввести название аккаунта и имя перса во второе и третее поля ввода. (конечно без пароля, скобок пробелов и прочего мусора,
точно как оно выглядит в union client. Кстати в юнионе аккаунт должен присутствовать в кнопках быстрого выбора акка)
7. Выбрать нужные курьезы и минимальное качество для каждого. Все курьезы с качеством ниже будут выбрасываться.
Это удобно для поиска паутинок, например в лесу можно разрешить собирать ягоды и крапиву (на болоте mantles),
но поставить мин. качество 100.
8. Нажать Start, дождатся телепортации на костер.
9. Теперь нужно задать маршрут движения. Для этого встать персом на следующую точку маршрута и нажать AddPoint.
Между текущей и слудующей точками не должно быть крупных препятствий - домов, заборов, оврагов.
Деревья, камни, костры и лягушки допустимы - обойдет.
Расстояние между точками, произвольное, оптимальное помоему около 40 клеток, в горах возможно меньше но и слишком частить не стоит.
Возвращатся к костру не надо, маршрут может кончатся на другой стороне горы.
Важные замечания:
----------------
A. На горе - не обязательно прокладывать маршрут через все, даже самые мелкие проходы. Достаточно пройти по самым крупным.
Это сэкономит время на обход -> чаще обходы -> profit!
B. На болоте, на лугу, в лесу, в степи - старайтесь чтобы в радиус видимости не попадали овраги.
Если курьзе появится с обратной стороны оврага, перс скорее всего застрянет. Найти места без оврагов помоему несложно.
C. На озере - первая контрольная точка должна быть в середине мелководья озера, там перс положит лодку и сядет в нее.
Последняя точка так же должна быть в середине мелководья озера, там перс слезет с лодки и возьмет ее в руки.
При запуске бота лодка должна лежать рядом с костром.
10. Когда маршрутом покрыт весь регион - нажать кнопку Save.
11. В папке union client появится файл "New_Forager.jbot", переписать его в папку /scripts с именем, которе вам нравится.
12. Перезагрузить клиент.
13. Запустить скрипт с именем <имя перса> - <имя региона>.
Скрипт телепортируется на костер, включит криминалы и начнет движение по маршруту.
В конце маршрута чар автоматически разлогинится и через 17 мин залогинится на костре, чтобы пройти маршрут еще раз.
После заполнения пака скрипт разлогинит перса и завершит работу (поэтому рекомендуется использовать сумки).
В скрипте есть защита от медведей и кабанов - не 100% надежная, но обычно помогает.
За 2 недели я не потерял от них ни одного перса. У Равиана 1 труп за неделю от медведа.
Добавлена защита от людей. Не 100% надежная, но лучше чем ничего. Не реагирует на людей из своей деревни и зеленых кинов.
Аккуратнее выбирайте места сбора - если на одном месте будут работать 2 бота - ничего не соберут оба.
Users browsing this forum: Claude [Bot] and 0 guests