Prismo Posted June 2, 2017 Share Posted June 2, 2017 Hey guys im new to java scripting . delete this if its already been covered in previous thread . i want to add antiban to my script using InterruptedException , do i create a new class to put code in and just somehow reference it in main script? Quote Link to comment Share on other sites More sharing options...
Satire Posted June 2, 2017 Share Posted June 2, 2017 If you have an antiban(){ } function then it just goes antiban() throws InterruptedException{ //do whatever } Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted June 2, 2017 Share Posted June 2, 2017 Lul Antiban Quote Link to comment Share on other sites More sharing options...
Prismo Posted June 2, 2017 Author Share Posted June 2, 2017 2 hours ago, HeyImJamie said: Lul Antiban does it not work? i thought any human like interaction would be in our favour? 2 hours ago, Satire said: If you have an antiban(){ } function then it just goes antiban() throws InterruptedException{ //do whatever } where do i put it? in onloop? and how do i trigger it? Quote Link to comment Share on other sites More sharing options...
Satire Posted June 2, 2017 Share Posted June 2, 2017 (edited) antiban() throws InterruptedException{ //throwing this exception here is not required if you will not be using any sleeps or conditional sleeps. int rand = random(1,8); // generate a random number from 1-8 each time the function is called switch(rand){ case 0: // do something break; // we break here so we exit out of the switch statement, else it will just do whatever and go down to the next case case 1: // do something break; case 2: //time for a real example if(myPLayer().isAnimating && !inventory.isFull()){ /*say we're woodcutting or something then we can randomly hover over a skill or rotate/move the camera In this case, we'll move the pitch(vertical angle basically(up and down))*/ getCamera().movePitch(random(55,67)); //in between angle 55 and 67 (67 is the max pitch) break; } } You can call it anywhere you like, wheter you use enums or not. For the sake of simplicity, we'll use onLoop So in your onloop int onLoop() throws Interupted Exception{ //each loop we'll generate a random number and if that random number is equal to 30 and the player isn't animating, the condition will be true and it will then call the antiban method. if(random(1,50) == 30 && !myplayer().isAnimating){ //this is just an example... so not hate antiban(); // call antiban function } return 200; } lol my post got deleted oh well. So I basically said that you must be new to programming in general as well as scripting (as you've stated). So I suggest you take a look at the coding conventions for Java and learn about functions and conditional statements. http://www.oracle.com/technetwork/java/codeconvtoc-136057.html -- you can see some here Now, above is an example of an antiban in use, however, it is a very shit antiban and it will most likely get u banned hahahha Antibans don't really do much from my experience and many people will say this exact thing. I know it's hard to believe. But for the sake of learning, you can make one just for fun for a learning experience. Edited June 2, 2017 by Satire Quote Link to comment Share on other sites More sharing options...