Advertisement
asciicat

Untitled

Dec 19th, 2014
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.44 KB | None | 0 0
  1. Realm Relay v1.1.0 Script Documentation
  2. designed for ROTMG v17.3+
  3. ________________________________________________________________
  4. :INDEX
  5. - General script info - GENERAL
  6. - Event handler info - EVENTS
  7. - Event function info - FUNCTIONS
  8. - Object data info - OBJECTS
  9. - Packet data info - PACKETS
  10. ________________________________________________________________
  11. :GENERAL
  12. - Realm Relay hacks are coded with JavaScript.
  13. - A new instance of each script is created for each relay user.
  14. - All information is lost when the user disconnects from the relay.
  15. - A few variable names may unusual, because they were obfuscated in the decompiled rotmg code.
  16. - Some variable names in packets or data objects may change later.
  17. - Not all RotMG packets are included because more insight into the rotmg code is necessary.
  18. - $ may be used universally as an alias to call functions from
  19. ________________________________________________________________
  20. :EVENTS
  21. - All event handlers have one or more parameters.
  22. - The first parameter is always the event object.
  23. - There are two types of event objects: ScheduledScriptEvent and PacketScriptEvent
  24. - The event object is necessary to perform many tasks (see FUNCTIONS).
  25.  
  26. onEnable(ScheduledScriptEvent)
  27. fired when there is a new user connected to the relay
  28.  
  29. onConnect(ScheduledScriptEvent)
  30. fired when the relay connects to the remote host successfully
  31.  
  32. onConnectFail(ScheduledScriptEvent)
  33. fired when the relay failed to connect to the remote host
  34.  
  35. onDisconnect(ScheduledScriptEvent)
  36. fired when the relay disconnects from the remote host
  37.  
  38. onClientPacket(PacketScriptEvent)
  39. fired when the relay recieves a packet from the client
  40.  
  41. onServerPacket(PacketScriptEvent)
  42. fired when the relay recieves a packet from the server
  43. ________________________________________________________________
  44. :FUNCTIONS
  45. - All Realm Relay default functions are defined in event objects.
  46.  
  47. boolean connect(int gameId)
  48. - asynchronously (not blocking the current thread) tries a connection attempt
  49. - uses the gameId to determine what remote host:port to connect to
  50. - if gameId is not known, uses the remote host:port in the settings.properties file
  51. - returns true if the relay was not already connected to a remote host
  52.  
  53. BitmapData createBitmapData()
  54. - creates a BitmapData object
  55.  
  56. Item createItem()
  57. - creates an Item object
  58.  
  59. Location createLocation()
  60. - creates a Location object
  61.  
  62. LocationRecord createLocationRecord()
  63. - creates a LocationRecord object
  64.  
  65. Entity createEntity()
  66. - creates an Entity object
  67.  
  68. Packet createPacket(byte id)
  69. - using the packet id provided, creates the correct type of Packet
  70.  
  71. SlotObject createSlotObject()
  72. - creates a SlotObject object
  73.  
  74. StatData createStatData()
  75. - creates a StatData object
  76.  
  77. Status createStatus()
  78. - creates a Status object
  79.  
  80. Tile createTile()
  81. - creates a Tile object
  82.  
  83. void disconnect()
  84. - disconnects the relay from the remote host
  85.  
  86. void echo(String message)
  87. - echo a message to the console
  88.  
  89. GroundData findGround(searchterm)
  90. - find GroundData for the specified id or type, null if not found
  91.  
  92. ItemData findItem(searchterm)
  93. - find ItemData for the specified id or type, null if not found
  94.  
  95. ObjectData findObject(searchterm)
  96. - find ObjectData for the specified id or type, null if not found
  97.  
  98. byte findPacketId(string name)
  99. - find packet id, or -1 if not found
  100.  
  101. Object getGlobal(string var)
  102. - get value of a global var
  103.  
  104. string getRemoteHost()
  105. - gets the current remote host name
  106.  
  107. int getRemotePort()
  108. - gets the current remote host port
  109.  
  110. boolean isConnected()
  111. - returns true if the relay is connected to a remote host
  112.  
  113. void kickUser()
  114. - disconnects from remote host and disconnects the relay user
  115.  
  116. void scheduleEvent(double seconds, string eventMethod, object... arguments)
  117. - schedules eventMethod to be fired after seconds have passed
  118. - arguments are passed, but the first argument of the eventMethod is always the event object
  119.  
  120. void sendToClient(Packet packet)
  121. - sends the packet to the client
  122.  
  123. void sendToServer(Packet packet)
  124. - sends the packet to the server
  125.  
  126. void setGameIdSocketAddress(int gameId, string host, int port)
  127. - configures realm relay to correctly connect to the host:port when using the connect(gameId) function
  128.  
  129. void setGlobal(string var, Object value)
  130. - set global var to specified value
  131.  
  132. !!! The following functions are only available in a PacketScriptEvent !!!
  133.  
  134. void cancel()
  135. - cancels the event, causing the packet to not be sent
  136.  
  137. Packet getPacket()
  138. - gets the Packet object involved in the event
  139.  
  140. boolean isCancelled()
  141. - returns true if the event has been cancelled
  142. ________________________________________________________________
  143. :OBJECTS
  144.  
  145. BitmapData
  146. int width
  147. int height;
  148. byte[] bytes;
  149.  
  150. Entity
  151. short objectType
  152. Status status
  153.  
  154. GroundData
  155. string id
  156. int type
  157. int maxDamage
  158. int minDamage
  159. boolean noWalk
  160. boolean push
  161. boolean sink
  162. float speed
  163.  
  164. Item
  165. int item
  166. int slotType
  167. boolean tradeable
  168. boolean included
  169.  
  170. ItemData
  171. string id
  172. int type
  173. int slotType
  174. int tier
  175. string petFamily
  176. string rarity
  177. string activate
  178. boolean consumable
  179. boolean soulbound
  180. boolean usable
  181. int bagType
  182. int feedPower
  183. float rateOfFire
  184. int fameBonus
  185. int mpCost
  186. int mpEndCost
  187. boolean multiPhase
  188. int numProjectiles
  189. ProjectileData[] projectiles
  190.  
  191. Location
  192. float x
  193. float y
  194. float distanceSquaredTo(Location location)
  195. float distanceTo(Location location)
  196.  
  197. LocationRecord
  198. int time
  199. float x
  200. float y
  201. float distanceSquaredTo(Location location)
  202. float distanceTo(Location location)
  203.  
  204. ObjectData
  205. string id
  206. int type
  207. int maxHitPoints
  208. int maxSize
  209. int minSize
  210. int size
  211. int sizeStep
  212. int shadowSize
  213. int color
  214. float xpMult
  215. float rotation
  216. boolean drawOnGround
  217. boolean enemy
  218. boolean fullOccupy
  219. boolean occupySquare
  220. boolean enemyOccupySquare
  221. boolean blocksSight
  222. boolean noMiniMap
  223. boolean stasisImmune
  224. boolean protectFromGroundDamage
  225. boolean protectFromSink
  226. boolean connects
  227. float z
  228.  
  229. Packet
  230. byte id()
  231. string toString()
  232.  
  233. ProjectileData
  234. string objectId
  235. float speed
  236. int maxDamage
  237. int minDamage
  238. int lifetimeMS
  239.  
  240. SlotObject
  241. int objectId
  242. int slotId
  243. int objectType
  244.  
  245. StatData
  246. int obf0
  247. int obf1
  248. string obf2
  249.  
  250. Status
  251. int objectId
  252. Location pos
  253. StatData[] data
  254.  
  255. Tile
  256. short x
  257. short y
  258. int type
  259. ________________________________________________________________
  260. :PACKETS
  261. - All packet objects implement the id() function
  262.  
  263. !!! The following packets are CLIENT packets !!!
  264.  
  265. ACCEPTTRADE
  266. boolean[] myOffer
  267. boolean[] yourOffer
  268.  
  269. AOEACK
  270. int time
  271. Location position
  272.  
  273. BUY
  274. int objectId
  275.  
  276. CANCELTRADE
  277.  
  278. CHANGEGUILDRANK
  279. string name
  280. int guildRank
  281.  
  282. CHANGETRADE
  283. boolean[] offer
  284.  
  285. CHECKCREDITS
  286.  
  287. CHOOSENAME
  288. string name
  289.  
  290. CREATEGUILD
  291. string name
  292.  
  293. CREATE
  294. int classType
  295. int skinType
  296.  
  297. EDITACCOUNTLIST
  298. int accountListId
  299. boolean add
  300. int objectId
  301.  
  302. ENEMYHIT
  303. int time
  304. int bulletId
  305. int targetId
  306. boolean kill
  307.  
  308. ESCAPE
  309.  
  310. GOTOACK
  311. int time
  312.  
  313. GROUNDDAMAGE
  314. int time
  315. Location position
  316.  
  317. GUILDINVITE
  318. string name
  319.  
  320. GUILDREMOVE
  321. string name
  322.  
  323. HELLO
  324. string buildVersion
  325. int gameId
  326. string guid
  327. string password
  328. string secret
  329. int keyTime
  330. byte[] key
  331. byte[] obf0
  332. string obf1
  333. string obf2
  334. string obf3
  335. string obf4
  336. string obf5
  337.  
  338. INVDROP
  339. SlotObject slotObject
  340.  
  341. INVSWAP
  342. int time
  343. Location position
  344. SlotObject slotObject1
  345. SlotObject slotObject2
  346.  
  347. JOINGUILD
  348. string guildName
  349.  
  350. LOAD
  351. int charId
  352. boolean isFromArena
  353.  
  354. MOVE
  355. int tickId
  356. int time
  357. Location newPosition
  358. LocationRecord[] records
  359.  
  360. OTHERHIT
  361. int time
  362. int bulletId
  363. int objectId
  364. int targetId
  365.  
  366. PLAYERHIT
  367. int bulletId
  368. int objectId
  369.  
  370. PLAYERSHOOT
  371. int time
  372. int bulletId
  373. int containerType
  374. Location startingPos
  375. float angle
  376.  
  377. PLAYERTEXT
  378. string text
  379.  
  380. PONG
  381. int serial
  382. int time
  383.  
  384. REQUESTTRADE
  385. string name
  386.  
  387. RESKIN
  388. int skinID
  389.  
  390. SETCONDITION
  391. int conditionEffect
  392. float conditionDuration
  393.  
  394. SHOOTACK
  395. int time
  396.  
  397. SQUAREHIT
  398. int time
  399. int bulletId
  400. int objectId
  401.  
  402. TELEPORT
  403. int objectId
  404.  
  405. UPDATEACK
  406.  
  407. USEITEM
  408. int time
  409. SlotObject slotObject
  410. Location itemUsePos
  411. int useType
  412.  
  413. USEPORTAL
  414. int objectId
  415.  
  416. !!! The following packets are SERVER packets !!!
  417.  
  418. ACCOUNTLIST
  419. int accountListId
  420. string[] accountIds
  421.  
  422. ALLYSHOOT
  423. int bulletId
  424. int ownerId
  425. short containerId
  426. float angle
  427.  
  428. AOE
  429. Location pos
  430. float radius
  431. int damage
  432. int effect
  433. float duration
  434. int origType
  435.  
  436. BUY
  437. int result
  438. string resultString
  439.  
  440. CLIENTSTAT
  441. string name
  442. int value
  443.  
  444. CREATE_SUCCESS
  445. int objectId
  446. int charId
  447.  
  448. CREATEGUILDRESULT
  449. boolean success
  450. string errorText
  451.  
  452. DAMAGE
  453. int targetId
  454. int[] effects
  455. int damageAmount
  456. boolean kill
  457. int bulletId
  458. int objectId
  459.  
  460. DEATH
  461. string accountId
  462. int charId
  463. string killedBy
  464. int obf0
  465. int obf1
  466.  
  467. FAILURE
  468. int errorId
  469. string errorDescription
  470.  
  471. FILE
  472. string name
  473. byte[] bytes
  474.  
  475. GLOBAL_NOTIFICATION
  476. int type
  477. string text
  478.  
  479. GOTO
  480. int objectId
  481. Location pos
  482.  
  483. INVITEDTOGUILD
  484. string name
  485. string guildName
  486.  
  487. INVRESULT
  488. int result
  489.  
  490. MAPINFO
  491. int width
  492. int height
  493. string name
  494. string obf0
  495. int obf1
  496. int fp
  497. int background
  498. boolean allowPlayerTeleport
  499. boolean showDisplays
  500. string[] clientXML
  501. string[] extraXML
  502.  
  503. NAMERESULT
  504. boolean success
  505. string errorText
  506.  
  507. NEW_TICK
  508. int tickId
  509. int tickTime
  510. Status[] statuses
  511.  
  512. NOTIFICATION
  513. int objectId
  514. string message
  515. int color
  516.  
  517. PIC
  518. BitmapData bitmapData
  519.  
  520. PING
  521. int serial
  522.  
  523. PLAYSOUND
  524. int ownerId
  525. int soundId
  526.  
  527. QUESTOBJID
  528. int objectId
  529.  
  530. RECONNECT
  531. string name
  532. string host
  533. int port
  534. int gameId
  535. int keyTime
  536. boolean isFromArena
  537. byte[] key
  538.  
  539. SHOOT2
  540. int bulletId
  541. int ownerId
  542. int containerId
  543. Location startingPos
  544. float angle
  545. short damage
  546.  
  547. SHOOT
  548. int bulletId
  549. int ownerId
  550. int bulletType
  551. Location startingPos
  552. float angle
  553. short damage
  554. int numShots
  555. float angleInc
  556.  
  557. SHOW_EFFECT
  558. int effectType
  559. int targetObjectId
  560. Location pos1
  561. Location pos2
  562. int color
  563.  
  564. TEXT
  565. string name
  566. int objectId
  567. int numStars
  568. int bubbleTime
  569. string recipient
  570. string text
  571. string cleanText
  572.  
  573. TRADEACCEPTED
  574. boolean[] myOffer
  575. boolean[] yourOffer
  576.  
  577. TRADECHANGED
  578. boolean[] offer
  579.  
  580. TRADEDONE
  581. int code
  582. string description
  583.  
  584. TRADEREQUESTED
  585. string name
  586.  
  587. TRADESTART
  588. Item[] myItems
  589. string yourName
  590. Item[] yourItems
  591.  
  592. UPDATE
  593. Tile[] tiles
  594. Entity[] newObjs
  595. int[] drops
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement