Jump to content

Want to get into scripting


xEmoPrincess

Recommended Posts

Where should I start. I know there's videos out there, but what should my first script be that I first make that is simple enough to understand some of the components in this process. Thanks

 

  • Learn the basics to Java
  • Know how to find the Osbot API and search it
  • Learn the basic script skeleton to make an Osbot script.
  • Start with something very basic. (Shop buyer + walker + etc.)
  • Learn new methods by de-compiling other scripts in the local section
  • Post in the Scripter Help section for insight

Tools

 

Edited by Sinatra
Link to comment
Share on other sites

Some tips:

- null checks

- use conditional sleeps whenever possible

- dont just write code in order, use logic and conditional statements for example:

public int onLoop(){ //this is bad
getBank().open();
getBank().depositAll();
getBank().withdraw("Coins", 20000);
getBank().close;
return 500;
}

public int onLoop(){ //this is better and is less likely to break
if(!getBank().isOpen()){
getBank().open();
new ConditionalSleep(2500, 3000){
@Override
public boolean condition(){
return getBank().isOpen();
}
}.sleep();
} else {
if(getBank().getAmount("Coins") >= 20000 && !getInventory().contains("Coins")){
getBank().withdraw("Coins", 20000);
new ConditionalSleep(2500, 3000){
@Override
public boolean condition(){
return getInventory().contains("Coins");
}.sleep();
}
}
if(getInventory().contains("Coins")){
getBank().close();
new ConditionalSleep(2500, 3000){
@Override
public boolean condition(){
return !getBank().isOpen();
}
}.sleep();
}
return 500;
}
Edited by LoudPacks
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...