This time I have a problem with creating a new L2Makra, L2ShortCut and sending to the client.
Code: Select all
...L2MacroCmd[] commands = new L2MacroCmd[0];commands[0] = new L2MacroCmd(0, 3, 0, 0, ".helper;"); L2Macro mc = new L2Macro(1000, 3, "Helper", "", "", commands);this.activeChar.getMacros().registerMacro(mc);L2ShortCut sc = new L2ShortCut(0, 3, 4, 1000, 0, 0);new ShortCuts(this.activeChar).registerShortCut(sc); this.activeChar.getMacros().sendUpdate();this.activeChar.sendPacket(new ShortCutInit(this.activeChar));...
Macro or ShortCut are not created.
I do not know what I call key.
If insert in DB
Code: Select all
...PreparedStatement statement = con.prepareStatement("INSERT INTO character_macroses (charId,id,icon,name,descr,acronym,commands) values(?,?,?,?,?,?,?)");statement.setInt(1, this.activeChar.getObjectId());statement.setInt(2, 1000);statement.setInt(3, 3);statement.setString(4, "Helper");statement.setString(5, "");statement.setString(6, "");statement.setString(7, "3,0,0,.helper;");statement.execute(); statement = con.prepareStatement("INSERT INTO character_shortcuts (charId,slot,page,type,shortcut_id,level,class_index) values(?,?,?,?,?,?,?)");statement.setInt(1, this.activeChar.getObjectId());statement.setInt(2, 0);statement.setInt(3, 3);statement.setInt(4, 4);statement.setInt(5, 1000);statement.setString(6, "0");statement.setInt(7, 0);statement.execute();...this.activeChar.getMacros().restore();this.activeChar.getMacros().sendUpdate();new ShortCuts(this.activeChar).restore();this.activeChar.sendPacket(new ShortCutInit(this.activeChar));...
On the Client updates the Macro but not ShortCut
Please help me to create a Macro ShortCut without insert into DB and how to update the packet sent to the client, it ShortCut.