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.

Randomly picking a case

Featured Replies

Hey guys, super noob AGAIN.

 

So I'm currently in the process of developing my anti-ban for my scripts, and I want to do the following.

 

 

I want to generate a random number, then using that number, pick an antiban through cases.

 

FOR EXAMPLE:

 

My script CXMonkCurser has done a bunch of curses and it's time to antiban, so we call upon antiban;

 

then antiban generates the number 42.

 

So then it goes into the antiban and checks which antiban it should used based on the number generated "42".

 

Case1-100: do nothing

Case100-200: click a random tab

case300-400: spin camera

 

in this example it would go to case1-100 and do nothing.

 

 

How would I go about turning this idea into useable code?

Edited by creationx

How would I go about turning this idea into useable code?

if(number <=100){
   // Do nothing
}else if(number <= 200){
   // Click tab
}else if(number <= 300){
   // Spin camera
}else{
   // Even higher
}
Why not just get a random number from 0-2 ?

switch(number){
   case 1:
   // Click tab
   break;

   case 2:
   // Spin camera
   break;
}

Edited by Khaleesi

Thank you, Daenerys Targaryen. It is my pleasure to serve under your wing.

 

Could also do something like this if you're using some sort of event-node state system.

private static final ImmutableList<Event> ANTIBAN = ImmutableList.of(new IdleEvent(), new AntibanEvent1(), new AntibanEvent2());

private static Event getRandomEvent() {
    return ANTIBAN.get((int) Math.random() * ANTIBAN.size());
}

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.