Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Realm Relay v1.1.0 Script Documentation
- designed for ROTMG v17.3+
- ________________________________________________________________
- :INDEX
- - General script info - GENERAL
- - Event handler info - EVENTS
- - Event function info - FUNCTIONS
- - Object data info - OBJECTS
- - Packet data info - PACKETS
- ________________________________________________________________
- :GENERAL
- - Realm Relay hacks are coded with JavaScript.
- - A new instance of each script is created for each relay user.
- - All information is lost when the user disconnects from the relay.
- - A few variable names may unusual, because they were obfuscated in the decompiled rotmg code.
- - Some variable names in packets or data objects may change later.
- - Not all RotMG packets are included because more insight into the rotmg code is necessary.
- - $ may be used universally as an alias to call functions from
- ________________________________________________________________
- :EVENTS
- - All event handlers have one or more parameters.
- - The first parameter is always the event object.
- - There are two types of event objects: ScheduledScriptEvent and PacketScriptEvent
- - The event object is necessary to perform many tasks (see FUNCTIONS).
- onEnable(ScheduledScriptEvent)
- fired when there is a new user connected to the relay
- onConnect(ScheduledScriptEvent)
- fired when the relay connects to the remote host successfully
- onConnectFail(ScheduledScriptEvent)
- fired when the relay failed to connect to the remote host
- onDisconnect(ScheduledScriptEvent)
- fired when the relay disconnects from the remote host
- onClientPacket(PacketScriptEvent)
- fired when the relay recieves a packet from the client
- onServerPacket(PacketScriptEvent)
- fired when the relay recieves a packet from the server
- ________________________________________________________________
- :FUNCTIONS
- - All Realm Relay default functions are defined in event objects.
- boolean connect(int gameId)
- - asynchronously (not blocking the current thread) tries a connection attempt
- - uses the gameId to determine what remote host:port to connect to
- - if gameId is not known, uses the remote host:port in the settings.properties file
- - returns true if the relay was not already connected to a remote host
- BitmapData createBitmapData()
- - creates a BitmapData object
- Item createItem()
- - creates an Item object
- Location createLocation()
- - creates a Location object
- LocationRecord createLocationRecord()
- - creates a LocationRecord object
- Entity createEntity()
- - creates an Entity object
- Packet createPacket(byte id)
- - using the packet id provided, creates the correct type of Packet
- SlotObject createSlotObject()
- - creates a SlotObject object
- StatData createStatData()
- - creates a StatData object
- Status createStatus()
- - creates a Status object
- Tile createTile()
- - creates a Tile object
- void disconnect()
- - disconnects the relay from the remote host
- void echo(String message)
- - echo a message to the console
- GroundData findGround(searchterm)
- - find GroundData for the specified id or type, null if not found
- ItemData findItem(searchterm)
- - find ItemData for the specified id or type, null if not found
- ObjectData findObject(searchterm)
- - find ObjectData for the specified id or type, null if not found
- byte findPacketId(string name)
- - find packet id, or -1 if not found
- Object getGlobal(string var)
- - get value of a global var
- string getRemoteHost()
- - gets the current remote host name
- int getRemotePort()
- - gets the current remote host port
- boolean isConnected()
- - returns true if the relay is connected to a remote host
- void kickUser()
- - disconnects from remote host and disconnects the relay user
- void scheduleEvent(double seconds, string eventMethod, object... arguments)
- - schedules eventMethod to be fired after seconds have passed
- - arguments are passed, but the first argument of the eventMethod is always the event object
- void sendToClient(Packet packet)
- - sends the packet to the client
- void sendToServer(Packet packet)
- - sends the packet to the server
- void setGameIdSocketAddress(int gameId, string host, int port)
- - configures realm relay to correctly connect to the host:port when using the connect(gameId) function
- void setGlobal(string var, Object value)
- - set global var to specified value
- !!! The following functions are only available in a PacketScriptEvent !!!
- void cancel()
- - cancels the event, causing the packet to not be sent
- Packet getPacket()
- - gets the Packet object involved in the event
- boolean isCancelled()
- - returns true if the event has been cancelled
- ________________________________________________________________
- :OBJECTS
- BitmapData
- int width
- int height;
- byte[] bytes;
- Entity
- short objectType
- Status status
- GroundData
- string id
- int type
- int maxDamage
- int minDamage
- boolean noWalk
- boolean push
- boolean sink
- float speed
- Item
- int item
- int slotType
- boolean tradeable
- boolean included
- ItemData
- string id
- int type
- int slotType
- int tier
- string petFamily
- string rarity
- string activate
- boolean consumable
- boolean soulbound
- boolean usable
- int bagType
- int feedPower
- float rateOfFire
- int fameBonus
- int mpCost
- int mpEndCost
- boolean multiPhase
- int numProjectiles
- ProjectileData[] projectiles
- Location
- float x
- float y
- float distanceSquaredTo(Location location)
- float distanceTo(Location location)
- LocationRecord
- int time
- float x
- float y
- float distanceSquaredTo(Location location)
- float distanceTo(Location location)
- ObjectData
- string id
- int type
- int maxHitPoints
- int maxSize
- int minSize
- int size
- int sizeStep
- int shadowSize
- int color
- float xpMult
- float rotation
- boolean drawOnGround
- boolean enemy
- boolean fullOccupy
- boolean occupySquare
- boolean enemyOccupySquare
- boolean blocksSight
- boolean noMiniMap
- boolean stasisImmune
- boolean protectFromGroundDamage
- boolean protectFromSink
- boolean connects
- float z
- Packet
- byte id()
- string toString()
- ProjectileData
- string objectId
- float speed
- int maxDamage
- int minDamage
- int lifetimeMS
- SlotObject
- int objectId
- int slotId
- int objectType
- StatData
- int obf0
- int obf1
- string obf2
- Status
- int objectId
- Location pos
- StatData[] data
- Tile
- short x
- short y
- int type
- ________________________________________________________________
- :PACKETS
- - All packet objects implement the id() function
- !!! The following packets are CLIENT packets !!!
- ACCEPTTRADE
- boolean[] myOffer
- boolean[] yourOffer
- AOEACK
- int time
- Location position
- BUY
- int objectId
- CANCELTRADE
- CHANGEGUILDRANK
- string name
- int guildRank
- CHANGETRADE
- boolean[] offer
- CHECKCREDITS
- CHOOSENAME
- string name
- CREATEGUILD
- string name
- CREATE
- int classType
- int skinType
- EDITACCOUNTLIST
- int accountListId
- boolean add
- int objectId
- ENEMYHIT
- int time
- int bulletId
- int targetId
- boolean kill
- ESCAPE
- GOTOACK
- int time
- GROUNDDAMAGE
- int time
- Location position
- GUILDINVITE
- string name
- GUILDREMOVE
- string name
- HELLO
- string buildVersion
- int gameId
- string guid
- string password
- string secret
- int keyTime
- byte[] key
- byte[] obf0
- string obf1
- string obf2
- string obf3
- string obf4
- string obf5
- INVDROP
- SlotObject slotObject
- INVSWAP
- int time
- Location position
- SlotObject slotObject1
- SlotObject slotObject2
- JOINGUILD
- string guildName
- LOAD
- int charId
- boolean isFromArena
- MOVE
- int tickId
- int time
- Location newPosition
- LocationRecord[] records
- OTHERHIT
- int time
- int bulletId
- int objectId
- int targetId
- PLAYERHIT
- int bulletId
- int objectId
- PLAYERSHOOT
- int time
- int bulletId
- int containerType
- Location startingPos
- float angle
- PLAYERTEXT
- string text
- PONG
- int serial
- int time
- REQUESTTRADE
- string name
- RESKIN
- int skinID
- SETCONDITION
- int conditionEffect
- float conditionDuration
- SHOOTACK
- int time
- SQUAREHIT
- int time
- int bulletId
- int objectId
- TELEPORT
- int objectId
- UPDATEACK
- USEITEM
- int time
- SlotObject slotObject
- Location itemUsePos
- int useType
- USEPORTAL
- int objectId
- !!! The following packets are SERVER packets !!!
- ACCOUNTLIST
- int accountListId
- string[] accountIds
- ALLYSHOOT
- int bulletId
- int ownerId
- short containerId
- float angle
- AOE
- Location pos
- float radius
- int damage
- int effect
- float duration
- int origType
- BUY
- int result
- string resultString
- CLIENTSTAT
- string name
- int value
- CREATE_SUCCESS
- int objectId
- int charId
- CREATEGUILDRESULT
- boolean success
- string errorText
- DAMAGE
- int targetId
- int[] effects
- int damageAmount
- boolean kill
- int bulletId
- int objectId
- DEATH
- string accountId
- int charId
- string killedBy
- int obf0
- int obf1
- FAILURE
- int errorId
- string errorDescription
- FILE
- string name
- byte[] bytes
- GLOBAL_NOTIFICATION
- int type
- string text
- GOTO
- int objectId
- Location pos
- INVITEDTOGUILD
- string name
- string guildName
- INVRESULT
- int result
- MAPINFO
- int width
- int height
- string name
- string obf0
- int obf1
- int fp
- int background
- boolean allowPlayerTeleport
- boolean showDisplays
- string[] clientXML
- string[] extraXML
- NAMERESULT
- boolean success
- string errorText
- NEW_TICK
- int tickId
- int tickTime
- Status[] statuses
- NOTIFICATION
- int objectId
- string message
- int color
- PIC
- BitmapData bitmapData
- PING
- int serial
- PLAYSOUND
- int ownerId
- int soundId
- QUESTOBJID
- int objectId
- RECONNECT
- string name
- string host
- int port
- int gameId
- int keyTime
- boolean isFromArena
- byte[] key
- SHOOT2
- int bulletId
- int ownerId
- int containerId
- Location startingPos
- float angle
- short damage
- SHOOT
- int bulletId
- int ownerId
- int bulletType
- Location startingPos
- float angle
- short damage
- int numShots
- float angleInc
- SHOW_EFFECT
- int effectType
- int targetObjectId
- Location pos1
- Location pos2
- int color
- TEXT
- string name
- int objectId
- int numStars
- int bubbleTime
- string recipient
- string text
- string cleanText
- TRADEACCEPTED
- boolean[] myOffer
- boolean[] yourOffer
- TRADECHANGED
- boolean[] offer
- TRADEDONE
- int code
- string description
- TRADEREQUESTED
- string name
- TRADESTART
- Item[] myItems
- string yourName
- Item[] yourItems
- UPDATE
- Tile[] tiles
- Entity[] newObjs
- int[] drops
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement