Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Problem with seperate Antiban module


    Sjo

    Recommended Posts

    Posted

    Hey there,

     

    I wanted to make a seperate Antiban module to keep my project structurized.
    This module will then be available for all my scripts in the same project.

     

    However, I can't seem to get it working properly, because my Script Manager doesn't respond when I press play.

    It just gets stuck like this:

     

    524e275225.jpg

     

     

    my IntelliJ layout: 

     

    3c5f46fdf6.png

     

    The code I have written:

    /*in Class Main :  Module AIOSmither for example*/
    public class Main extends AbstractScript{
        private final AntiBanMain ab = new AntiBanMain(this);
    
        @Override
        public int onLoop() {
          log(ab.getAbM.test());
    
          return -1;    
        }
    }
    
    /*in Module AntiBan*/
    public class AntiBanMain {
    
        protected AbstractScript aS;
    
        //add all antiban classes here (eg: camera, keyboard, ...)
        private AntiBanMouse abM;  
       
        AntiBanMain(){
        }
    
        AntiBanMain(AbstractScript aS){
            this.aS = aS;
            abM = new AntiBanMouse()
        }
    
        AntiBanMouse getAbM() {
            return abM;
        }
    }
    
    public class AntiBanMouse extends AntiBanMain {
        
        public String test(){
            return String.valueOf(super.aS.getSkills().getExperienceToLevel(Skill.SMITHING));
        }
        
    }
    

    I'm not sure what I did wrong, any help would be appreciated. Thanks!

    Posted

    You have to have your antiban methods in the same project as your script.

     

    I think it's in the same project:

     

    fc5ba9e683.png

     

    or do you mean in the same module?

     

    Thanks for replying!

    Posted

    I think it's in the same project:

     

    fc5ba9e683.png

     

    or do you mean in the same module?

     

    Thanks for replying!

     

    Probably within in the same module. Then you could just call an instance of that AntiBanMain/Mouse.

    Posted

    Open it with the terminal, and look at any errors. You are probably getting a NoClassDef found error because i bet it isn't included in the jar you made. You need to add the module as a dependency to ur script

    Posted

    Open it with the terminal, and look at any errors. You are probably getting a NoClassDef found error because i bet it isn't included in the jar you made. You need to add the module as a dependency to ur script

     

    Looks like I'm still doing something wrong :(

     

    I added the module dependency:

     

    95e7389b90.png

     

     

     

    But I'm still getting the NoClassDefFound error like you stated

    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: main/AntiBanMain
    

    Maybe putting my project in one module is an easier fix?

    Posted

    Looks like I'm still doing something wrong :(

     

    I added the module dependency:

     

    95e7389b90.png

     

     

     

    But I'm still getting the NoClassDefFound error like you stated

    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: main/AntiBanMain
    

    Maybe putting my project in one module is an easier fix?

    M8, just put the damn antiban folder inside of the src for the AIOSmither project.

    Posted

    M8, just put the damn antiban folder inside of the src for the AIOSmither project.

     

    Yeh, looks like I'll have to.

     

     

    Anyway, thanks all for helping :)

    Posted

    Looks like I'm still doing something wrong :(

    Maybe putting my project in one module is an easier fix?

    So long as all your classes are in the same project you're fine. As stated before by Mad, I think your problem is is caused by you not including the Antiban classes when you create the Jar file.

    Posted

    So long as all your classes are in the same project you're fine. As stated before by Mad, I think your problem is is caused by you not including the Antiban classes when you create the Jar file.

     

    Hmm, I thought I did (I added it as a module dependency)

    unless I'm misunderstanding you, I'm not sure what you mean then.

     

     

    95e7389b90.png

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.