L2Tower Discord Let's keep the community alive with discord. Discussions about plugins and scripts L2Tower Discord

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to use the GetHtml.lua plugin
Author Message
lordemporium Offline
Expired VIP Member
**

Posts: 4
Joined: May 2015
Reputation: 0
Version: 1.4.2.142
Post: #1
how to use the GetHtml.lua plugin

im trying to automate the augment process on a server.

i want to record the html dialogs while talking to blacksmith and doing augment on a weapon.

I have scripts for automatic augmentation but i need to modify them for this specific server and I don't understand how to get the GetHtml.lua make me an html.txt with the recorded dialog.
01-13-2016 02:31 AM
Find all posts by this user Quote this message in a reply
TheQQmaster Offline
Trolling the Trolls
*****

Posts: 1,532
Joined: Jun 2012
Reputation: 642
Version: 1.4.2.133
Post: #2
RE: how to use the GetHtml.lua plugin

use plugin

    LUA Programming
--ShowToClient("html dialog",tostring(GetDialogHtml()));
 
HtmlStatus = false;
--------------------------------------------------------------------------------
function OnCreate()
	this:RegisterCommand("html", CommandChatType.CHAT_ALLY, CommandAccessLevel.ACCESS_ME);
end;
--------------------------------------------------------------------------------
function OnCommand_html(vCommandChatType, vNick, vCommandParam)
	if (HtmlStatus == false) then
		HtmlStatus = true;
		ShowToClient("Plugin","HTML saveed.");
	end;
end;
--------------------------------------------------------------------------------
function OnLTick1s()
	if(HtmlStatus)then
		local file = io.open(GetDir() .. "html.txt", "w");
		file:write(tostring(GetDialogHtml()).. "\n");
	--	file:write(tostring(HtmlDialog()).. "\n");
		file:close();
		HtmlStatus = false;
	end;
end;



open dialog what u want to get and type command /html

PUSH [Image: knUu53] IF HELPED
01-13-2016 07:28 AM
Visit this user's website Find all posts by this user Quote this message in a reply
 Reputed by : Fox(+2)
lordemporium Offline
Expired VIP Member
**

Posts: 4
Joined: May 2015
Reputation: 0
Version: 1.4.2.142
Post: #3
RE: how to use the GetHtml.lua plugin

Ok I managed to record the dialog and im facing a problem.

This is the dialog



<-- button value="Augment Item" action="bypass -h npc_268441043_Augment 1" width=125 height=21 back="L2UI_ch3.bigbutton2" fore="L2UI_ch3.bigbutton2">
<-- button value="Cancel Augment" action="bypass -h npc_268441043_Augment 2" width=125 height=21 back="L2UI_ch3.bigbutton2" fore="L2UI_ch3.bigbutton2">



When I run the following:

Talk()
ClickAndWait("npc_268441189_Chat 21", "Augmentation")
ClickAndWait("npc_268441189_Augment 2", "Cancel Augment")
Sleep (1000)
GetAugmentManager():setItemId(weaponId)
GetAugmentManager():AugmentCancel()
ShowToClient("AUGMENT", "Going out of cancel function")


The Augment Manager comes up and shows me the 2 buttons but doesnt proceed. If i click the Cancel Augment button then it moves on the setItemId and AugmentCancel correctly and goes out of function. So 1 problem is it doesnt proceed if I dont click myself the button.

2nd problem, after that the Client system window keeps repeating me messages like "Please enter weapon to be cancelled" something like that. Is as if the function keeps sending the command AugmentCancel to server. But i dont have it in loop.
(This post was last modified: 01-13-2016 16:03 PM by lordemporium.)
01-13-2016 15:53 PM
Find all posts by this user Quote this message in a reply
TheQQmaster Offline
Trolling the Trolls
*****

Posts: 1,532
Joined: Jun 2012
Reputation: 642
Version: 1.4.2.133
Post: #4
RE: how to use the GetHtml.lua plugin

what server , chronicle, in some servers there custom npc with dynamic button

@pvpsuite plugin adopted for other pivate i used


Code:
function Initialize()
    customSkillIDs1 = {}; -- AUGMENT IDS OF CUSTOM SKILL 1 SEPERATED WITH COMMA (EXAMPLE: customSkillIDs1 = {000,111,222};)
    customSkillIDs2 = {}; -- AUGMENT IDS OF CUSTOM SKILL 2 SEPERATED WITH COMMA (EXAMPLE: customSkillIDs2 = {000,111,222};)
    npcName = "Jynx Manager";
    CheckSoundDC = GetDir() .. "\\temp\\data\\dc.wav";
    AugButton = "0";
    Gemstone_Count = 0;
    Gemstone_Id = 0;
    Lifestone_Id = 0;
    Weapon_Id = 0;
    Augments = {false,false,false,false,false,false,false,false,false,false,false,false,false,f​alse,false,false,false,false,false,false,false,false,false,false,false};
    augmentIDs1 = {14683,14861,15039,15217,15395,15573,15751,15929,16107,16285};
    augmentIDs2 = {14609,14787,14965,15143,15321,15499,15677,15855,16033,16211};
    augmentIDs3 = {14731,14732,14909,14910,15087,15088,15265,15443,15621,15799,15977,16155,16333};​
    augmentIDs4 = {14685,14686,14687,14688,14863,14864,14865,14866,15041,15042,15043,15044,15221,1​5399,15577,15755,15933,16111,16289};
    augmentIDs5 = {14681,14859,15037,15215,15393,15571,15749,15927,16105,16283};
    augmentIDs6 = {14604,14782,14960,15138,15316,15494,15672,15850,16028,16206};
    augmentIDs7 = {14682,14860,15038,15216,15394,15572,15750,15928,16106,16284};
    augmentIDs8 = {14606,14784,14962,15140,15318,15496,15674,15852,16030,16208};
    augmentIDs9 = {15266,15444,15622,15800,15978,16156,16334};
    augmentIDs10 = {15222,15400,15578,15756,15934,16112,16290};
    augmentIDs11 = {14733,14911,15089,15267,15445,15623,15801,15979,16157,16335};
    augmentIDs12 = {14588,14766,14944,15122,15300,15478,15656,15834,16012,16190};
    augmentIDs13 = {14734,14912,15090,15268,15446,15624,15802,15980,16158,16336};
    augmentIDs14 = {14692,14693,14695,14696,14870,15048,15226,15404,15582,15760,15938,16116,16294};​
    augmentIDs15 = {14593,14771,14949,15127,15305,15483,15661,15839,16017,16195};
    augmentIDs16 = {14691,14869,15047,15225,15403,15581,15759,15937,16115,16293};
    augmentIDs17 = {15219,15397,15575,15753,15931,16109,16287,15233,15411,15589,15767,15945,16123,1​6301,15229,15407,15585,15763,15941,16119,16297};
    augmentIDs18 = {16341,16345,16349,16353,16357,16361,16365,16369,16373,16377};
    augmentIDs19 = {14679,14857,15035,15213,15391,15569,15747,15925,16103,1628};
    augmentIDs20 = {14594,14772,14950,15128,15306,15484,15662,15840,16018,16196};
    augmentIDs21 = {14729,14730,14907,14908,15085,15086,15264,15442,15620,15798,15976,16154,16332};​
    augmentIDs22 = {14579,14757,14935,15113,15291,15469,15647,15825,16003,16181};
    augmentIDs = {};
    threadStarted = false;
end;
function OnCreate()
    Initialize();
    this:RegisterCommand("augment", CommandChatType.CHAT_CMD2, CommandAccessLevel.ACCESS_ME);
    this:RegisterCommand("setaugb", CommandChatType.CHAT_CMD2, CommandAccessLevel.ACCESS_ME);
end;
function OnCommand_setaugb(vCommandChatType, vNick, vCommandParam)
    if (vCommandParam:GetCount() == 1) then
        AugButton = tostring(vCommandParam:GetParam(0):GetStr(true));
        ShowToClient("iAugment","Button ID set to "..AugButton);
    end;
end;
function OnCommand_augment(vCommandChatType, vNick, vCommandParam)
    if (vCommandParam:GetCount() == 0) then
        if (threadStarted) then
            threadStarted = false;
            ShowToClient("iAugment","Stopped by user!");
            AugmentDialog();
        else
            AugmentDialog();
        end;
    elseif (vCommandParam:GetCount() == 1) then
            if (vCommandParam:GetParam(0):GetStr(true) == "Augment") then
                if (threadStarted == false) then
                    threadStarted = true;
                    this:StartThread("doChecks");
                end;
            else
                DoAction(vCommandParam:GetParam(0):GetStr(true));
            end;
    elseif (vCommandParam:GetCount() == 2) then
            if (vCommandParam:GetParam(0):GetStr(true) == "SetWeap") then
                Weapon_Id = tonumber(vCommandParam:GetParam(1):GetStr(true));
                AugmentDialog();
            elseif (vCommandParam:GetParam(0):GetStr(true) == "SetLS") then
                    Lifestone_Id = tonumber(vCommandParam:GetParam(1):GetStr(true));
                    AugmentDialog();
            elseif (vCommandParam:GetParam(0):GetStr(true) == "SetGem") then
                    Gemstone_Id = tonumber(vCommandParam:GetParam(1):GetStr(true));
                    AugmentDialog();
            elseif (vCommandParam:GetParam(0):GetStr(true) == "SetAug") then
                    if (vCommandParam:GetParam(1):GetStr(true) == "PvPPAtkP") then
                        Switch(1);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "PvPPAtkA") then
                            Switch(2);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "FocusP") then
                            Switch(3);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "FocusA") then
                            Switch(4);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "MightP") then
                            Switch(5);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "MightA") then
                            Switch(6);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "ShieldP") then
                            Switch(7);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "ShieldA") then
                            Switch(8);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "ReflectP") then
                            Switch(9);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "ReflectA") then
                            Switch(10);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "GuidanceP") then
                            Switch(11);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "GuidanceA") then
                            Switch(12);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "WildMagicP") then
                            Switch(13);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "WildMagicA") then
                            Switch(14);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "Heal") then
                            Switch(15);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "Barrier") then
                            Switch(16);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "Refresh") then
                            Switch(17);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "STR") then
                            Switch(18);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "EmpowerP") then
                            Switch(19);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "EmpowerA") then
                            Switch(20);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "EvasionP") then
                            Switch(21);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "EvasionA") then
                            Switch(22);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "Custom1") then
                            Switch(23);
                    elseif (vCommandParam:GetParam(1):GetStr(true) == "Custom2") then
                            Switch(24);
                    end;
                    DoDialog("Set Augments");
            end;
    end;
end;
doChecks = coroutine.wrap( function()
    repeat
        joinAugments();
        repeat
            Weapon = GetInventory():FindByDisplayId(Weapon_Id);
            Lifestone = GetInventory():FindByDisplayId(Lifestone_Id);
            Gemstone = GetInventory():FindByDisplayId(Gemstone_Id);
            if (augmentIDs[1] == nil) then
                ShowToClient("iAugment","You didn't selected any augments!");
                threadStarted = false;
                AugmentDialog();
                break;
            elseif (Weapon_Id == 0) then
                    ShowToClient("iAugment","You didn't selected weapon!");
                    threadStarted = false;
                    AugmentDialog();
                    break;
            elseif (Lifestone_Id == 0) then
                    ShowToClient("iAugment","You didn't selected lifestone!");
                    threadStarted = false;
                    AugmentDialog();
                    break;
            elseif (Gemstone_Id == 0) then
                    ShowToClient("iAugment","You didn't selected gemstone!");
                    threadStarted = false;
                    AugmentDialog();
                    break;
            elseif (Gemstone_Count == 0) then
                    ShowToClient("iAugment","You didn't selected gemstone count!");
                    threadStarted = false;
                    AugmentDialog();
                    break;
            elseif (Weapon == nil) then
                    ShowToClient("iAugment","Couldn't retrieve weapon data!");
                    threadStarted = false;
                    AugmentDialog();
                    break;
            elseif (Lifestone == nil) then
                    ShowToClient("iAugment","Out of lifestones!");
                    threadStarted = false;
                    AugmentDialog();
                    break;
            elseif (Gemstone == nil) then
                    ShowToClient("iAugment","Out of gemstones!");
                    threadStarted = false;
                    AugmentDialog();
                    break;
            elseif (Gemstone.ItemNum < Gemstone_Count) then
                    ShowToClient("iAugment","Gemstones not enough!");
                    threadStarted = false;
                    AugmentDialog();
                    break;
            else
                Command("/target "..npcName);
                Sleep(500);
                if (GetTarget() == nil) then
                    ShowToClient("iAugment","Go near "..npcName.."!");
                    threadStarted = false;
                    AugmentDialog();
                    break;
                elseif (GetTarget():GetName() ~= npcName) then
                        ShowToClient("iAugment","Target "..npcName.."!");
                        threadStarted = false;
                        AugmentDialog();
                        break;
                else
                    Talk();
                    if ((AugButton == nil) or (AugButton == "0")) then
                        local h = HtmlDialog();
                        for link in h.links do
                            if (string.find(link.link,"npc_%d+") ~= nil) then
                                local button = string.match(link.link,"_%d+_");
                                button = string.gsub(button,"_","");
                                AugButton = button;
                                break;
                            end;
                        end;
                        if ((AugButton == nil) or (AugButton == "0")) then
                            ShowToClient("iAugment","Couldn't retrieve button ID!");
                            AugButton = "0";
                            threadStarted = false;
                            AugmentDialog();
                            break;
                        end;
                    end;
                    if (threadStarted == false) then
                        break;
                    end;
                    SetDefaultTimeout(2500);
                    if (Weapon.RefineryOp2 == 0) then
                        GetAugmentManager():setItemId(Weapon.objectId);
                        GetAugmentManager():setLifeStoneId(Lifestone.objectId);
                        GetAugmentManager():setGemstoneId(Gemstone.objectId, Gemstone_Count);
                        GetAugmentManager():Augment();
                        Talk();
                        Click("npc_"..AugButton.."_Chat 1", "Augment Manager");
                        Sleep(500);
                        Click("npc_"..AugButton.."_Augment 1", "Add Augment");
                        sleepCount = 0;
                        while (GetAugmentManager():getAugmentResult() == Augment.AUGMENT_PENDING) do
                            if (threadStarted == false) then
                                break;
                            end;
                            sleepCount = sleepCount + 1;
                            Sleep(200);
                            if (sleepCount == 20) then
                                Talk();
                                Click("npc_"..AugButton.."_Chat 1", "Augment Manager");
                                Sleep(500);
                                Click("npc_"..AugButton.."_Augment 1", "Add Augment");
                                sleepCount = 0;
                            end;
                        end;
                        if (GetAugmentManager():getAugmentResult() == Augment.AUGMENT_FINISHED) then    
                            Sleep(100);
                            Weapon = GetInventory():FindByDisplayId(Weapon_Id);
                        end;
                        if (SearchArray(Weapon.RefineryOp2,augmentIDs)) then
                            ShowToClient("iAugment", "You have achieved desired augment! ID: " .. Weapon.RefineryOp2);
                            PlaySound(CheckSoundDC);

                            break;
                        end;
                    else
                        if (SearchArray(Weapon.RefineryOp2,augmentIDs)) then
                            ShowToClient("iAugment", "You have achieved desired augment! ID: " .. Weapon.RefineryOp2);
                            PlaySound(CheckSoundDC);
                            break;
                        else
                            GetAugmentManager():setItemId(Weapon.objectId);
                            GetAugmentManager():AugmentCancel();
                            Sleep(500);
                            Talk();
                            Click("npc_"..AugButton.."_Chat 1", "Augment Manager");
                            Sleep(500);
                            Click("npc_"..AugButton.."_Augment 2", "Remove Augment");
                            sleepCount = 0;
                            while (GetAugmentManager():getAugmentCancelResult() == Augment.AUGMENT_CANCEL_PENDING) do
                                if (threadStarted == false) then
                                    break;
                                end;
                                sleepCount = sleepCount + 1;
                                Sleep(200);
                                if (sleepCount == 20) then
                                    Talk();
                                    Click("npc_"..AugButton.."_Chat 1", "Augment Manager");
                                    Sleep(500);
                                    Click("npc_"..AugButton.."_Augment 2", "Remove Augment");
                                    sleepCount = 0;
                                end;
                            end
                            if (GetAugmentManager():getAugmentCancelResult() == Augment.AUGMENT_FINISHED) then    
                                Sleep(100);
                            end;
                            Weapon = GetInventory():FindByDisplayId(Weapon_Id);
                        end;
                    end;
                    SetDefaultTimeout(60000);
                end;
            end;
        until (threadStarted == false);
        threadStarted = false;
        coroutine.yield();
    until false;
end);
function DoAction(action)
    if (action == "Set Weapon") then
        DoDialog(action);
    elseif (action == "Set Lifestone") then
            DoDialog(action);
    elseif (action == "Set Gemstone") then
            DoDialog(action);
    elseif (action == "Set Augments") then
            DoDialog(action);
    else
        Gemstone_Count = tonumber(action);
        AugmentDialog();
    end;
