what happens with
- Code: Select all
objs = jGetObjects (5000, jCoord (0,0) , 'gfx/kritter/cow/cow) ;
or
- Code: Select all
objs = jGetObjects (5000, jCoord (0,0) , 'gfx/kritter/cow/calf) ;
?!?
Moderator: Phades
objs = jGetObjects (5000, jCoord (0,0) , 'gfx/kritter/cow/cow) ;
objs = jGetObjects (5000, jCoord (0,0) , 'gfx/kritter/cow/calf) ;
SovietUnion wrote:I didn't find it anywhere in this forum, so just for reference:
to call a Ctrl + left click (disembarque a boat for example), use: jAbsClick(jMyCoords(), 1, 2);
The first parameter is the position where to click, the second one is the click type: 1 being left click, 3 being right click. The third param is the action added to the click. 2 is "press Ctrl key".
Does any of you guys have a full list of parameters and what they do? Trial and error is a bit time consuming. THX
/ **
* Sent to the server -clicking on the map to the specified coordinates
* (Absolute , in the points card )
*
*param Coord
* coordinates
*param Btn
* Mouse button (1 - left , 3 - right )
*param Mod
* Keyboard modifier (1 - shift; 2 - ctrl; 4 - alt; 8 -
* Win)
* /
public static void jAbsClick(Object coord, int btn, int mod) {
Coord c = unWrapCoord(coord);
JSBotUtils.mapAbsClick(c.x, c.y, btn, mod);
}
TheMasterWolf wrote:Anyone have a working farming bot and instructions on how to work it?
borka wrote:why does the CMD window shows gfx/kritter/cow/s ? Does it point to s.res ?!?
what happens with
- Code: Select all
objs = jGetObjects (5000, jCoord (0,0) , 'gfx/kritter/cow/cow) ;
or
- Code: Select all
objs = jGetObjects (5000, jCoord (0,0) , 'gfx/kritter/cow/calf) ;
?!?
Ocerion wrote:Anyone happen to have a script that works like the trough filling one, except fills chicken coops? Obnoxiously I seem to be having the worst luck modifying the troughfilling one to work for it. Doesn't help that I have no idea what I'm doing I suppose.
//#! name = Informa
//#! uniq = arcanist_informant
//#! icon = gfx/invobjs/tinyabacus
// Globals
include("jBotAPITalon");
include("jBotAPIArcanist");
include("jBotAPI");
include("pathfinder");
var cupboards = selectInRect("cupboard", 64, "Select in cupboards");
if (cupboards.length < 1)
var cupboards = jGetObjects(40, jCoord(0, 0), ["terobjs/cupboard"]);
var array1 = [] // Item resnames
var array2 = [] // Item counts
function main(){
for (var key in cupboards){
openCupboard(cupboards, key);
if (jHaveWindow("Cupboard"))
makelist();
}
//output
do {
var swapped = false;
for (var i = 0; i < (array2.length - 1); i++) {
if ( array2[i] < array2[i+1] ) {
var swap = array2[i+1];
array2[i+1] = array2[i];
array2[i] = swap;
var swap = array1[i+1];
array1[i+1] = array1[i];
array1[i] = swap;
var swapped = true;
}
}
} while (swapped);
for ( var key in array1){
jPrint(array2[key] + " " + array1[key]);
}
}
function makelist() {
if (jHaveWindow("Cupboard")){
var objects = jGetWindow("Cupboard").getInventories()[0].getItems("invobjs");
for (var j = 0; j < objects.length; j++){
found = false;
var resname = objects[j].resName();
for (var q = 0; q < array1.length; q++){
if (resname == array1[q]){
array2[q]++;
found = true;
}
}
if (!found){ // Need to add it to the arrays
array1.push(resname);
array2.push(1);
}
}
}
}
main();
function selectInRect(resname, blob, title) {
var offs = jCoord(0, 0);
var size = jCoord(1, 1);
var confirm = false;
jDrawGroundRect(offs, size);
var blist = ["West", "East", "North", "South", "Inc width", "Inc height", "Dec width", "Dec height", "Confirm", "Exit"];
var selectWindow = jGUIWindow(jCoord(250, 250), jCoord(105, blist.length * 25 + 15), "Area");
var label = jGUILabel(selectWindow, jCoord(5, 5), title);
for(var i = 0; i < blist.length; i++)
jGUIButton(selectWindow, jCoord(5, 25 + i*25), 100, blist[i]);
selectWindow.toggleCloseButton();
var btext = "";
while(btext != "Exit"){
btext = selectWindow.waitButtonClick();
if(btext == blist[0]) offs.x--;
if(btext == blist[1]) offs.x++;
if(btext == blist[2]) offs.y--;
if(btext == blist[3]) offs.y++;
if(btext == blist[4]) size.x++;
if(btext == blist[5]) size.y++;
if(btext == blist[6]) if(size.x > 1) size.x--;
if(btext == blist[7]) if(size.y > 1) size.y--;
if(btext == blist[8]) {confirm = true; break;}
jDrawGroundRect(offs, size);
}
selectWindow.destroy();
jDrawGroundRect(offs, jCoord(0, 0));
var startCoord = jMyCoords().add(offs.mul(11));
var fieldSize = size;
return jGetObjectsInRect(startCoord, fieldSize, blob, resname);
}
function openCupboard(cupboard, number){
while(jHaveWindow("Cupboard")) {
jAbsClick(jMyCoords(), 1, 0);
if (jHaveWindow("Cupboard")) jSleep(500);
}
while(!jHaveWindow("Cupboard")) {
jPFMoveOffset_LX(cupboard[number].position(), 1);
waitPFEndMove();
jSleep(500);
jDoClick(cupboard[number].getID(), 3, 0);
jSleep(1000);
}
jSleep(100);
jToConsole("Walked to Cupboard Number " + number);
return number;
}
Arcanist wrote:If you apply ctrl + d, and hover over an animal, it shows the res for animal/s.res
It seems that the jbot engine can't see the rest of the animal, even though visually the user can.
It's weird.
jorb wrote:All your characters will be deleted, and I will level every village any one of them were ever members of.
Users browsing this forum: Claude [Bot], Yandex [Bot] and 0 guests