Jump to content

First script


Recommended Posts

Posted

Hello, i was creating my very first script by tutorials and free source scripts i found in this forum. I ran it few times to see where it will fail and the next day my account got banned. Well all skills was botted in 1 week, but i believe they detected my script. So i have a question, does mouse moves randomly, human like by default or do i have to make it move like that? Also my path wasnt randomized and had too big gaps, but bot was able to click beyond minimap, maybe this was the case?

Posted (edited)

Hello, i was creating my very first script by tutorials and free source scripts i found in this forum. I ran it few times to see where it will fail and the next day my account got banned. Well all skills was botted in 1 week, but i believe they detected my script. So i have a question, does mouse moves randomly, human like by default or do i have to make it move like that? Also my path wasnt randomized and had too big gaps, but bot was able to click beyond minimap, maybe this was the case?

 

Mouse moves randomly by default. You do not get banned by clicking on minimap beyond, path randomization (or rather lack of it) might affect your ban, but mostly, probably you were just unlucky.

 

In debugging window select mouse-position to see your script cursor, you should see how the mouse moves

Edited by Nitrousek
Posted (edited)

Can someone help me to make this case to wait till character is not attacked anymore, everything i try results to errors.. Also it should change world if totalStuff is less than 1.

case BUY:
                        sleep(random(2400, 2800));
                        if (myPlayer().isAnimating() || myPlayer().getInteracting() != null) sleep(random(1400, 2800));
                        
                    {
                        NPC shopOwner = npcs.closest("Owner");
                        if (shopOwner != null){
                            shopOwner.interact("Trade");
                            sleep(random(2400, 2800));
                            
                            RS2Widget item = getWidgets().get(300, 2, 4);
                            if (item != null){
                                int totalStuff = item.getItemAmount();
                                if (totalStuff >1){
                            item.interact(false, "Buy 10");
                            sleep(random(220, 420));    
                           item.interact(false, "Buy 10");
                            sleep(random(220, 420));    
                            item.interact(false, "Buy 10");
                            sleep(random(1500, 2500));
                                }
                            }

                            
                            else{
                                if (Worlds != null && Worlds[worldCounter] != -1){
                                worlds.hop(Worlds[worldCounter]);
                                log("World hop.");
                                worldCounter++;
                            }
                            else{
                                log("int array is null");
                            }
                            if (worldCounter == 7){
                                worldCounter = 0;
                            }
                            sleep(random(11700, 13000));

                                sleep(random(2400, 2800));
                            }
                            break;
                        }
                    }
Edited by gorgas8
Posted (edited)

Can someone help me to make this case to wait till character is not attacked anymore, everything i try results to errors.. Also it should change world if totalStuff is less than 1.

 

case BUY:

                        sleep(random(2400, 2800));

                        if (myPlayer().isAnimating() || myPlayer().getInteracting() != null) sleep(random(1400, 2800));

                        

                    {

                        NPC shopOwner = npcs.closest("Owner");

                        if (shopOwner != null){

                            shopOwner.interact("Trade");

                            sleep(random(2400, 2800));

                            

                            RS2Widget item = getWidgets().get(300, 2, 4);

                            if (item != null){

                                int totalStuff = item.getItemAmount();

                                if (totalStuff >1){

                            item.interact(false, "Buy 10");

                            sleep(random(220, 420));    

                           item.interact(false, "Buy 10");

                            sleep(random(220, 420));    

                            item.interact(false, "Buy 10");

                            sleep(random(1500, 2500));

                                }

                            }

                            

                            else{

                                if (Worlds != null && Worlds[worldCounter] != -1){

                                worlds.hop(Worlds[worldCounter]);

                                log("World hop.");

                                worldCounter++;

                            }

                            else{

                                log("int array is null");

                            }

                            if (worldCounter == 7){

                                worldCounter = 0;

                            }

                            sleep(random(11700, 13000));

                                sleep(random(2400, 2800));

                            }

                            break;

                        }

                    }

 

Do everyone a favour when you post code, post it using the code tool, and make sure it is properly formatted. Otherwise it is a headache to read.

 

 

https://gyazo.com/5819a6c62741a431cb9fa7113d3f6dc9

 

Also there is a method in the API for determining if the player is under attack

myPlayer().isUnderAttack() 
Edited by Explv

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