Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.18 KB | None | 0 0
  1. --[[
  2.  
  3. * main.lua - Main Lua script.
  4. * -----------------------------------------------------------------------
  5. *
  6. * This file is part of Ashita.
  7. *
  8. * Ashita is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Lesser General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * Ashita is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public License
  19. * along with Ashita. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21.  
  22. ]]--
  23.  
  24. -----------------------------------------------------------------------
  25. -- DO NOT EDIT THE LINES BELOW!
  26. -----------------------------------------------------------------------
  27. -- Include helpful headers..
  28. require( "events" );
  29.  
  30. -- Include extension files..
  31. require( "extensions/math" );
  32. require( "extensions/string" );
  33. require( "extensions/table" );
  34. require( "extensions/timer" );
  35. require( 'plugins' );
  36. -- Include Final Fantasy Headers
  37. require( "ffxi/common" );
  38. require( "ffxi/inventory" );
  39.  
  40. Recast = require( "ffxi/recast" );
  41. VanaTime = require( "ffxi/vanatime" );
  42. Weather = require( "ffxi/weather" );
  43.  
  44. -----------------------------------------------------------------------
  45. -- DO NOT EDIT THE LINES ABOVE!
  46. -----------------------------------------------------------------------
  47.  
  48. ----------------------------------------------------------------------
  49. -- func : onHandleCommand
  50. -- desc : Event callback for onHandleCommand event.
  51. ----------------------------------------------------------------------
  52. function onHandleCommand( cmd, nType )
  53. -- Parse the command into arguments..
  54. local args = cmd:GetArgs();
  55. if (cmd == "/dbox") then
  56. -- Create a new packet table
  57. dboxpacket = {}
  58. -- initialize the packet to 0
  59. for i=1,32 do
  60. dboxpacket[i] = 0
  61. end
  62. -- add some static bytes to the packet
  63. for j=5,13 do
  64. dboxpacket[j] = 0xFF
  65. end
  66. -- Set the packet action type to "Open Menu"
  67. dboxpacket[5] = 0x0E
  68. -- Send the packet out
  69. -- 32 is the size of the whole packet including the header
  70. -- 0x4D is the packet ID
  71. AddOutgoingPacket(dboxpacket, 0x4D, 32)
  72. return true;
  73. end
  74. if(cmd == "/sjob war") then --Job Sjob
  75. dboxpacket = {0x100, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00}
  76. AddOutgoingPacket(dboxpacket, 0x100, 8)
  77. return true;
  78. end
  79. if(cmd == "/sjob mnk") then
  80. dboxpacket = {0x100, 0x00, 0x05, 0xA7, 0x00, 0x02, 0x00, 0x00}
  81. AddOutgoingPacket(dboxpacket, 0x100, 8)
  82. return true;
  83. end
  84. if(cmd == "/sjob whm") then
  85. dboxpacket = {0x100, 0x00, 0x05, 0xA7, 0x00, 0x03, 0x00, 0x00}
  86. AddOutgoingPacket(dboxpacket, 0x100, 8)
  87. return true;
  88. end
  89. if(cmd == "/sjob sam") then
  90. dboxpacket = {0x100, 0x00, 0x05, 0xA7, 0x0C, 0x00, 0x00, 0x00}
  91. AddOutgoingPacket(dboxpacket, 0x100, 8)
  92. return true;
  93. end
  94. if(cmd == "/sjob nin") then
  95. dboxpacket = {0x100, 0x00, 0x05, 0xA7, 0x00, 0x0D, 0x00, 0x00}
  96. AddOutgoingPacket(dboxpacket, 0x100, 8)
  97. return true;
  98. end
  99. if(cmd == "/sjob dnc") then
  100. dboxpacket = {0x100, 0x00, 0x05, 0xA7, 0x00, 0x13, 0x00, 0x00}
  101. AddOutgoingPacket(dboxpacket, 0x100, 8)
  102. return true;
  103. end
  104. if(cmd == "/talk") then --mhuara mog
  105. dboxpacket = {0x1A, 0x08 ,0xEE,0x00, 0x7B, 0x90, 0x0F ,0x01 ,0x7B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,0x00 }
  106. AddOutgoingPacket(dboxpacket, 0x1A, 16)
  107. return true;
  108. end
  109. if(cmd == "/ro") then
  110. dboxpacket = {0x5E, 0x0C, 0x2A, 0x00, 0x7A, 0x33, 0x64, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
  111. AddOutgoingPacket(dboxpacket, 0x5E, 24)
  112. return true;
  113. end
  114. if(cmd == "/tr") then
  115. dboxpacket = {0x5E, 0x0C, 0x2D, 0x00, 0x7A, 0x33, 0x64, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
  116. AddOutgoingPacket(dboxpacket, 0x5E, 24)
  117. return true;
  118. end
  119. if(cmd == "/turtle") then
  120. dboxpacket = {0x5E, 0x0C, 0x2D, 0x00, 0x7A, 0x33, 0x35, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
  121. AddOutgoingPacket(dboxpacket, 0x5E, 24)
  122. return true;
  123. end
  124. if(cmd == "/faf") then
  125. dboxpacket = {0x5E, 0x0C, 0x0D, 0x00, 0x7A, 0x34, 0x39, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
  126. AddOutgoingPacket(dboxpacket, 0x5E, 24)
  127. return true;
  128. end
  129. if(cmd == "/beh") then
  130. dboxpacket = {0x5E, 0x0C, 0x0D, 0x00, 0x7A, 0x33, 0x69, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
  131. AddOutgoingPacket(dboxpacket, 0x5E, 24)
  132. return true;
  133. end
  134. if(cmd == "/zi") then
  135. dboxpacket = {0x5E, 0x0C, 0x2A, 0x00, 0x7A, 0x33, 0x62, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
  136. AddOutgoingPacket(dboxpacket, 0x5E, 24)
  137. return true;
  138. end
  139. if(cmd == "/mn") then
  140. dboxpacket = {0x5E, 0x0C, 0x2A, 0x00, 0x7A, 0x33, 0x63, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
  141. AddOutgoingPacket(dboxpacket, 0x5E, 24)
  142. return true;
  143. end
  144. if ((args[1] == '/attack') or (args[1] == '/a')) then
  145. Target = AshitaCore:GetDataModule():GetTarget():GetTargetWindow();
  146. AshitaCore:GetDataModule():SendCommand( string.format('/p z2z %d',Target.ID), CommandType.Typed );
  147. return false;
  148. end
  149. -- Validate this is a LuaCast command..
  150. if (args[1] ~= "/luacast") then
  151. return false;
  152. end
  153.  
  154. -- Handle LuaCast wave command..
  155. if (args[2] == 'wave') then
  156. AshitaCore:GetDataModule():SendCommand( '/wave', CommandType.Typed );
  157. return true;
  158. end
  159.  
  160.  
  161. return false;
  162. end
  163. events.Add( "onHandleCommand", "luaCast_onHandleCommand", onHandleCommand );
  164.  
  165. ----------------------------------------------------------------------
  166. -- func : onHandleNewChatLine
  167. -- desc : Event callback for onHandleNewChatLine event.
  168. ----------------------------------------------------------------------
  169. function onHandleNewChatLine( nMode, text )
  170. local args = text:GetArgs();
  171. if (args[2] == 'z2z') then
  172. AshitaCore:GetDataModule():SendCommand( string.format('/target %d',args[3]), CommandType.Menu );
  173. AshitaCore:GetDataModule():SendCommand( '/attack <t>', CommandType.Typed);
  174. return false;
  175. end
  176. if (args[3] == 'z2z') then
  177. AshitaCore:GetDataModule():SendCommand( string.format('/target %d',args[4]), CommandType.Menu );
  178. AshitaCore:GetDataModule():SendCommand( '/attack <t>', CommandType.Typed);
  179. return false;
  180. end
  181. return false;
  182. end
  183. events.Add( "onHandleNewChatLine", "luaCast_onHandleNewChatLine", onHandleNewChatLine );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement