Jump to content

Wont stop looping!


Recommended Posts

Posted (edited)
case BUY:
    		if (inventory.isEmptyExcept("Coins")){
    			RS2Object Chest = objects.closest("Chest");
    			if (Chest.interact("Buy-food")){
    				sleep(random(600,800));
    				if (mouse.move(377, 130)){
    					sleep(random(600,900));
    					mouse.click(true);
    					sleep(1000);
    					mouse.move(364, 198);
    					mouse.click(false);
    					sleep(random(200,800));
    					
    				}
    			}
    		}break; 

It just opens the chest, moves the mouse to destination and then hovers it for a few seconds and then closes the chest interface and keeps looping through it. Any ideas on how I would be able to fix this?

 

Again..sorry for the every other white line...Still not quite sure on how to make them go away lulz.

Edited by Bigpoppa21
Posted (edited)
case BUY:
    		if (inventory.isEmptyExcept("Coins")){
    			RS2Object Chest = objects.closest("Chest");
    			if (Chest.interact("Buy-food")){
    				sleep(random(600,800));
    				if (mouse.move(377, 130)){
    					sleep(random(600,900));
    					mouse.click(true);
    					sleep(1000);
    					mouse.move(364, 198);
    					mouse.click(false);
    					sleep(random(200,800));
    					
    				}
    			}
    		}break;  

Readable code ^

Edited by Mysteryy
Posted
case BUY:
    		if (inventory.isEmptyExcept("Coins")){
    			RS2Object Chest = objects.closest("Chest");
    			if (Chest.interact("Buy-food")){
    				sleep(random(600,800));
    				if (mouse.move(377, 130)){
    					sleep(random(600,900));
    					mouse.click(true);
    					sleep(1000);
    					mouse.move(364, 198);
    					mouse.click(false);
    					sleep(random(200,800));
    					
    				}
    			}
    		}break;  

Readable code ^

 

 

This is so hard-coded that scientists have recently identified it as the new hardest substance known to man.

 

On a serious note, I believe you copied the incorrect code. If you didn't, you should be analyzing each if statement.

  • Like 3
Posted (edited)

This is so hard-coded that scientists have recently identified it as the new hardest substance known to man.

On a serious note, I believe you copied the incorrect code. If you didn't, you should be analyzing each if statement.

its so hard that they added a new block to minecraft thats stronger than diamond

EDIT: I cant tell if that was a funny joke or just really nerdy...

Edited by AresScripts
Posted

This is so hard-coded that scientists have recently identified it as the new hardest substance known to man.

 

On a serious note, I believe you copied the incorrect code. If you didn't, you should be analyzing each if statement.

 

 

Not gonna lie, I couldnt force myself to read it so I just pasted it so someone else could. l0l

Posted

For the hard-coded they mean you should not be using mouse.move(x, y) without randomization. That will get banned very quickly, as no human can hit the same spot over and over. I suggest reading through the API (its boring, but very informative) and learn about things like Interfaces, dynamic sleeps, etc. Also dig around for any source code available on here and read it, granted not all of it will be written well :p. The API is your best resource though when making scripts.

Posted

Oh very true! I just wanted to see if I would beable to make a simple bot, I wont actually use this until I make it better. Im experimenting with different things and seeing what I can get to work and what I cant. biggrin.png I do have the API opened on the other monitor to help me while I'm writing a script. Thank you for the advice :) I'll keep searching around and looking at other codes for quick and easy help

Posted

Oh very true! I just wanted to see if I would beable to make a simple bot, I wont actually use this until I make it better. Im experimenting with different things and seeing what I can get to work and what I cant. biggrin.png I do have the API opened on the other monitor to help me while I'm writing a script. Thank you for the advice smile.png I'll keep searching around and looking at other codes for quick and easy help

 

case BUY:
    		if (inventory.isEmptyExcept("Coins")){
    			RS2Object Chest = objects.closest("Chest");
    			if (Chest.interact("Buy-food")){
    				sleep(random(600,800));
    				if (mouse.move(377, 130)){
    					sleep(random(600,900));
    					mouse.click(true);
    					sleep(1000);
    					mouse.move(364, 198);
    					mouse.click(false);
    					sleep(random(200,800));
    					
    				}
    			}
    		}break;  

Readable code ^

 

it so hard code because of after interacting with the chest. Most likely you should be checking into interfaces. If not check out mouse Destination class

 

Also im not sure why it keeps looping try debugging it 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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