--[[ * main.lua - Main Lua script. * ----------------------------------------------------------------------- * * This file is part of Ashita. * * Ashita is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Ashita is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Ashita. If not, see . * ]]-- ----------------------------------------------------------------------- -- DO NOT EDIT THE LINES BELOW! ----------------------------------------------------------------------- -- Include helpful headers.. require( "events" ); -- Include extension files.. require( "extensions/math" ); require( "extensions/string" ); require( "extensions/table" ); require( "extensions/timer" ); require( 'plugins' ); -- Include Final Fantasy Headers require( "ffxi/common" ); require( "ffxi/inventory" ); Recast = require( "ffxi/recast" ); VanaTime = require( "ffxi/vanatime" ); Weather = require( "ffxi/weather" ); ----------------------------------------------------------------------- -- DO NOT EDIT THE LINES ABOVE! ----------------------------------------------------------------------- ---------------------------------------------------------------------- -- func : onHandleCommand -- desc : Event callback for onHandleCommand event. ---------------------------------------------------------------------- function onHandleCommand( cmd, nType ) -- Parse the command into arguments.. local args = cmd:GetArgs(); if (cmd == "/dbox") then -- Create a new packet table dboxpacket = {} -- initialize the packet to 0 for i=1,32 do dboxpacket[i] = 0 end -- add some static bytes to the packet for j=5,13 do dboxpacket[j] = 0xFF end -- Set the packet action type to "Open Menu" dboxpacket[5] = 0x0E -- Send the packet out -- 32 is the size of the whole packet including the header -- 0x4D is the packet ID AddOutgoingPacket(dboxpacket, 0x4D, 32) return true; end if(cmd == "/sjob war") then --Job Sjob dboxpacket = {0x100, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00} AddOutgoingPacket(dboxpacket, 0x100, 8) return true; end if(cmd == "/sjob mnk") then dboxpacket = {0x100, 0x00, 0x05, 0xA7, 0x00, 0x02, 0x00, 0x00} AddOutgoingPacket(dboxpacket, 0x100, 8) return true; end if(cmd == "/sjob whm") then dboxpacket = {0x100, 0x00, 0x05, 0xA7, 0x00, 0x03, 0x00, 0x00} AddOutgoingPacket(dboxpacket, 0x100, 8) return true; end if(cmd == "/sjob sam") then dboxpacket = {0x100, 0x00, 0x05, 0xA7, 0x0C, 0x00, 0x00, 0x00} AddOutgoingPacket(dboxpacket, 0x100, 8) return true; end if(cmd == "/sjob nin") then dboxpacket = {0x100, 0x00, 0x05, 0xA7, 0x00, 0x0D, 0x00, 0x00} AddOutgoingPacket(dboxpacket, 0x100, 8) return true; end if(cmd == "/sjob dnc") then dboxpacket = {0x100, 0x00, 0x05, 0xA7, 0x00, 0x13, 0x00, 0x00} AddOutgoingPacket(dboxpacket, 0x100, 8) return true; end if(cmd == "/talk") then --mhuara mog dboxpacket = {0x1A, 0x08 ,0xEE,0x00, 0x7B, 0x90, 0x0F ,0x01 ,0x7B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,0x00 } AddOutgoingPacket(dboxpacket, 0x1A, 16) return true; end if(cmd == "/ro") then dboxpacket = {0x5E, 0x0C, 0x2A, 0x00, 0x7A, 0x33, 0x64, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} AddOutgoingPacket(dboxpacket, 0x5E, 24) return true; end if(cmd == "/tr") then dboxpacket = {0x5E, 0x0C, 0x2D, 0x00, 0x7A, 0x33, 0x64, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} AddOutgoingPacket(dboxpacket, 0x5E, 24) return true; end if(cmd == "/turtle") then dboxpacket = {0x5E, 0x0C, 0x2D, 0x00, 0x7A, 0x33, 0x35, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} AddOutgoingPacket(dboxpacket, 0x5E, 24) return true; end if(cmd == "/faf") then dboxpacket = {0x5E, 0x0C, 0x0D, 0x00, 0x7A, 0x34, 0x39, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} AddOutgoingPacket(dboxpacket, 0x5E, 24) return true; end if(cmd == "/beh") then dboxpacket = {0x5E, 0x0C, 0x0D, 0x00, 0x7A, 0x33, 0x69, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} AddOutgoingPacket(dboxpacket, 0x5E, 24) return true; end if(cmd == "/zi") then dboxpacket = {0x5E, 0x0C, 0x2A, 0x00, 0x7A, 0x33, 0x62, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} AddOutgoingPacket(dboxpacket, 0x5E, 24) return true; end if(cmd == "/mn") then dboxpacket = {0x5E, 0x0C, 0x2A, 0x00, 0x7A, 0x33, 0x63, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} AddOutgoingPacket(dboxpacket, 0x5E, 24) return true; end if ((args[1] == '/attack') or (args[1] == '/a')) then Target = AshitaCore:GetDataModule():GetTarget():GetTargetWindow(); AshitaCore:GetDataModule():SendCommand( string.format('/p z2z %d',Target.ID), CommandType.Typed ); return false; end -- Validate this is a LuaCast command.. if (args[1] ~= "/luacast") then return false; end -- Handle LuaCast wave command.. if (args[2] == 'wave') then AshitaCore:GetDataModule():SendCommand( '/wave', CommandType.Typed ); return true; end return false; end events.Add( "onHandleCommand", "luaCast_onHandleCommand", onHandleCommand ); ---------------------------------------------------------------------- -- func : onHandleNewChatLine -- desc : Event callback for onHandleNewChatLine event. ---------------------------------------------------------------------- function onHandleNewChatLine( nMode, text ) local args = text:GetArgs(); if (args[2] == 'z2z') then AshitaCore:GetDataModule():SendCommand( string.format('/target %d',args[3]), CommandType.Menu ); AshitaCore:GetDataModule():SendCommand( '/attack ', CommandType.Typed); return false; end if (args[3] == 'z2z') then AshitaCore:GetDataModule():SendCommand( string.format('/target %d',args[4]), CommandType.Menu ); AshitaCore:GetDataModule():SendCommand( '/attack ', CommandType.Typed); return false; end return false; end events.Add( "onHandleNewChatLine", "luaCast_onHandleNewChatLine", onHandleNewChatLine );