Token Posted May 19, 2019 Share Posted May 19, 2019 (edited) Script Development Setup Part 1: Local scripting environment 1. Download & install Java SE Development Kit 8 2. Download & install IntelliJ IDEA 3. Creating the project 3.1. Open IntelliJ IDEA & create a new project 3.2. Make sure the selected JDK is version 8 and click next 3.3. No project template will be required, click next 3.4. Give the project a name (eg: scripts), then click finish 4. Configuring the project 4.1. Press CTRL + ALT + SHIFT + S (or File -> Project Structure...) and go to Modules, open the Dependencies tab and click the + button and select "Library..." and "Java" 4.2. Locate the OSBot jar file and select it, select "Project library" and click next 4.3. Go to Artifacts (on the same window, under Modules) and click the + button, select "JAR" then "Empty" 4.4. Give the artifact some name(eg: scripts_jar), select include in project build, right click "scripts" (or whatever the project name you chose) compile output on the right side and select "Put into Output Root". Output directory should be the OSBot scripts directory: $USER_HOME$\OSBot\Scripts\ 5. Test the settings 5.1. Right side, under Project, expand the directories and right click src to create a new class file 5.2. Give it some name, make sure it's a Class file and click ok 5.3. Write some test code 5.4. Press CTRL + F9 (or Build -> Build Project) 5.5. Open the OSBot client and refresh the script list, the "Example Script" should appear on the list Part 2: SDN scripting environment 1. Request GIT access 2. Create a local repository VCS -> Import into Version Control -> Create Git Repository... and select the project directory (scripts in the example) 3. Adjust project structure to meet SDN script project structure guidelines. In this case I'll create a directory for the script and move the src directory under it. 4. Press CTRL + K (or VCS -> Commit...), add some commit message and select only the required files (java classes, resources), no IDE generated configuration files, then click commit (and if prompted to review warnings, just click commit again on the dialog that appears) 5. Press CTRL + SHIFT + K (or VCS -> Git -> Push...) 6. First time doing this you will have to define the remote branch to push to, so click on "Define remote" 7. You will need to fill in the URL to your GIT repository then click ok The GIT_USERNAME and GIT_REPOSITORY are usually the same, the GIT details will be obtained once your GIT access request is approved That is GIT_USERNAME:GIT_PASSWORD (there is a : in there) 8. Push changes , they will appear on your gitweb repository page Useful Hotkey Summary CTRL + F9: export script jar to the client directory CTRL + K: commit CTRL + SHIFT + K: push CTRL + ALT + S: open IDE settings CTRL + ALT + SHIFT + S: open project settings CTRL + ALT + INSERT: create new file in current directory CTRL + ALT + L: autoformat code CTRL + ALT + ENTER: autocomplete statement at caret position CTRL + F: search CTRL + R: replace CTRL + P: paramter info for method at caret position Edited July 18, 2019 by Token 16 7 Quote Link to comment Share on other sites More sharing options...
Proton Posted May 19, 2019 Share Posted May 19, 2019 Thank you 1 Quote Link to comment Share on other sites More sharing options...
Lost Panda Posted May 19, 2019 Share Posted May 19, 2019 Nicu guide tokenfren! 1 Quote Link to comment Share on other sites More sharing options...
Sib Posted May 19, 2019 Share Posted May 19, 2019 Nice and easy 1 Quote Link to comment Share on other sites More sharing options...
Charlotte Posted May 20, 2019 Share Posted May 20, 2019 Stealth development 1 Quote Link to comment Share on other sites More sharing options...
Czar Posted May 20, 2019 Share Posted May 20, 2019 Good job, nice to see a GIT part too, makes it much easier than downloading external git clients IMO. I still I think there should be a non-intelliJ option for those people who can't even open JARs without WinRAR popping up 1 Quote Link to comment Share on other sites More sharing options...
Kramnik Posted May 20, 2019 Share Posted May 20, 2019 (edited) Thanks for making this tutorial Edited May 20, 2019 by Kramnik 1 Quote Link to comment Share on other sites More sharing options...
MaryHudson Posted January 14, 2020 Share Posted January 14, 2020 Good job its very easy. Quote Link to comment Share on other sites More sharing options...
matthew2112 Posted April 9, 2020 Share Posted April 9, 2020 Hi i am trying to follow the guide as i am a noob and i have the script seccesfully built and it is saved in the OSBot>Scripts folder as "scripts_jar" but when i load the client and refresh the script does not show up. Any help would be greatly appreciated. Thanks in Advance. Quote Link to comment Share on other sites More sharing options...
Gunman Posted April 9, 2020 Share Posted April 9, 2020 5 minutes ago, matthew2112 said: Hi i am trying to follow the guide as i am a noob and i have the script seccesfully built and it is saved in the OSBot>Scripts folder as "scripts_jar" but when i load the client and refresh the script does not show up. Any help would be greatly appreciated. Thanks in Advance. Normally it's because you didn't compile it with java 8 or you're missing script manifest Quote Link to comment Share on other sites More sharing options...
matthew2112 Posted April 9, 2020 Share Posted April 9, 2020 Would the file jre 1.8.0_241 have the java 8 in it? that is what it made me download. or do i need to download an older version. This is the message i have from compiling the build "Information: javac 14 was used to compile java sources" Quote Link to comment Share on other sites More sharing options...
Token Posted April 10, 2020 Author Share Posted April 10, 2020 11 hours ago, matthew2112 said: Would the file jre 1.8.0_241 have the java 8 in it? that is what it made me download. or do i need to download an older version. This is the message i have from compiling the build "Information: javac 14 was used to compile java sources" Delete all versions of jre/jdk and install jdk 8 AFTER they are deleted Quote Link to comment Share on other sites More sharing options...
Czar Posted April 16, 2020 Share Posted April 16, 2020 Time to make the move.. goodbye old friend (eclipse) 1 Quote Link to comment Share on other sites More sharing options...
danny mole Posted May 2, 2020 Share Posted May 2, 2020 amazing info! Quote Link to comment Share on other sites More sharing options...
cammofunk Posted May 5, 2020 Share Posted May 5, 2020 Thanks, works like a charm Quote Link to comment Share on other sites More sharing options...