Jump to content

Wont stop looping!


Bigpoppa21

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 

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...