Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.p3achb0t.scripts_private.Zulrah
- import com.p3achb0t.api.Context
- import com.p3achb0t.api.wrappers.Tile
- import com.p3achb0t.api.wrappers.utils.Utils
- import com.p3achb0t.scripts_private.Zulrah.Combat.Companion.aliveCheck
- import com.p3achb0t.scripts_private.Zulrah.Combat.Companion.haskilled
- import com.p3achb0t.scripts_private.Zulrah.Combat.Companion.killTime
- import com.p3achb0t.scripts_private.Zulrah.Combat.Companion.kills
- import com.p3achb0t.scripts_private.Zulrah.Combat.Companion.pass
- import com.p3achb0t.scripts_private.Zulrah.Combat.Companion.phase
- import com.p3achb0t.scripts_private.Zulrah.Combat.Companion.phaseTimer
- import com.p3achb0t.scripts_private.Zulrah.Combat.Companion.rotation
- import com.p3achb0t.scripts_private.Zulrah.Combat.Companion.safeTile
- import com.p3achb0t.scripts_private.Zulrah.Combat.Companion.startingTile
- fun zulrahPaintDebug(ctx: Context) {
- fun nextPhase() {
- phase++
- phaseTimer.reset()
- phaseTimer.start()
- }
- fun nextPass() {
- phase = 1
- pass++
- rotation = 0
- phaseTimer.reset()
- phaseTimer.start()
- }
- fun setTile(tile: Tile) {
- if (safeTile.x != tile.x || safeTile.y != tile.y) {
- safeTile = tile
- }
- }
- while (true) {
- // rotation and phase logic
- try {
- val localNpcs = ctx.client.getNpcs()
- localNpcs.forEachIndexed { index, npci ->
- if (npci != null) {
- if (npci.getType().getName().equals("Zulrah")) {
- if (npci.getSequence() == 5804) {
- if (phaseTimer.time > 0) {
- kills++
- haskilled = true
- }
- phaseTimer.reset()
- killTime.reset()
- aliveCheck.reset()
- phase = 1
- pass = 1
- rotation = 0
- }
- if (npci.getSequence() == 5071) {
- if (phaseTimer.time <= 0) startingTile = ctx.players.getLocal().getGlobalLocation()
- if (phaseTimer.time <= 0) phaseTimer.start()
- if (killTime.time <= 0) killTime.start()
- if (aliveCheck.time <= 0) aliveCheck.start()
- }
- if (phase == 1) {
- setTile(Tile(startingTile.x + 6, startingTile.y + 9, ctx = ctx))
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) {
- nextPhase()
- }
- }
- if (phase == 2) {
- if (npci.getType().getId() == 2042) {
- if (npci.getSequence() == 5073) rotation = 3
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (npci.getType().getId() == 2044) {
- if (Utils.getElapsedSeconds(phaseTimer.time) > 15) setTile(Tile(startingTile.x + 4, startingTile.y + 3, ctx = ctx).getGlobalLocation())
- if (Utils.getElapsedSeconds(phaseTimer.time) <= 15) setTile(Tile(startingTile.x + 6, startingTile.y + 9, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5073) rotation = 4
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (npci.getType().getId() == 2043) {
- if (npci.getSequence() == 5806) setTile(Tile(startingTile.x + 4, startingTile.y + 10, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- }
- if (rotation != 3 && rotation != 4) {
- if (phase == 3) {
- setTile(Tile(startingTile.x + 4, startingTile.y + 2, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 4) {
- setTile(Tile(startingTile.x - 4, startingTile.y + 4, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 5) {
- if (npci.getType().getId() == 2042 && pass > 1) setTile(Tile(startingTile.x - 4, startingTile.y + 3, ctx = ctx).getGlobalLocation())
- if (npci.getType().getId() == 2043) rotation = 1
- if (npci.getType().getId() == 2044) rotation = 2
- }
- }
- // rotation 1
- if (rotation == 1) {
- if (phase == 5) {
- setTile(Tile(startingTile.x - 4, startingTile.y + 4, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 6) {
- if (npci.getType().getId() != 2042) setTile(Tile(startingTile.x + 4, startingTile.y + 3, ctx = ctx).getGlobalLocation())
- if (pass == 2 && npci.getType().getId() == 2042) setTile(Tile(startingTile.x + 4, startingTile.y + 2, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5 && npci.getType().getId() != 2042) nextPhase()
- }
- if (phase == 7) {
- setTile(Tile(startingTile.x + 4, startingTile.y + 3, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 8) {
- if (Utils.getElapsedSeconds(phaseTimer.time) < 11) setTile(Tile(startingTile.x + 4, startingTile.y + 5, ctx = ctx).getGlobalLocation())
- if (Utils.getElapsedSeconds(phaseTimer.time) > 10) setTile(Tile(startingTile.x - 4, startingTile.y + 5, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 9) {
- if (Utils.getElapsedSeconds(phaseTimer.time) > 19) setTile(Tile(startingTile.x + 4, startingTile.y + 10, ctx = ctx).getGlobalLocation())
- if (Utils.getElapsedSeconds(phaseTimer.time) <= 19) setTile(Tile(startingTile.x - 4, startingTile.y + 5, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 10) {
- if (npci.getOrientation() != 1281) setTile(Tile(startingTile.x + 4, startingTile.y + 10, ctx = ctx).getGlobalLocation())
- if (npci.getOrientation() == 1281) setTile(Tile(startingTile.x + 6, startingTile.y + 9, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPass()
- }
- }
- // rotation 2
- if (rotation == 2) {
- if (phase == 5) {
- if (Utils.getElapsedSeconds(phaseTimer.time) <= 8) setTile(Tile(startingTile.x - 4, startingTile.y + 6, ctx = ctx).getGlobalLocation())
- if (Utils.getElapsedSeconds(phaseTimer.time) > 8) setTile(Tile(startingTile.x + 4, startingTile.y + 10, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 6) {
- if (npci.getOrientation() != 1281) setTile(Tile(startingTile.x + 4, startingTile.y + 10, ctx = ctx).getGlobalLocation())
- if (npci.getOrientation() == 1281) setTile(Tile(startingTile.x + 6, startingTile.y + 9, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 7) {
- setTile(Tile(startingTile.x + 4, startingTile.y + 2, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 8) {
- setTile(Tile(startingTile.x - 4, startingTile.y + 5, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 9) {
- if (Utils.getElapsedSeconds(phaseTimer.time) > 19) setTile(Tile(startingTile.x + 4, startingTile.y + 10, ctx = ctx).getGlobalLocation())
- if (Utils.getElapsedSeconds(phaseTimer.time) <= 19) setTile(Tile(startingTile.x - 4, startingTile.y + 5, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 10) {
- if (npci.getOrientation() != 1281) setTile(Tile(startingTile.x + 4, startingTile.y + 10, ctx = ctx).getGlobalLocation())
- if (npci.getOrientation() == 1281) setTile(Tile(startingTile.x + 6, startingTile.y + 9, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPass()
- }
- }
- // rotation 3
- if (rotation == 3) {
- if (phase == 3) {
- if (npci.getOrientation() != 804) setTile(Tile(startingTile.x - 4, startingTile.y + 10, ctx = ctx).getGlobalLocation())
- if (npci.getOrientation() == 804) setTile(Tile(startingTile.x - 6, startingTile.y + 7, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 4) {
- setTile(Tile(startingTile.x + 4, startingTile.y + 2, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 5) {
- setTile(Tile(startingTile.x, startingTile.y + 2, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 6) {
- if (pass == 1) {
- setTile(Tile(startingTile.x - 5, startingTile.y + 3, ctx = ctx).getGlobalLocation())
- }
- if (pass > 1) {
- if (npci.getX() < ctx.players.getLocal().x) setTile(Tile(startingTile.x + 4, startingTile.y + 3, ctx = ctx).getGlobalLocation())
- if (npci.getX() > ctx.players.getLocal().x) setTile(Tile(startingTile.x - 5, startingTile.y + 3, ctx = ctx).getGlobalLocation())
- }
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5 && pass == 1) nextPhase()
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5 && pass > 1 && npci.getX() > ctx.players.getLocal().x) nextPhase()
- }
- if (phase == 7) {
- setTile(Tile(startingTile.x - 5, startingTile.y + 3, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 8) {
- setTile(Tile(startingTile.x - 4, startingTile.y + 4, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 9) {
- setTile(Tile(startingTile.x + 4, startingTile.y + 2, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 10) {
- setTile(Tile(startingTile.x + 4, startingTile.y + 2, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 11) {
- setTile(Tile(startingTile.x + 4, startingTile.y + 2, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPass()
- }
- }
- // rotation 4
- if (rotation == 4) {
- if (phase == 3) {
- setTile(Tile(startingTile.x + 4, startingTile.y + 3, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 4) {
- setTile(Tile(startingTile.x + 4, startingTile.y + 3, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 5) {
- if (npci.getType().getId() == 2044 && pass > 1 && Utils.getElapsedSeconds(phaseTimer.time) > 7) setTile(Tile(startingTile.x + 4, startingTile.y + 2, ctx = ctx).getGlobalLocation())
- if (npci.getType().getId() == 2043 && pass > 1 && Utils.getElapsedSeconds(phaseTimer.time) > 7) setTile(Tile(startingTile.x + 4, startingTile.y + 3, ctx = ctx).getGlobalLocation())
- if (pass == 1) setTile(Tile(startingTile.x + 4, startingTile.y + 3, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && npci.getType().getId() != 2044 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 6) {
- setTile(Tile(startingTile.x + 4, startingTile.y + 3, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 7) {
- setTile(Tile(startingTile.x - 4, startingTile.y + 4, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 8) {
- setTile(Tile(startingTile.x - 4, startingTile.y + 4, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 9) {
- setTile(Tile(startingTile.x + 4, startingTile.y + 3, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 10) {
- setTile(Tile(startingTile.x + 4, startingTile.y + 2, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 11) {
- setTile(Tile(startingTile.x + 4, startingTile.y + 3, ctx = ctx).getGlobalLocation())
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPhase()
- }
- if (phase == 12) {
- setTile(Tile(startingTile.x + 6, startingTile.y + 9, ctx = ctx))
- if (npci.getSequence() == 5072 && Utils.getElapsedSeconds(phaseTimer.time) > 5) nextPass()
- }
- }
- }
- }
- }
- Thread.sleep(200)
- } catch (e: Exception) {
- println("Error: NPC Paint " + e.message)
- e.stackTrace.iterator().forEach {
- println(it)
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement