Skip to content

Commit

Permalink
Merge pull request #1 from OSRSB/master
Browse files Browse the repository at this point in the history
Fix breaking changes
  • Loading branch information
GigiaJ committed Apr 12, 2022
2 parents 146aeed + fddf6a0 commit ff35483
Show file tree
Hide file tree
Showing 115 changed files with 5,452 additions and 2,108 deletions.
Binary file added .github/workflows/.build-gradle.yml.swp
Binary file not shown.
7 changes: 4 additions & 3 deletions .github/workflows/build-gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '8'
java-version: '17'
distribution: 'temurin'
- name: Build with Gradle
run: |
./gradlew build
- name: Rename bot jar
run: |
mv ./build/libs/RSBBB-1.0.jar ./OsrsBot.jar
ls
mv OSRSBot*.jar ./OsrsBot.jar
- uses: actions/upload-artifact@v2
with:
name: OsrsBot.jar
Expand Down
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/modules/OSRSBot.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions .idea/runConfigurations.xml

This file was deleted.

This file was deleted.

66 changes: 52 additions & 14 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 32 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,37 @@
# OSRSBot
An automation API for Old School RuneScape
<h1 align="center">OSRSBot</h1>

<p align="center">An automation API for Old School RuneScape</p>

<p align="center">
<img src="./assets/osrs-bot-demo.png"
alt="OSRSBot automating the RuneLite client"
width="400"/>
</p>

<p align="center"><em style="font-size: 11px">OSRSBot automating the RuneLite client</em></p>

___

