Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Need help with finding the bitmap(MacBook)! (sorry if this is the wrong place to post)

Featured Replies

This is my script trying to steal from a "Stall" , the program can't seem to find the "stall" and i don't know why. Ive got the colors right and it should find it within my BITMAP my it wont.
 
function findStall() {
var x = 200, y = 170, width = 700, height = 500;
var img = robot.screen.capture(x, y, width, height);
 
var size = (700, 500);
var img = robot.screen.capture(0, 0, size, size);
var multi = img.width / size;
;
 
 
var stallColors = ["#8e7493", "#424254", "#51093d", "#393946", "#69094e"];
 
for(var i = 0; i < 1000; i++) {
var randomX = getRandomInt(0, width-1);
var randomY = getRandomInt(0, height-1);
var sampleColor = img.colorAt(200 * multi, 170 * multi);
 
if(stallColors.includes(sampleColor)) {
var screenX = randomX + x;
var screenY = randomY + y;
 
console.log("found stall: " + screenX + "," + screenY + " color " + sampleColor);
return {x: screenX, y: screenY}
}
}
 
// this is the part where im trying to find the stall using colorpixels and bitmap width and lenght.
 
------------------------------------------------------------------------------------------
// this is my whole code.
 
// import the robotjs library
var robot = require('robotjs');

 

// hela functionen av programmet
function main() {
console.log("Starting...");
sleep(4000);

 

var stall = findStall();
if(stall == false) {
//om ingen stall hittar break programet
console.log('could not find stall');
}

 

// tar från stall och droppar
while (true) {
robot.moveMouse(stall.x, stall.y);
robot.mouseClick();
sleep(3000);

 

dropSilk();
break;
}
}

 

//function för att droppa silk

 

function dropSilk() {
var inventoryX = 950;
var inventoryY = 437;
robot.moveMouse(inventoryX, inventoryY);
robot.mouseClick('right');
robot.moveMouse(inventoryX, inventoryY + 50);
robot.mouseClick();
sleep(3000);
}

 

function findStall() {
var x = 200, y = 170, width = 700, height = 500;
var img = robot.screen.capture(x, y, width, height);

 

var size = (700, 500);
var img = robot.screen.capture(0, 0, size, size);
var multi = img.width / size;
;
 

 

var stallColors = ["#8e7493", "#424254", "#51093d", "#393946", "#69094e"];

 

for(var i = 0; i < 1000; i++) {
var randomX = getRandomInt(0, width-1);
var randomY = getRandomInt(0, height-1);
var sampleColor = img.colorAt(200 * multi, 170 * multi);

 

if(stallColors.includes(sampleColor)) {
var screenX = randomX + x;
var screenY = randomY + y;

 

console.log("found stall: " + screenX + "," + screenY + " color " + sampleColor);
return {x: screenX, y: screenY}
}
}

 

// hittade inte Stall
return false;

 

}

 

//sleep funktion används genom att skriva sleep(3000);
function sleep(ms) {
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
}

 

function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
}

 

//kör hela programet
main();

Soooooooooo why not just use the new osbot hwmouse

 

EDIT: just realized that this might've been for an rsps

Edited by Medusa

  • Author
14 minutes ago, Medusa said:

Soooooooooo why not just use the new osbot hwmouse

 

EDIT: just realized that this might've been for an rsps

Yes, Im trying to make a script for an rsps but do you know the reason why bitmap thing wont work??

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.