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.

Smithing sleep not working

Featured Replies

here is the code :-

if(furnacearea.contains(player)){
                    if(!myPlayer().isAnimating()){
                    //Make rings
                    MakeRings();
                    }
                }else{

                    //Go to furnacearea
                    walking.webWalk(furnacearea);

                 }

and my player won't stop moving how?

 

 

What is player? Use myPlayer()

if (furnacearea.contains(myPlayer())) {

Edited by Eliot

  • Author

i made player as an entity

Player player = myPlayer();    

  • Author

Goldbar.interact("use");
                    furnace.interact("use");
                    sleep(1000);
                    getWidgets().get(446,8).interact("Make-X");
                    sleep(1000);
                    getKeyboard().typeString(NumGB, true);

sorry not a fancy code :) my first script.

7 minutes ago, kadiem said:

Goldbar.interact("use");
                    furnace.interact("use");
                    sleep(1000);
                    getWidgets().get(446,8).interact("Make-X");
                    sleep(1000);
                    getKeyboard().typeString(NumGB, true);

sorry not a fancy code :) my first script.

A lot of that needs to be nullchecked, you're also relying on the game to run perfectly smoothly which with the current servers, won't happen. Try using conditional sleeps and thinking about your logic a bit. Also avoid using static widget IDs like 446,8 and see if there's a text option or another alternative you could be using as these are prone to being updated and will break your script. :) 

  • Author
Just now, HeyImJamie said:

A lot of that needs to be nullchecked, you're also relying on the game to run perfectly smoothly which with the current servers, won't happen. Try using conditional sleeps and thinking about your logic a bit. Also avoid using static widget IDs like 446,8 and see if there's a text option or another alternative you could be using as these are prone to being updated and will break your script. :) 

I don't know how to use conditionalsleep yet, so I'm stuck with the normal sleep and if statements :p now.

1 minute ago, kadiem said:

I don't know how to use conditionalsleep yet, so I'm stuck with the normal sleep and if statements :p now.

Why not learn. :) Even so, your if statements could be re-ordered as you're still relying on 'game flow' for your script to work. What if you don't click make-x, or it doesn't load within a second? What if the furnace is null? etc. 

  • Author

so i did this

 

Goldbar.interact("use");
                    furnace.interact("use");
                    sleep(random(1000,1500));
                    getWidgets().get(446,8).interact("Make-X");
                    sleep(3000);
                    getKeyboard().typeString(NumGB, true);
                    sleep(1000);
                    new ConditionalSleep(random(3000, 5000))
                      {
                        public boolean condition()
                          throws InterruptedException
                        {
                          return !myPlayer().isAnimating();
                        }
                      }.sleep();

 

and it didn't work, what did i do wrong?

Edited by kadiem

9 minutes ago, kadiem said:

so i did this

 

Goldbar.interact("use");
                    furnace.interact("use");
                    sleep(random(1000,1500));
                    getWidgets().get(446,8).interact("Make-X");
                    sleep(3000);
                    getKeyboard().typeString(NumGB, true);
                    sleep(1000);
                    new ConditionalSleep(random(3000, 5000))
                      {
                        public boolean condition()
                          throws InterruptedException
                        {
                          return !myPlayer().isAnimating();
                        }
                      }.sleep();

 

and it didn't work, what did i do wrong?

Pretty sure it's "Use", not "use". Are you checking the furnace exists or gold bars exist?

 

  • Author

changed to Use no difference and no I'm not checking if the furnace or gold bar exist I'm just making the client Use gold on furnace.

Entity furnace = objects.closest("Furnace");

Item Goldbar = inventory.getItem("Gold bar"); 

It's getObjects(), not objects and it's getInventory()

Try something like:

if (getInventory().contains("Gold bar){
	if (furnace != null){
		if widget is up
			interact
		else if item is selected and selected item == gold bar
			use on furnace
		else if item is selected and selected item isnt gold bar
			deselect item
		else
			interact with gold in inv

But obviously fill in the code

Edited by HeyImJamie

  • Author

I don't think the problem is in that part because the script is working, the problem is in the sleep, conditionalsleep is not working.

21 minutes ago, kadiem said:

I don't think the problem is in that part because the script is working, the problem is in the sleep, conditionalsleep is not working.

Your conditional should return when your player is Animating. If it's !.isAnimating it'll return instantly

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.