## Community Discord
[Click here](https://discord.gg/CGBXNrHREP) to join our community Discord for more support and help
## ⚠️ This project is WIP ⚠️

This project is not ready for end-users who assume it will work out of box.
* These is currently no official end-user support.
* These is currently no support for Macintosh and won't be in near future, stop using such junk!
* Please don't DM developers asking for help, neither spam discord channels or you may get banned!
* If you ask nicely and with **meaningfull details** about your problem you may get some help.

As such it is required that every user which wants to run this bot has at least minimal knowledge of:
* How to use IntelliJ IDEA.
* How to work with Gradle tasks (edit tasks, comment lines out, update references etc.).
* How to adjust [Script-Template](https://github.com/OSRSB/script-template) to reflect possible breaking changes in API.

## Community
* [Forums](https://osrsbot.org/) - Ask questions, find guides, make requests
* [Discord](https://discord.gg/CGBXNrHREP)

### What is OSRSBot?
OSRSBot is an API designed to aid in automating the gameplay of Old School RuneScape using RuneLite's
third party client.
third party client.

###### RuneLite?
RuneLite is an open-source API that seeks to enable a player to make
Expand Down Expand Up @@ -42,9 +66,9 @@ To build make sure to use the Gradle build tasks to build the classes or the jar
###### Installing a script
To install a .jar script, put it in the following folder:

Windows: C:\Users\[username]\AppData\Roaming\OsrsBot\Scripts\Precompiled
Linux: /home/[username]/.config/OsrsBot/Scripts/Precompiled
MacOS: /Users/[username]/Library/Application Support/OsrsBot/Scripts/Precompiled
**Windows:** C:\\Users\\[username]\\OsrsBot\\Scripts\\Precompiled \
**Linux:** /home/[username]/.config/OsrsBot/Scripts/Precompiled \
**MacOS:** /Users/[username]/Library/Application Support/OsrsBot/Scripts/Precompiled


###### Running a script
Expand Down
Binary file added assets/osrs-bot-demo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repositories {
mavenCentral()
}

def runeLiteVersion = '1.8.11'
def runeLiteVersion = '1.8.16'

dependencies {
implementation group: 'net.runelite', name: 'client', version: runeLiteVersion
Expand Down Expand Up @@ -61,6 +61,8 @@ jar {
exclude 'META-INF/*.DSA'

duplicatesStrategy = DuplicatesStrategy.EXCLUDE

destinationDirectory.set(file("$rootDir"))
}

group = 'rsb'
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = 'RSBBB'
rootProject.name = 'OSRSBot'
8 changes: 3 additions & 5 deletions src/main/java/rsb/botLauncher/RuneLite.java
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,9 @@ public static ArgumentAcceptingOptionSpec<?>[] handleParsing(OptionParser parser
.withRequiredArg()
.ofType(ClientUpdateCheckMode.class)
.defaultsTo(ClientUpdateCheckMode.AUTO)
.withValuesConvertedBy(new EnumConverter<ClientUpdateCheckMode>(ClientUpdateCheckMode.class)
{
.withValuesConvertedBy(new EnumConverter<>(ClientUpdateCheckMode.class) {
@Override
public ClientUpdateCheckMode convert(String v)
{
public ClientUpdateCheckMode convert(String v) {
return super.convert(v.toUpperCase());
}
});
Expand Down Expand Up @@ -495,11 +493,11 @@ public void initializeClient(ArgumentAcceptingOptionSpec<?>[] optionSpecs, Optio

try
{
final RuntimeConfigLoader runtimeConfigLoader = new RuntimeConfigLoader(okHttpClient);
final ClientLoader clientLoader = new ClientLoader(okHttpClient,
options.valueOf(
optionSpecs[Options.UPDATE_MODE.getIndex()].ofType(ClientUpdateCheckMode.class)),
(String) options.valueOf("jav_config"));
final RuntimeConfigLoader runtimeConfigLoader = new RuntimeConfigLoader(okHttpClient);

new Thread(() ->
{
Expand Down
11 changes: 0 additions & 11 deletions src/main/java/rsb/botLauncher/RuneLiteTestFeatures.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
package rsb.botLauncher;

import com.google.inject.Provider;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Point;
import net.runelite.api.widgets.Widget;
import net.runelite.client.callback.ClientThread;
import rsb.internal.globval.GlobalWidgetId;
import rsb.internal.globval.GlobalWidgetInfo;
import rsb.methods.Game;
import rsb.methods.GroundItems;
import rsb.methods.MethodContext;
import rsb.testsScript.Test;
import rsb.util.OutputObjectComparer;
import rsb.util.Parameters;
import rsb.util.StdRandom;
import rsb.wrappers.*;
import rsb.wrappers.subwrap.WalkerTile;

import java.applet.Applet;
import java.awt.*;
import java.lang.reflect.Field;
import java.util.HashMap;

import static java.lang.Thread.sleep;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/rsb/event/EventManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public long getMask() {
private final Logger log = Logger.getLogger(EventManager.class.getName());

private final EventMulticaster multicaster = new EventMulticaster();
private final Map<Integer, EventObject> queue = new HashMap<Integer, EventObject>();
private final Map<Integer, EventObject> queue = new HashMap<>();

private final Object threadLock = new Object();

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/rsb/event/EventMulticaster.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ public static long getDefaultMask(EventObject e) {
}

private long enabledMask;
private final List<Long> listenerMasks = new ArrayList<Long>();
private final List<Long> listenerMasks = new ArrayList<>();

private final List<EventListener> listeners = new ArrayList<EventListener>(5);
private final List<EventListener> listeners = new ArrayList<>(5);

private EventMulticaster parent;

Expand Down
5 changes: 2 additions & 3 deletions src/main/java/rsb/event/impl/DrawInventory.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import rsb.botLauncher.RuneLite;
import rsb.event.listener.PaintListener;
import rsb.methods.Game;
import rsb.methods.GameGUI;
import rsb.internal.globval.enums.InterfaceTab;
import rsb.methods.MethodContext;
import rsb.wrappers.RSItem;

Expand All @@ -22,7 +21,7 @@ public void onRepaint(final Graphics render) {
return;
}

if (ctx.game.getCurrentTab() != GameGUI.Tab.INVENTORY) {
if (ctx.game.getCurrentTab() != InterfaceTab.INVENTORY) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/rsb/event/impl/DrawModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
public class DrawModel implements PaintListener, MouseListener {

private static final HashMap<RSObject.Type, Color> color_map = new HashMap<RSObject.Type, Color>();
private static final HashMap<RSObject.Type, Color> color_map = new HashMap<>();

static {
color_map.put(RSObject.Type.GROUND, Color.BLACK);
Expand Down

0 comments on commit ff35483

Please sign in to comment.