Sjo 3 Posted July 26, 2016 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: my IntelliJ layout: 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!
Pandemic 2842 Posted July 26, 2016 You have to have your antiban methods in the same project as your script.
Sjo 3 Author Posted July 26, 2016 You have to have your antiban methods in the same project as your script. I think it's in the same project: or do you mean in the same module? Thanks for replying!
deathizpro 12 Posted July 27, 2016 I think it's in the same project: 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.
Mad 86 Posted July 27, 2016 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
Sjo 3 Author Posted July 27, 2016 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: 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?
Calculus 30 Posted July 27, 2016 Looks like I'm still doing something wrong I added the module dependency: 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.
Sjo 3 Author Posted July 27, 2016 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
DefCon 121 Posted July 27, 2016 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.
Sjo 3 Author Posted July 27, 2016 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.