end;
function DoDialog(action)
    local html = THtmlGenerator("iAugment");
    html:AddHtml('
');
    local invList = GetInventory();
    if (action == "Set Weapon") then
        for item in invList.list do
            if (item.ItemType == 0) then
                html:AddHtml('
');
                html:AddHtml('');
                html:AddHtml("");
                html:AddHtml('
');
                html:AddButton(THtmlAction("/augment"):AddParam("SetWeap"):AddParam(item.displayId),THtmlButtonStyle.BUTTON_ACTION, item.Name,false,"","",210,25);
                html:AddHtml('
');
            end;
        end;
    elseif (action == "Set Lifestone") then
            for item in invList.list do
                if ((string.find(item.Name,"Life") ~= nil) or (string.find(item.Name,"life") ~= nil)) then
                    html:AddHtml('
');
                    html:AddHtml('');
                    html:AddHtml("");
                    html:AddHtml('
');
                    html:AddButton(THtmlAction("/augment"):AddParam("SetLS"):AddParam(item.displayId),THtmlButtonStyle.BUTTON_ACTION, item.Name,false,"","",210,25);
                    html:AddHtml('
');
                end;
            end;
    elseif (action == "Set Gemstone") then
            for item in invList.list do
                if ((string.find(item.Name,"Gem") ~= nil) or (string.find(item.Name,"gem") ~= nil)) then
                    html:AddHtml('
');
                    html:AddHtml('');
                    html:AddHtml("");
                    html:AddHtml('
');
                    html:AddButton(THtmlAction("/augment"):AddParam("SetGem"):AddParam(item.displayId),THtmlButtonStyle.BUTTON_ACTION, item.Name,false,"","",210,25);
                    html:AddHtml('
');
                end;
            end;
    elseif (action == "Set Augments") then
            html:AddHtml('
');
            html:AddHtml('');
            html:AddHtml('
');
            local Condition = false;
            if (Augments[1]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("PvPPAtkP"),THtmlButtonStyle.BUTTON_EXTRA, "PvP P.Atk(P)",Condition,"","",90,25);
            html:AddHtml('
');
            Condition = false;
            if (Augments[2]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("PvPPAtkA"),THtmlButtonStyle.BUTTON_EXTRA, "PvP P.Atk(A)",Condition,"","",90,25);
            html:AddHtml('
');
            html:AddHtml('
');
            html:AddHtml('');
            html:AddHtml('
');
            Condition = false;
            if (Augments[3]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("FocusP"),THtmlButtonStyle.BUTTON_EXTRA, "Focus(P)",Condition,"","",90,25);
            html:AddHtml('
');
            Condition = false;
            if (Augments[4]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("FocusA"),THtmlButtonStyle.BUTTON_EXTRA, "Focus(A)",Condition,"","",90,25);
            html:AddHtml('
');
            html:AddHtml('
');
            html:AddHtml('');
            html:AddHtml('
');
            Condition = false;
            if (Augments[5]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("MightP"),THtmlButtonStyle.BUTTON_EXTRA, "Might(P)",Condition,"","",90,25);
            html:AddHtml('
');
            Condition = false;
            if (Augments[6]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("MightA"),THtmlButtonStyle.BUTTON_EXTRA, "Might(A)",Condition,"","",90,25);
            html:AddHtml('
');
            html:AddHtml('
');
            html:AddHtml('');
            html:AddHtml('
');
            Condition = false;
            if (Augments[7]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("ShieldP"),THtmlButtonStyle.BUTTON_EXTRA, "Shield(P)",Condition,"","",90,25);
            html:AddHtml('
');
            Condition = false;
            if (Augments[8]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("ShieldA"),THtmlButtonStyle.BUTTON_EXTRA, "Shield(A)",Condition,"","",90,25);
            html:AddHtml('
');
            html:AddHtml('
');
            html:AddHtml('');
            html:AddHtml('
');
            Condition = false;
            if (Augments[9]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("ReflectP"),THtmlButtonStyle.BUTTON_EXTRA, "Reflect(P)",Condition,"","",90,25);
            html:AddHtml('
');
            Condition = false;
            if (Augments[10]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("ReflectA"),THtmlButtonStyle.BUTTON_EXTRA, "Reflect(A)",Condition,"","",90,25);
            html:AddHtml('
');
            html:AddHtml('
');
            html:AddHtml('');
            html:AddHtml('
');
            Condition = false;
            if (Augments[21]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("EvasionP"),THtmlButtonStyle.BUTTON_EXTRA, "Evasion(P)",Condition,"","",90,25);
            html:AddHtml('
');
            Condition = false;
            if (Augments[22]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("EvasionA"),THtmlButtonStyle.BUTTON_EXTRA, "Evasion(A)",Condition,"","",90,25);
            html:AddHtml('
');
            html:AddHtml('
');
            html:AddHtml('');
            html:AddHtml('
');
            Condition = false;
            if (Augments[11]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("GuidanceP"),THtmlButtonStyle.BUTTON_EXTRA, "Guidance(P)",Condition,"","",90,25);
            html:AddHtml('
');
            Condition = false;
            if (Augments[12]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("GuidanceA"),THtmlButtonStyle.BUTTON_EXTRA, "Guidance(A)",Condition,"","",90,25);
            html:AddHtml('
');
            html:AddHtml('
');
            html:AddHtml('');
            html:AddHtml('
');
            Condition = false;
            if (Augments[19]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("EmpowerP"),THtmlButtonStyle.BUTTON_EXTRA, "Empower(P)",Condition,"","",90,25);
            html:AddHtml('
');
            Condition = false;
            if (Augments[20]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("EmpowerA"),THtmlButtonStyle.BUTTON_EXTRA, "Empower(A)",Condition,"","",90,25);
            html:AddHtml('
');
            html:AddHtml('
');
            html:AddHtml('');
            html:AddHtml('
');
            Condition = false;
            if (Augments[13]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("WildMagicP"),THtmlButtonStyle.BUTTON_EXTRA, "Wild Magic(P)",Condition,"","",90,25);
            html:AddHtml('
');
            Condition = false;
            if (Augments[14]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("WildMagicA"),THtmlButtonStyle.BUTTON_EXTRA, "Wild Magic(A)",Condition,"","",90,25);
            html:AddHtml('
');
            html:AddHtml('
');
            html:AddHtml('');
            html:AddHtml('
');
            Condition = false;
            if (Augments[15]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("Heal"),THtmlButtonStyle.BUTTON_EXTRA, "Heal(A)",Condition,"","",90,25);
            html:AddHtml('
');
            Condition = false;
            if (Augments[16]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("Barrier"),THtmlButtonStyle.BUTTON_EXTRA, "Barrier(A)",Condition,"","",90,25);
            html:AddHtml('
');
            html:AddHtml('
');
            html:AddHtml('');
            html:AddHtml('
');
            Condition = false;
            if (Augments[17]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("Refresh"),THtmlButtonStyle.BUTTON_EXTRA, "Refresh(A)",Condition,"","",90,25);
            html:AddHtml('
');
            Condition = false;
            if (Augments[18]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("STR"),THtmlButtonStyle.BUTTON_EXTRA, "STR+1(P)",Condition,"","",90,25);
            html:AddHtml('
');
            html:AddHtml('
');
            html:AddHtml('');
            html:AddHtml('
');
            Condition = false;
            if (Augments[23]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("Custom1"),THtmlButtonStyle.BUTTON_EXTRA, "Custom(1)",Condition,"","",90,25);
            html:AddHtml('
');
            Condition = false;
            if (Augments[24]) then
                Condition = true;
            end;
            html:AddButton(THtmlAction("/augment"):AddParam("SetAug"):AddParam("Custom2"),THtmlButtonStyle.BUTTON_EXTRA, "Custom(2)",Condition,"","",90,25);
            html:AddHtml('
');
            html:AddHtml('
');
    end;
    html:AddHtml('
');
    html:AddButton(THtmlAction("/augment"),THtmlButtonStyle.BUTTON_ACTION, "Go Back",false,"","",90,25);
    html:AddHtml('
');
    HtmlBuild = html:GetString();    
    ShowHtmlStatus = true;
end;
function AugmentDialog()
    local html = THtmlGenerator("iAugment - L2Dodge");
    html:AddHtml('
');
    html:AddHtml("");
    html:AddHtml('');
    html:AddHtml('');
    html:AddHtml('');
    html:AddHtml('');
    html:AddHtml("
Weapon ID'..Weapon_Id..'
Lifestone ID'..Lifestone_Id..'
Gemstone ID'..Gemstone_Id..'
Gemstone Count'..Gemstone_Count..'

");
    html:AddHtml("");
    html:AddHtml('');
    html:AddHtml("
');
    html:AddButton(THtmlAction("/augment"):AddParam("Set Weapon"),THtmlButtonStyle.BUTTON_ACTION, "Set Weapon",false,"","",120,25);
    html:AddHtml('
');
    html:AddButton(THtmlAction("/augment"):AddParam("Set Lifestone"),THtmlButtonStyle.BUTTON_ACTION, "Set Lifestone",false,"","",120,25);
    html:AddHtml('
");
    html:AddButton(THtmlAction("/augment"):AddParam("Set Gemstone"),THtmlButtonStyle.BUTTON_ACTION, "Set Gemstone",false,"","",120,25);
    html:AddHtml("");
    html:AddHtml('');
    html:AddHtml("
Gemstone Count:');
    html:AddEdit("count",true,80,15);
    html:AddHtml('
');
    html:AddButton(THtmlAction("/augment"):AddParam("$count",true),THtmlButtonStyle.BUTTON_ACTION, "Set",false,"","",40,25);
    html:AddHtml('


");
    html:AddButton(THtmlAction("/augment"):AddParam("Set Augments"),THtmlButtonStyle.BUTTON_ACTION, "Set Augments",false,"","",120,25);
    html:AddHtml("
");
    html:AddButton(THtmlAction("/augment"):AddParam("Augment"),THtmlButtonStyle.BUTTON_ACTION, "Augment!",false,"","",120,25);
    html:AddHtml('
');
    HtmlBuild = html:GetString();    
    ShowHtmlStatus = true;
end;
function OnLTick500ms()
    if (ShowHtmlStatus) then
        ShowHtmlStatus = false;
        ShowHtml(HtmlBuild);
    end;
end;
function Switch(num)
    if (Augments[num]) then
        Augments[num] = false;
    else
        Augments[num] = true;
    end;
end;
function getAugmentIDs(num)
    if (num == 1) then
        return augmentIDs1;
    elseif (num == 2) then
            return augmentIDs2;
    elseif (num == 3) then
            return augmentIDs3;
    elseif (num == 4) then
            return augmentIDs4;
    elseif (num == 5) then
            return augmentIDs5;
    elseif (num == 6) then
            return augmentIDs6;
    elseif (num == 7) then
            return augmentIDs7;
    elseif (num == 8) then
            return augmentIDs8;
    elseif (num == 9) then
            return augmentIDs9;
    elseif (num == 10) then
            return augmentIDs10;
    elseif (num == 11) then
            return augmentIDs11;
    elseif (num == 12) then
            return augmentIDs12;
    elseif (num == 13) then
            return augmentIDs13;
    elseif (num == 14) then
            return augmentIDs14;
    elseif (num == 15) then
            return augmentIDs15;
    elseif (num == 16) then
            return augmentIDs16;
    elseif (num == 17) then
            return augmentIDs17;
    elseif (num == 18) then
            return augmentIDs18;
    elseif (num == 19) then
            return augmentIDs19;
    elseif (num == 20) then
            return augmentIDs20;
    elseif (num == 21) then
            return augmentIDs21;
    elseif (num == 22) then
            return augmentIDs22;
    elseif (num == 23) then
            return customSkillIDs1;
    elseif (num == 24) then
            return customSkillIDs2;
    else
        return -1;
    end;
end;
function join_tables(t1, t2)
    for k,v in ipairs(t2) do
        table.insert(t1, v);
    end;
    return t1;
end;
function SearchArray(check,array)
    for x,a in pairs(array) do
        if (check == a) then
            return true;
        end;
    end;
end;
function joinAugments()
    augmentIDs = {};
    for x,a in pairs(Augments) do
        if (Augments[x]) then
            join_tables(augmentIDs,getAugmentIDs(x));
        end;
    end;
end;

Quote:npc_
search in plugin and edit after variable ur, should work, ah and rename npc name

PUSH [Image: knUu53] IF HELPED
(This post was last modified: 01-13-2016 16:04 PM by TheQQmaster.)
01-13-2016 16:00 PM
Visit this user's website Find all posts by this user Quote this message in a reply
lordemporium Offline
Expired VIP Member
**

Posts: 4
Joined: May 2015
Reputation: 0
Version: 1.4.2.142
Post: #5
RE: how to use the GetHtml.lua plugin

Is interlude server, l2reload.net

I have looked to the script and it does many things i dont want. So i got my script working now. But i want to be able to execute it from my shortcut bar. so i thought to make it plugin and name it "deletespitter" so i can make a macro //deletespitter and execute it from my bar. but it doesnt work my plugin or l2tower doesnt ready it?

this is my whole file

Code:
local weaponName = "Antharas spitter"
local lifestoneName = "Top-Grade Life Stone: level 76 "
local gemstoneName = "Gemstone C "
local gemstone_count = 25
local npcName = "Pushkin"

function OnCreate()
    this:RegisterCommand("deletespitter", CommandChatType.CHAT_ALLY, CommandAccessLevel.ACCESS_ME);
end;

function OnCommand_deletespitter(vCommandChatType, vNick, vCommandParam)
ShowToClient("Plugin","Cancelling Augment on " .. weaponName);
end;

function getItemByName(name)
    invList = GetInventory()
    for item in invList.list do
if item.Name == name then
-- ShowToClient("ITEM", item.Name .. " (ID: " .. item.displayId .. ")");
return item
else
-- ShowToClient("ITEM", item.Name .. " (ID: " .. item.displayId .. ")");
end
    end
end;

-- ShowToClient("AUGMENT", "Go near npc named Server before you run this script")
function OnLTick1s()
    weapon = getItemByName(weaponName)
    if ( weapon == nil ) then
ShowToClient("AUGMENT", "Could not find weapon " .. weaponName)
    else
weaponId = weapon.objectId
--    ShowToClient("AUGMENT", "Weapon: " .. weaponName .. " (ID: " .. weaponId .. " (Refinery: " .. weapon.RefineryOp2 .. ")")

if ( weapon.RefineryOp2 > 0 and weaponId > 0) then

target = GetTarget()
if ( target ~= nil and target:GetName() == npcName ) then
Talk()
Sleep(2000)
Click("bypass -h npc_268441189_Augment 2", "Cancel Augment");
GetAugmentManager():setItemId(weaponId);
GetAugmentManager():AugmentCancel();
end
else
ShowToClient("AUGMENT", "Weapon: " .. weaponName .. " (ID: " .. weaponId .. ")")
end
    end
end

before i had it as script and was working (without the OnLTick1s function )

I edited the OnCommand_deletespitter and now the //deletespitter exists and works. but it doesnt do anything. how can i run then my OnLTick1s function?

I have updated my plugin. but it doesnt start. I followed the tutorial of this forum How to copy a script/plugin correctly but nothing. any ideas anyone?

Code:
deletespitterOn = false;

local weaponName = "Antharas spitter"
local lifestoneName = "Top-Grade Life Stone: level 76 "
local gemstoneName = "Gemstone C "
local gemstone_count = 25
local npcName = "Pushkin"


function OnCreate()
    this:RegisterCommand("deletespitter", CommandChatType.CHAT_ALLY, CommandAccessLevel.ACCESS_ME);
end;

function getItemByName(name)
    invList = GetInventory()
    for item in invList.list do
        if item.Name == name then
--            ShowToClient("ITEM", item.Name .. " (ID: " .. item.displayId .. ")");
            return item
        else
--            ShowToClient("ITEM", item.Name .. " (ID: " .. item.displayId .. ")");
        end
    end
end;

function OnCommand_deletespitter(vCommandChatType, vNick, vCommandParam)
    deletespitterOn = true;
end;


function OnLTick1s()

    if (deletespitterOn) then
        ShowToClient("Plugin","Cancelling Augment on " .. weaponName);
            weapon = getItemByName(weaponName)
        if ( weapon == nil ) then
            ShowToClient("AUGMENT", "Could not find weapon " .. weaponName)
        else
            weaponId = weapon.objectId
--    ShowToClient("AUGMENT", "Weapon: " .. weaponName .. " (ID: " .. weaponId .. " (Refinery: " .. weapon.RefineryOp2 .. ")")

            if ( weapon.RefineryOp2 > 0 and weaponId > 0) then
    
                target = GetTarget()
                if ( target ~= nil and target:GetName() == npcName ) then
                    Talk()
                    Sleep(2000)
                    Click("bypass -h npc_268441189_Augment 2", "Cancel Augment");
                    GetAugmentManager():setItemId(weaponId);
                    GetAugmentManager():AugmentCancel();
                end
            else
                ShowToClient("AUGMENT", "Weapon: " .. weaponName .. " (ID: " .. weaponId .. ")")
            end
        end
        deletespitterOn = false;
    end
end;
(This post was last modified: 01-13-2016 18:49 PM by lordemporium.)
01-13-2016 16:04 PM
Find all posts by this user Quote this message in a reply
TheQQmaster Offline
Trolling the Trolls
*****

Posts: 1,532
Joined: Jun 2012
Reputation: 642
Version: 1.4.2.133
Post: #6
RE: how to use the GetHtml.lua plugin

if u edit code, save and refresh it on tower gui each time u change code

idk how work on interlude - btw interlude on private i think nah, on h5 worked till catch ls, or ends mat to aug

weaponId = weapon.objectId

this part probably

    LUA Programming
function GetItemAmountByName(name) -- getting id of item
local invList = GetInventory();
	for item in invList.list do
 if (item.Name == name) then
 return item.displayId;-- item id
 end;
	end;
 
return 0;
end;


then just defin wep id with fuction

PUSH [Image: knUu53] IF HELPED
(This post was last modified: 01-14-2016 00:50 AM by TheQQmaster.)
01-13-2016 23:19 PM
Visit this user's website Find all posts by this user Quote this message in a reply
lordemporium Offline
Expired VIP Member
**

Posts: 4
Joined: May 2015
Reputation: 0
Version: 1.4.2.142
Post: #7
RE: how to use the GetHtml.lua plugin

I have managed to get pvpsuite.lua working as well my own specific script on the interlude server i am playing.

I have one problem althought with both.

Augmentation hangs on gemstones and waits for me to drag and drop the 25 Gemstone C.

this happens in pvpsuite.lua too. I also noticed that in order for both scripts to work ihave to make manually one time the augmenting process, then the scripts works good.

I tried to use the Sleep(100); Sleep(750); before the

GetAugmentManager():setGemstoneId

But no luck. the game still waits me to manually drag the Gemstones.

Could that be a problem of the function setGemstoneId for interlude server?

Is there different method than setGemstoneId to enter the gemstones?
01-16-2016 15:37 PM
Find all posts by this user Quote this message in a reply
PvPSuite Offline
Manners Maketh Man
*****

Posts: 277
Joined: Feb 2013
Reputation: 277
Version: 1.4.2.133
Post: #8
RE: how to use the GetHtml.lua plugin

Interlude is bugged with auto placing gemstones through tower since long time ago.
01-18-2016 16:42 PM
Find all posts by this user Quote this message in a reply
 Reputed by : Fox(+2) , TheQQmaster(+2)
Vinter Offline
Expired VIP Member
**

Posts: 299
Joined: Sep 2013
Reputation: 109
Version: 1.4.1.128
Post: #9
RE: how to use the GetHtml.lua plugin

Actually I believe it can be done if you build the packet yourself, since it's probabbly L2Tower's fault, not the packet.

I know it's kind of a late response and most people don't have the knowledge to do it, but if you do, that's the way to do it.
(This post was last modified: 02-09-2016 15:19 PM by Vinter.)
02-09-2016 15:18 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Plugin crash l2 laydown 2 2,669 09-30-2014 04:22 AM
Last Post: benbt91
Information [TUTORIAL] How To Copy a Script/Plugin Correctly Mobius 3 6,682 01-15-2013 01:55 AM
Last Post: TheBl4ckPhoenix



User(s) browsing this thread: 1 Guest(s)