MCPcopy Create free account
hub / github.com/MaxBittker/rs-sdk / executeScript

Method executeScript

server/engine/src/engine/entity/Player.ts:2202–2229  ·  view source on GitHub ↗
(script: ScriptState, protect: boolean = false, force: boolean = false)

Source from the content-addressed store, hash-verified

2200 }
2201 return false;
2202 }
2203
2204 // copied from client
2205 isInWilderness(): boolean {
2206 if (this.x >= 2944 && this.x < 3392 && this.z >= 3520 && this.z < 6400) {
2207 return true;
2208 } else if (this.x >= 2944 && this.x < 3392 && this.z >= 9920 && this.z < 12800) {
2209 return true;
2210 } else {
2211 return false;
2212 }
2213 }
2214
2215 // ----
2216
2217 runScript(script: ScriptState, protect: boolean = false, force: boolean = false) {
2218 if (!force && protect && (this.protect || this.delayed)) {
2219 // can't get protected access, bye-bye
2220 // printDebug('No protected access:', script.script.name, protect, this.protect);
2221 return -1;
2222 }
2223
2224 if (protect) {
2225 script.pointerAdd(ScriptPointer.ProtectedActivePlayer);
2226 this.protect = true;
2227 }
2228
2229 const state = ScriptRunner.execute(script);
2230
2231 if (protect) {
2232 this.protect = false;

Callers 8

onLoginMethod · 0.95
processEngineQueueMethod · 0.95
closeTutorialMethod · 0.95
closeModalMethod · 0.95
processQueueMethod · 0.95
processWeakQueueMethod · 0.95
processTimersMethod · 0.95
tryInteractMethod · 0.95

Calls 4

runScriptMethod · 0.95
closeModalMethod · 0.95
popIntMethod · 0.80
enqueueScriptMethod · 0.45

Tested by

no test coverage detected