diff --git a/pom.xml b/pom.xml index 1eb4515c7..39e3d938f 100644 --- a/pom.xml +++ b/pom.xml @@ -100,6 +100,17 @@ always + + jcenter + JCenter Repository + https://jcenter.bintray.com/ + + true + + + true + + diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index 8d85b5c34..f710fb9b2 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -338,6 +338,11 @@ kotlin-reflect ${kotlin.version} + + com.example + example + 5.4 + diff --git a/runelite-client/src/main/java/ext/ethans/QuickPrayerExt.kt b/runelite-client/src/main/java/ext/ethans/QuickPrayerExt.kt new file mode 100644 index 000000000..76200bee1 --- /dev/null +++ b/runelite-client/src/main/java/ext/ethans/QuickPrayerExt.kt @@ -0,0 +1,13 @@ +package ext.ethans + +import com.example.EthanApiPlugin.Collections.query.QuickPrayer +import com.example.EthanApiPlugin.EthanApiPlugin + +object QuickPrayerExt { + /** + * Checks whether an individual quick prayer is active + */ + fun QuickPrayer.isActive() : Boolean { + return EthanApiPlugin.isQuickPrayerActive(this) + } +} \ No newline at end of file diff --git a/runelite-client/src/main/java/ext/runelite/NPCExt.kt b/runelite-client/src/main/java/ext/runelite/NPCExt.kt index e80b437bc..4c2d2dfa7 100644 --- a/runelite-client/src/main/java/ext/runelite/NPCExt.kt +++ b/runelite-client/src/main/java/ext/runelite/NPCExt.kt @@ -1,5 +1,6 @@ package ext.runelite +import com.example.EthanApiPlugin.EthanApiPlugin import ext.kotlin.KClassExt.getInstance import ext.runelite.NPCCompositionExt.isOf import net.runelite.api.Client @@ -35,4 +36,8 @@ object NPCExt { fun NPC.Companion.forEach(task : (NPC) -> Unit) { client.npcs.filterNotNull().forEach(task) } + + fun NPC.getTrueAnimation() : Int { + return EthanApiPlugin.getAnimation(this) + } } \ No newline at end of file diff --git a/runelite-client/src/main/java/ext/runelite/PlayerExt.kt b/runelite-client/src/main/java/ext/runelite/PlayerExt.kt index 9be86c674..e55c27a0a 100644 --- a/runelite-client/src/main/java/ext/runelite/PlayerExt.kt +++ b/runelite-client/src/main/java/ext/runelite/PlayerExt.kt @@ -1,7 +1,9 @@ package ext.runelite +import com.example.EthanApiPlugin.EthanApiPlugin import ext.kotlin.KClassExt.getInstance import net.runelite.api.Client +import net.runelite.api.HeadIcon import net.runelite.api.Player import net.runelite.api.SkullIcon @@ -15,4 +17,8 @@ object PlayerExt { fun Player.Companion.forEach(task : (Player) -> Unit) { client.players.filterNotNull().forEach(task) } + + fun Player.getSkullIcon() : SkullIcon { + return EthanApiPlugin.getSkullIcon(this) + } } \ No newline at end of file diff --git a/runelite-client/src/main/java/ext/runelite/PluginExt.kt b/runelite-client/src/main/java/ext/runelite/PluginExt.kt index 0264491cc..d050ab9a3 100644 --- a/runelite-client/src/main/java/ext/runelite/PluginExt.kt +++ b/runelite-client/src/main/java/ext/runelite/PluginExt.kt @@ -1,9 +1,46 @@ package ext.runelite +import com.example.EthanApiPlugin.Collections.query.QuickPrayer +import com.example.EthanApiPlugin.EthanApiPlugin +import ext.kotlin.KClassExt.getInstance +import ext.runelite.PluginManagerExt.get +import hotlite.plugins.scriptmanager.ScriptManager +import net.runelite.api.ChatMessageType +import net.runelite.api.Client +import net.runelite.api.widgets.Widget +import net.runelite.api.widgets.WidgetInfo import net.runelite.client.plugins.Plugin +import net.runelite.client.plugins.PluginManager object PluginExt { + val client = Client::class.getInstance() + val pluginManager = PluginManager::class.getInstance() + inline fun Plugin.getInjectedInstance(): T { return injector.getInstance(T::class.java) } + + fun Plugin.loggedIn() : Boolean { + return EthanApiPlugin.loggedIn() + } + + fun Plugin.getClient() : Client { + return EthanApiPlugin.getClient() + } + + fun Plugin.isQuickPrayerEnabled() : Boolean { + return EthanApiPlugin.isQuickPrayerEnabled() + } + + fun Plugin.sendGameMessage(message: String) { + getClient().addChatMessage(ChatMessageType.GAMEMESSAGE, "", message, "") + } + + fun Plugin.getWidget(group: Int, child: Int): Widget? { + return client.getWidget(WidgetInfo.PACK(group, child)) + } + + fun Plugin.getScriptManager() : ScriptManager { + return pluginManager.get() + } } \ No newline at end of file diff --git a/runelite-client/src/main/java/ext/runelite/PrayerExt.kt b/runelite-client/src/main/java/ext/runelite/PrayerExt.kt index cd90be5d0..453bdd040 100644 --- a/runelite-client/src/main/java/ext/runelite/PrayerExt.kt +++ b/runelite-client/src/main/java/ext/runelite/PrayerExt.kt @@ -1,5 +1,10 @@ package ext.runelite +import net.runelite.api.Client +import net.runelite.api.Prayer + object PrayerExt { + fun Prayer.blah() { + } } \ No newline at end of file diff --git a/runelite-client/src/main/java/ext/runelite/SceneExt.kt b/runelite-client/src/main/java/ext/runelite/SceneExt.kt index 33695d0aa..9524dbbc7 100644 --- a/runelite-client/src/main/java/ext/runelite/SceneExt.kt +++ b/runelite-client/src/main/java/ext/runelite/SceneExt.kt @@ -1,5 +1,6 @@ package ext.runelite +import com.example.EthanApiPlugin.EthanApiPlugin import ext.kotlin.KClassExt.getInstance import ext.runelite.DecorativeObjectExt.isOf import ext.runelite.DequeExt.withID @@ -79,4 +80,8 @@ object SceneExt { fun Scene.Companion.projectilesWithID(vararg ids: Int) : List { return client.projectiles.withID(*ids) } + + fun Scene.containsRegion(regionID: Int) : Boolean { + return EthanApiPlugin.inRegion(regionID) + } } \ No newline at end of file diff --git a/runelite-client/src/main/java/ext/runelite/WidgetExt.kt b/runelite-client/src/main/java/ext/runelite/WidgetExt.kt index 3e79f1d17..837683854 100644 --- a/runelite-client/src/main/java/ext/runelite/WidgetExt.kt +++ b/runelite-client/src/main/java/ext/runelite/WidgetExt.kt @@ -1,4 +1,10 @@ package ext.runelite +import com.example.Packets.WidgetPackets +import net.runelite.api.widgets.Widget + object WidgetExt { + fun Widget.doAction(action: String) { + WidgetPackets.queueWidgetAction(this, action) + } } \ No newline at end of file diff --git a/runelite-client/src/main/java/hotlite/api/Varp.kt b/runelite-client/src/main/java/hotlite/api/Varp.kt new file mode 100644 index 000000000..0b8aa69ba --- /dev/null +++ b/runelite-client/src/main/java/hotlite/api/Varp.kt @@ -0,0 +1,11 @@ +package hotlite.api + +import net.runelite.api.Client +import net.runelite.client.RuneLite + +open class Varp(val id: Int) { + private var client = RuneLite.getInjector().getInstance(Client::class.java) + fun getValue() : Int { + return client.getVarpValue(id) + } +} \ No newline at end of file diff --git a/runelite-client/src/main/java/hotlite/api/varp/TutorialProgressVarp.kt b/runelite-client/src/main/java/hotlite/api/varp/TutorialProgressVarp.kt new file mode 100644 index 000000000..0f0668f58 --- /dev/null +++ b/runelite-client/src/main/java/hotlite/api/varp/TutorialProgressVarp.kt @@ -0,0 +1,7 @@ +package hotlite.api.varp + +import hotlite.api.Varp + +object TutorialProgressVarp : Varp(281) { + const val CHOOSE_NAME = 1 +} \ No newline at end of file diff --git a/runelite-client/src/main/java/hotlite/plugins/example/ExamplePlugin.kt b/runelite-client/src/main/java/hotlite/plugins/example/ExamplePlugin.kt index c0e8d268d..141210791 100644 --- a/runelite-client/src/main/java/hotlite/plugins/example/ExamplePlugin.kt +++ b/runelite-client/src/main/java/hotlite/plugins/example/ExamplePlugin.kt @@ -1,7 +1,15 @@ package hotlite.plugins.example +import com.example.EthanApiPlugin.Collections.query.QuickPrayer +import com.example.EthanApiPlugin.EthanApiPlugin import com.google.inject.Inject import com.google.inject.Provides +import ext.ethans.QuickPrayerExt.isActive +import ext.runelite.NPCExt.getTrueAnimation +import ext.runelite.PlayerExt.getSkullIcon +import ext.runelite.PluginExt.getClient +import ext.runelite.PluginExt.getInjectedInstance +import net.runelite.api.Prayer import net.runelite.api.events.GameTick import net.runelite.client.config.ConfigManager import net.runelite.client.eventbus.Subscribe diff --git a/runelite-client/src/main/java/hotlite/plugins/scriptmanager/Script.kt b/runelite-client/src/main/java/hotlite/plugins/scriptmanager/Script.kt new file mode 100644 index 000000000..35a5959bc --- /dev/null +++ b/runelite-client/src/main/java/hotlite/plugins/scriptmanager/Script.kt @@ -0,0 +1,27 @@ +package hotlite.plugins.scriptmanager + +import com.example.EthanApiPlugin.EthanApiPlugin +import ext.kotlin.KClassExt.getInstance +import ext.runelite.PluginManagerExt.get +import net.runelite.api.Client +import net.runelite.api.widgets.Widget +import net.runelite.api.widgets.WidgetInfo +import net.runelite.client.RuneLite +import net.runelite.client.plugins.PluginManager + +open class Script(var priority: Int = Int.MAX_VALUE-1) { + val client = Client::class.getInstance() + val childScripts = arrayListOf