--############################################################################-- --[[ CE Plugin Collector (Menu Builder) V1 This plugin; (CEF) Created for CE by @AylinCE. It is free to edit and use. Facebook contact: https://www.facebook.com/groups/1643020085997642 or https://www.facebook.com/groups/KINGS.OF.THE.CE.TRAINERS/ ]] --############################################################################-- function Add_Plugin_Org() if MyPlug1 then MyPlug1.Destroy() MyPlug1=nil end MyPlug1=createForm() MyPlug1.height=400 MyPlug1.width=830 --MyPlug1.left=385 MyPlug1.top=171 MyPlug1.PopupMode=0 MyPlug1.caption="CE Plugin Collector (Menu Builder) V1" MyPlug1.Position="poDesktopCenter" MyPlug1.BorderStyle="bsNone" MyPlug1.ShowInTaskBar="stAlways" MyPlug1.setLayeredAttributes(0x000100, 250, LWA_COLORKEY | LWA_ALPHA ) MyPlug1.Color=0x000100 MyPlug1.FontStyle=fsBold ------------------------- local CE_Plg1 = {} ----------------------- CE_Plg1.MPnl1 -----  CE_Plg1.MPnl1=createPanel(MyPlug1) --CE_Plg1.MPnl1.AutoSize=false CE_Plg1.MPnl1.height=40 CE_Plg1.MPnl1.width="810" CE_Plg1.MPnl1.left="10" CE_Plg1.MPnl1.top="5" CE_Plg1.MPnl1.caption="CE Plugin Collector (Menu Builder) V1" CE_Plg1.MPnl1.Color=clAqua CE_Plg1.MPnl1.BevelWidth=3 CE_Plg1.MPnl1.Cursor = -22 CE_Plg1.MPnl1.FontStyle="fsBold" CE_Plg1.MPnl1.Font.Size=20 CE_Plg1.MPnl1.Font.name="Georgia" CE_Plg1.MPnl1.OnMouseDown=function() MyPlug1.DragNow() end ----------------------- ----------------------- CE_Plg1.MPnl2 -----  CE_Plg1.MPnl2=createPanel(MyPlug1) CE_Plg1.MPnl2.AutoSize=false CE_Plg1.MPnl2.height="340" CE_Plg1.MPnl2.width="810" CE_Plg1.MPnl2.left="10" CE_Plg1.MPnl2.top="50" CE_Plg1.MPnl2.alignment="2" CE_Plg1.MPnl2.Color=clAqua CE_Plg1.MPnl2.BevelWidth=3 CE_Plg1.MPnl2.Enabled=true CE_Plg1.MPnl2.FontStyle=fsBold CE_Plg1.MPnl2.FontSize=0 ----------------------- ----------------------- CE_Plg1.Btn1 -----  CE_Plg1.Btn1=createPanel(CE_Plg1.MPnl1) CE_Plg1.Btn1.AutoSize=false CE_Plg1.Btn1.height="25" CE_Plg1.Btn1.width="30" CE_Plg1.Btn1.left="10" CE_Plg1.Btn1.top=7 CE_Plg1.Btn1.caption="Btn1" CE_Plg1.Btn1.alignment="2" CE_Plg1.Btn1.Enabled=true CE_Plg1.Btn1.FontStyle=fsBold CE_Plg1.Btn1.FontSize=0 ----------------------- ----------------------- CE_Plg1.Btn2 -----  CE_Plg1.Btn2=createPanel(CE_Plg1.MPnl1) CE_Plg1.Btn2.AutoSize=false CE_Plg1.Btn2.height="25" CE_Plg1.Btn2.width="30" CE_Plg1.Btn2.left="770" CE_Plg1.Btn2.top=7 CE_Plg1.Btn2.caption="CEPanel3" CE_Plg1.Btn2.alignment="2" CE_Plg1.Btn2.Enabled=true CE_Plg1.Btn2.FontStyle=fsBold CE_Plg1.Btn2.FontSize=0 ----------------------- ----------------------- CE_Plg1.MGBox1 -----  CE_Plg1.MGBox1=createGroupBox(CE_Plg1.MPnl2) CE_Plg1.MGBox1.AutoSize=false CE_Plg1.MGBox1.height="285" CE_Plg1.MGBox1.width="790" CE_Plg1.MGBox1.left="10" CE_Plg1.MGBox1.top="45" CE_Plg1.MGBox1.caption="" CE_Plg1.MGBox1.Enabled=true CE_Plg1.MGBox1.FontStyle=fsBold CE_Plg1.MGBox1.FontSize=0 ----------------------- ----------------------- CE_Plg1.OpBtn1 -----  CE_Plg1.OpBtn1=createPanel(CE_Plg1.MPnl2) CE_Plg1.OpBtn1.AutoSize=false CE_Plg1.OpBtn1.height="30" CE_Plg1.OpBtn1.width="150" CE_Plg1.OpBtn1.left="10" CE_Plg1.OpBtn1.top="10" CE_Plg1.OpBtn1.caption="Add Plugin" CE_Plg1.OpBtn1.alignment="2" CE_Plg1.OpBtn1.Enabled=true CE_Plg1.OpBtn1.FontStyle=fsBold CE_Plg1.OpBtn1.FontSize=0 ----------------------- ----------------------- CE_Plg1.OpBtn2 -----  CE_Plg1.OpBtn2=createPanel(CE_Plg1.MPnl2) CE_Plg1.OpBtn2.AutoSize=false CE_Plg1.OpBtn2.height="30" CE_Plg1.OpBtn2.width="150" CE_Plg1.OpBtn2.left="650" CE_Plg1.OpBtn2.top="10" CE_Plg1.OpBtn2.caption="Edit or Delete" CE_Plg1.OpBtn2.alignment="2" CE_Plg1.OpBtn2.Enabled=true CE_Plg1.OpBtn2.FontStyle=fsBold CE_Plg1.OpBtn2.FontSize=0 ----------------------- ----------------------- CE_Plg1.OpLbl1 -----  CE_Plg1.OpLbl1=createLabel(CE_Plg1.MPnl2) CE_Plg1.OpLbl1.AutoSize=false CE_Plg1.OpLbl1.height=30 CE_Plg1.OpLbl1.width=470 CE_Plg1.OpLbl1.left=170 CE_Plg1.OpLbl1.top=10 CE_Plg1.OpLbl1.alignment="taCenter" CE_Plg1.OpLbl1.FontSize=14 CE_Plg1.OpLbl1.FontStyle=fsBold CE_Plg1.OpLbl1.OptimalFill=true ----------------------- ----------------------- CE_Plg1.OpMmo1 -----  CE_Plg1.OpMmo1=createMemo(CE_Plg1.MGBox1) CE_Plg1.OpMmo1.AutoSize=false CE_Plg1.OpMmo1.height="235" CE_Plg1.OpMmo1.width="620" CE_Plg1.OpMmo1.left="10" CE_Plg1.OpMmo1.top="15" CE_Plg1.OpMmo1.alignment="taLeftJustify" CE_Plg1.OpMmo1.Enabled=true CE_Plg1.OpMmo1.FontStyle=fsBold CE_Plg1.OpMmo1.FontSize=0 CE_Plg1.OpMmo1.ScrollBars="ssAutoBoth" CE_Plg1.OpMmo1.wordWrap=false ----------------------- ----------------------- CE_Plg1.OpBtn3 -----  CE_Plg1.OpBtn3=createPanel(CE_Plg1.MGBox1) CE_Plg1.OpBtn3.AutoSize=false CE_Plg1.OpBtn3.height="30" CE_Plg1.OpBtn3.width="140" CE_Plg1.OpBtn3.left="640" CE_Plg1.OpBtn3.top="15" CE_Plg1.OpBtn3.caption="Select File" CE_Plg1.OpBtn3.alignment="2" ----------------------- ----------------------- CE_Plg1.OpLbl2 -----  CE_Plg1.OpLbl2=createLabel(CE_Plg1.MGBox1) CE_Plg1.OpLbl2.AutoSize=false CE_Plg1.OpLbl2.height="19" CE_Plg1.OpLbl2.width="620" CE_Plg1.OpLbl2.left="10" CE_Plg1.OpLbl2.top="-9" CE_Plg1.OpLbl2.caption="Plugin Name ..." CE_Plg1.OpLbl2.alignment="taCenter" CE_Plg1.OpLbl2.Enabled=true CE_Plg1.OpLbl2.FontStyle=fsBold CE_Plg1.OpLbl2.OptimalFill=true ----------------------- ----------------------- CE_Plg1.OpLbl3 -----  CE_Plg1.OpLbl3=createLabel(CE_Plg1.MGBox1) CE_Plg1.OpLbl3.AutoSize=false CE_Plg1.OpLbl3.height="19" CE_Plg1.OpLbl3.width="140" CE_Plg1.OpLbl3.left="640" CE_Plg1.OpLbl3.top="-9" CE_Plg1.OpLbl3.caption="OPTIONS" CE_Plg1.OpLbl3.alignment="taCenter" CE_Plg1.OpLbl3.Enabled=true CE_Plg1.OpLbl3.FontStyle=fsBold CE_Plg1.OpLbl3.OptimalFill=true ----------------------- ----------------------- CE_Plg1.OpEdt1 -----  CE_Plg1.OpEdt1=createEdit(CE_Plg1.MGBox1) CE_Plg1.OpEdt1.AutoSize=false CE_Plg1.OpEdt1.height="25" CE_Plg1.OpEdt1.width="140" CE_Plg1.OpEdt1.left="640" CE_Plg1.OpEdt1.top="95" CE_Plg1.OpEdt1.TextHint="Plugin Name?" CE_Plg1.OpEdt1.alignment="taLeftJustify" CE_Plg1.OpEdt1.Enabled=true CE_Plg1.OpEdt1.FontStyle=fsBold ----------------------- ----------------------- CE_Plg1.OpEdt2 -----  CE_Plg1.OpEdt2=createEdit(CE_Plg1.MGBox1) CE_Plg1.OpEdt2.AutoSize=false CE_Plg1.OpEdt2.height="25" CE_Plg1.OpEdt2.width="140" CE_Plg1.OpEdt2.left="640" CE_Plg1.OpEdt2.top="135" CE_Plg1.OpEdt2.TextHint="Shortcut (Start Key)" CE_Plg1.OpEdt2.alignment="taLeftJustify" CE_Plg1.OpEdt2.Enabled=true CE_Plg1.OpEdt2.FontStyle=fsBold ----------------------- ----------------------- CE_Plg1.OpBtn4 -----  CE_Plg1.OpBtn4=createPanel(CE_Plg1.MGBox1) CE_Plg1.OpBtn4.AutoSize=false CE_Plg1.OpBtn4.height="30" CE_Plg1.OpBtn4.width="140" CE_Plg1.OpBtn4.left="640" CE_Plg1.OpBtn4.top=55 CE_Plg1.OpBtn4.caption="Add Lua Script Code" CE_Plg1.OpBtn4.alignment="2" CE_Plg1.OpBtn4.Enabled=true CE_Plg1.OpBtn4.FontStyle=fsBold ----------------------- ----------------------- CE_Plg1.OpBtn5 -----  CE_Plg1.OpBtn5=createPanel(CE_Plg1.MGBox1) CE_Plg1.OpBtn5.AutoSize=false CE_Plg1.OpBtn5.height="30" CE_Plg1.OpBtn5.width="140" CE_Plg1.OpBtn5.left="640" CE_Plg1.OpBtn5.top="220" CE_Plg1.OpBtn5.caption="Save" CE_Plg1.OpBtn5.alignment="2" ----------------------- ----------------------- CE_Plg1.OpBtn5 -----  CE_Plg1.OpBtn15=createPanel(CE_Plg1.MGBox1) CE_Plg1.OpBtn15.AutoSize=false CE_Plg1.OpBtn15.height="30" CE_Plg1.OpBtn15.width="140" CE_Plg1.OpBtn15.left="640" CE_Plg1.OpBtn15.top=175 CE_Plg1.OpBtn15.caption="Clear Memo" CE_Plg1.OpBtn15.alignment="2" ----------------------- ----------------------- CE_Plg1.MGBox2 -----  CE_Plg1.MGBox2=createGroupBox(CE_Plg1.MPnl2) CE_Plg1.MGBox2.AutoSize=false CE_Plg1.MGBox2.height="285" CE_Plg1.MGBox2.width="790" CE_Plg1.MGBox2.left="10" CE_Plg1.MGBox2.top="45" CE_Plg1.MGBox2.caption="" CE_Plg1.MGBox2.Enabled=true CE_Plg1.MGBox2.FontStyle=fsBold ----------------------- ----------------------- CE_Plg1.OpMmo2 -----  CE_Plg1.OpMmo2=createMemo(CE_Plg1.MGBox2) CE_Plg1.OpMmo2.AutoSize=false CE_Plg1.OpMmo2.height="235" CE_Plg1.OpMmo2.width="620" CE_Plg1.OpMmo2.left="10" CE_Plg1.OpMmo2.top="15" CE_Plg1.OpMmo2.alignment="taLeftJustify" CE_Plg1.OpMmo2.Enabled=true CE_Plg1.OpMmo2.FontStyle=fsBold CE_Plg1.OpMmo2.FontSize=10 CE_Plg1.OpMmo2.ScrollBars="ssAutoBoth" CE_Plg1.OpMmo2.wordWrap=false ----------------------- ----------------------- CE_Plg1.OpBtn6 -----  CE_Plg1.OpBtn6=createPanel(CE_Plg1.MGBox2) CE_Plg1.OpBtn6.AutoSize=false CE_Plg1.OpBtn6.height="30" CE_Plg1.OpBtn6.width="140" CE_Plg1.OpBtn6.left="640" CE_Plg1.OpBtn6.top="180" CE_Plg1.OpBtn6.caption="Delete Plugin" ----------------------- ----------------------- CE_Plg1.OpBtn16 -----  CE_Plg1.OpBtn16=createPanel(CE_Plg1.MGBox2) CE_Plg1.OpBtn16.AutoSize=false CE_Plg1.OpBtn16.height="30" CE_Plg1.OpBtn16.width="140" CE_Plg1.OpBtn16.left="640" CE_Plg1.OpBtn16.top=135 CE_Plg1.OpBtn16.caption="Clear Memo" ----------------------- ----------------------- CE_Plg1.OpLbl4 -----  CE_Plg1.OpLbl4=createLabel(CE_Plg1.MGBox2) CE_Plg1.OpLbl4.AutoSize=false CE_Plg1.OpLbl4.height="19" CE_Plg1.OpLbl4.width="620" CE_Plg1.OpLbl4.left="10" CE_Plg1.OpLbl4.top="-9" CE_Plg1.OpLbl4.caption="Plugin Name ..." CE_Plg1.OpLbl4.alignment="taCenter" CE_Plg1.OpLbl4.Enabled=true CE_Plg1.OpLbl4.FontStyle=fsBold CE_Plg1.OpLbl4.OptimalFill=true ----------------------- ----------------------- CE_Plg1.OpLbl5 -----  CE_Plg1.OpLbl5=createLabel(CE_Plg1.MGBox2) CE_Plg1.OpLbl5.AutoSize=false CE_Plg1.OpLbl5.height="19" CE_Plg1.OpLbl5.width="140" CE_Plg1.OpLbl5.left="640" CE_Plg1.OpLbl5.top="-9" CE_Plg1.OpLbl5.caption="OPTIONS" CE_Plg1.OpLbl5.alignment="taCenter" CE_Plg1.OpLbl5.Enabled=true CE_Plg1.OpLbl5.FontStyle=fsBold CE_Plg1.OpLbl5.OptimalFill=true ----------------------- ----------------------- CE_Plg1.OpEdt3 -----  CE_Plg1.OpEdt3=createEdit(CE_Plg1.MGBox2) CE_Plg1.OpEdt3.AutoSize=false CE_Plg1.OpEdt3.height="25" CE_Plg1.OpEdt3.width="140" CE_Plg1.OpEdt3.left="640" CE_Plg1.OpEdt3.top="55" CE_Plg1.OpEdt3.TextHint="Plugin Name?" CE_Plg1.OpEdt3.alignment="taLeftJustify" CE_Plg1.OpEdt3.Enabled=true CE_Plg1.OpEdt3.FontStyle=fsBold ----------------------- ----------------------- CE_Plg1.OpEdt4 -----  CE_Plg1.OpEdt4=createEdit(CE_Plg1.MGBox2) CE_Plg1.OpEdt4.AutoSize=false CE_Plg1.OpEdt4.height="25" CE_Plg1.OpEdt4.width="140" CE_Plg1.OpEdt4.left="640" CE_Plg1.OpEdt4.top="95" CE_Plg1.OpEdt4.TextHint="Shortcut (Start Key)" CE_Plg1.OpEdt4.alignment="taLeftJustify" CE_Plg1.OpEdt4.Enabled=true CE_Plg1.OpEdt4.FontStyle=fsBold ----------------------- ----------------------- CE_Plg1.OpBtn7 -----  CE_Plg1.OpBtn7=createPanel(CE_Plg1.MGBox2) CE_Plg1.OpBtn7.AutoSize=false CE_Plg1.OpBtn7.height="30" CE_Plg1.OpBtn7.width="140" CE_Plg1.OpBtn7.left="640" CE_Plg1.OpBtn7.top="220" CE_Plg1.OpBtn7.caption="Save Plugin" ----------------------- ----------------------- CE_Plg1.OpCBox1 -----  CE_Plg1.OpCBox1=createComboBox(CE_Plg1.MGBox2) CE_Plg1.OpCBox1.AutoSize=true CE_Plg1.OpCBox1.height="27" CE_Plg1.OpCBox1.width="140" CE_Plg1.OpCBox1.left="640" CE_Plg1.OpCBox1.top="15" CE_Plg1.OpCBox1.text="" CE_Plg1.OpCBox1.Enabled=true CE_Plg1.OpCBox1.FontStyle=fsBold CE_Plg1.OpCBox1.ReadOnly=true CE_Plg1.OpCBox1.Style="csDropDownList" CE_Plg1.OpCBox1.ItemIndex=-1 ----------------------- function PnlBtnEffect(name24,text1) name24.BevelColor=clDefault name24.BevelWidth=2 name24.Cursor= -21 name24.Font.Color=0x000000 name24.Font.Style="fsBold" name24.Font.Size=9 name24.Caption=text1 name24.Font.Name="Georgia" name24.OptimalFill=true name24.OnMouseMove=function() name24.BevelColor=0xff0000 end --name24.Font.Color=0x000000 end name24.OnMouseLeave=function() name24.BevelColor=clDefault end --name24.Font.Color=0x000000 end end PnlBtnEffect(CE_Plg1.Btn1,"-") PnlBtnEffect(CE_Plg1.Btn2,"X") PnlBtnEffect(CE_Plg1.OpBtn1,"Add Plugin") PnlBtnEffect(CE_Plg1.OpBtn2,"Edit or Delete") PnlBtnEffect(CE_Plg1.OpBtn3,"Select File") PnlBtnEffect(CE_Plg1.OpBtn4,"Add LuaScript Code") PnlBtnEffect(CE_Plg1.OpBtn5,"Save (Add Plugin)") PnlBtnEffect(CE_Plg1.OpBtn6,"Delete Plugin") PnlBtnEffect(CE_Plg1.OpBtn7,"Save Plugin") PnlBtnEffect(CE_Plg1.OpBtn15,"Clear Memo Text") PnlBtnEffect(CE_Plg1.OpBtn16,"Clear Memo Text") --############################################################################-- local userDefinedKeys1={0,0,0,0,0} local userDefinedKeys2={0,0,0,0,0} CE_Plg1.MGBox1.Visible=true CE_Plg1.MGBox2.Visible=false CE_Plg1.OpLbl1.caption="Select Plugin File and Add Menu!" CE_Plg1.OpBtn1.OnClick=function() CE_Plg1.MGBox1.Visible=true CE_Plg1.MGBox2.Visible=false if CE_Plg1.OpEdt2.Text=="" then userDefinedKeys1={0,0,0,0,0} end CE_Plg1.OpLbl1.caption="Select Plugin File and Add Menu!" end CE_Plg1.OpBtn2.OnClick=function() CE_Plg1.MGBox1.Visible=false CE_Plg1.MGBox2.Visible=true if CE_Plg1.OpEdt4.Text=="" then userDefinedKeys2={0,0,0,0,0} end CE_Plg1.OpLbl1.caption="Select Plugin Edit or Delete!" end CE_Plg1.OpEdt2.OnClick=function() CE_Plg1.OpEdt2.Text="" userDefinedKeys1={0,0,0,0,0} end CE_Plg1.OpEdt4.OnClick=function() CE_Plg1.OpEdt4.Text="" userDefinedKeys2={0,0,0,0,0} end local function userPressedKey1(sender, key) if userDefinedKeys1[5]==0 then for i=1,5 do if userDefinedKeys1[i]==0 then userDefinedKeys1[i]=key break else if userDefinedKeys1[i]==key then break end end end end CE_Plg1.OpEdt2.Text=string.upper(convertKeyComboToString(userDefinedKeys1)) return 0 end local function userPressedKey2(sender, key) if userDefinedKeys2[5]==0 then for i=1,5 do if userDefinedKeys2[i]==0 then userDefinedKeys2[i]=key break else if userDefinedKeys2[i]==key then break end end end end CE_Plg1.OpEdt4.Text=string.upper(convertKeyComboToString(userDefinedKeys2)) return 0 end CE_Plg1.OpEdt2.OnKeyDown=userPressedKey1 CE_Plg1.OpEdt4.OnKeyDown=userPressedKey2 local mbtn={false,true,true,true} CE_Plg1.OpEdt2.OnMouseDown = function (s,k) if mbtn[k] then s.OnKeyDown(s,k+2) end end CE_Plg1.OpEdt4.OnMouseDown = function (s,k) if mbtn[k] then s.OnKeyDown(s,k+2) end end --#################################### 1 #####################################-- Table_mt = { __tostring = function(self) local ret = {} for k, v in ipairs(self) do table.insert(ret, v[1] .. "\t" .. v[2]) end return table.concat(ret, "\n") end } local tableLuaPath1 = setmetatable({}, Table_mt) folderPath = getAutorunPath() Path = getAutorunPath().."Plugins1" --print(Path) if Path then os.execute([[mkdir "]]..folderPath..[[Plugins1"]]) --shellExecute(Path) end function path_File_Read1() local fList local tableLua = { } file_num = 0 if type(Path) == 'table' then fList = Path else fList = getFileList(Path) end if fList then for i, fName in ipairs(fList) do local FileName = fName:match('^[(%w:\\)].*\\(.-%..-)$') or fName if FileName:lower():match('.lua$') then fln1,fln3 = FileName:match('%d(.*)_((.*))....') fln2 = (fln3):sub(2,-2) table.insert(tableLua,{fln1,fln2}) end end end file_num = #tableLua return tableLua end tableLuaPath1 = path_File_Read1() --#################################### 2 #####################################-- function check_Plug_Name(tbl,name,shrt) name = (name):lower() local err = "'%s' being used by another plugin. Please change!" shrt = (shrt):lower() for k, v in ipairs(tbl) do --print(v[1] .. " --- " .. v[2]) if string.lower(v[1])==name then return (err):format(v[1]) elseif string.lower(v[2])==shrt then return (err):format(v[2]) else return "true" end end end --#################################### 3 #####################################-- aa7 = [[mf = getMainForm() mainMenu = mf.Menu.Items if miPlug1 then miPlug1.Destroy() miPlug1=nil end miPlug1 = createMenuItem(mf.MainMenu) miPlug1.Name = 'miPlug1' miPlug1.Caption = 'AllPlugins' mainMenu.insert(mainMenu.Count-1,miPlug1) Path = getAutorunPath().."Plugins1" --############################################-- function Add_Plugin_Org11() local pth_Org = getAutorunPath().."Add_Plugin_Org.lua" local fnc1 = io.open(pth_Org,'r') local fnc2 = fnc1:read('*a') fnc1:close() proc1 = loadstring(fnc2)() Add_Plugin_Org() end Add_Edit_Plug1 = createMenuItem(miPlug1) Add_Edit_Plug1.Caption = "AddEdit Plugins" Add_Edit_Plug1.onClick = Add_Plugin_Org11 miPlug1.add(Add_Edit_Plug1) --############################################-- ]] local aa10 = "" local remove_file = "" local newName1 = "" local newShrt1 = "" local newNmr1 = 0 function write_Plug_Menu(name,shrt,ops,nmr2) file8 = ("Plug_"..name):gsub("%s","_") aa8 = "" aa8_1 = "load"..file8 shrt = string.upper(shrt) ----------------- aa8 = aa8 .. "function "..aa8_1.."()\n" aa8 = aa8 .. "local lFunc = Path..[==[\\"..nmr2..name.."_("..shrt..").lua]==]\n" aa8 = aa8 .. "local fnc1 = io.open(lFunc,'r')\n" aa8 = aa8 .. "local fnc2 = fnc1:read('*a')\n" aa8 = aa8 .. "fnc1:close()\n" aa8 = aa8 .. "load(fnc2)()\nend\n\n" ----------------- aa9 = "" aa9 = aa9 .. file8.." = createMenuItem(miPlug1)\n" aa9 = aa9 .. file8..".Caption = '"..name.."'\n" aa9 = aa9 .. file8..".onClick = " .. aa8_1 .. "\n" if shrt~="--" then aa9 = aa9 .. "menuItem_setShortcut("..file8..", '"..shrt.."')\n" end aa9 = aa9 .. "miPlug1.add("..file8..")\n" if ops==1 then aa10 = aa10 .. "\n--############################################\n" aa10 = aa10 .. aa7 .."\n" .. aa8 .. aa9 aa10 = aa10 .. "\n--############################################\n" end if ops==2 then aa10 = aa10 .. "\n--############################################\n" aa10 = aa10 .. aa8 .. aa9 aa10 = aa10 .. "\n--############################################\n" end if #tableLuaPath1==0 then aa10 = "\n--############################################\n" aa10 = aa10 .. aa7 aa10 = aa10 .. "\n--############################################\n" end return aa10 end --#################################### 4 #####################################-- function update_Cb1() local fList local tableLua = { } file_num = 0 CE_Plg1.OpCBox1.clear() CE_Plg1.OpCBox1.Items.Add("Select Plug") CE_Plg1.OpCBox1.ItemIndex=0 if type(Path) == 'table' then fList = Path else fList = getFileList(Path) end if fList then for i, fName in ipairs(fList) do local FileName = fName:match('^[(%w:\\)].*\\(.-%..-)$') or fName if FileName:lower():match('.lua$') then table.insert(tableLua, FileName) fln1,fln3 = FileName:match('%d(.*)_((.*))....') --print(fln1) fln2 = i..fln1..".lua" CE_Plg1.OpCBox1.Items.Add(fln1.."--"..fln3) --print(fName) end end end file_num = #tableLua return tableLua end update_Cb1() function find_update_Tbl_Menu() path_file_tbl = folderPath.."AllPluginTbl1.lua" if path_file_tbl then file11=io.open(path_file_tbl, "w") file11:write(aa10) file11:close() end file_tbl = io.open(path_file_tbl, "r") aa1_tbl = file_tbl:read('*a') file_tbl.close() if aa1_tbl then --print(aa1_tbl) load(aa1_tbl)() update_Cb1() sleep(200) showMessage("Plugins have been successfully updated.") end end function check_add_plugin() chk_len1 = #tableLuaPath1 if chk_len1 == 0 then newNmr1 = 1 write_Plug_Menu(newName1,newShrt1,1,newNmr1) find_update_Tbl_Menu() else for i,v in ipairs(tableLuaPath1) do if i==1 then write_Plug_Menu(v[1],v[2],1,newNmr1) else write_Plug_Menu(v[1],v[2],2,newNmr1) end if i==#tableLuaPath1 then find_update_Tbl_Menu() end end end end --#################################### 5 #####################################-- function edit_or_Add_Plug(str,nmr,plgName1,plgKey1) local newMenu10 = "" local plgCode if nmr==0 or nmr==nil then nmr=1 end if str==1 then plgCode = CE_Plg1.OpMmo1.Lines.Text end if str==2 then plgCode = CE_Plg1.OpMmo2.Lines.Text end if plgKey1 == "" then plgKey1 = "--" end newMenu10 = "\n"..plgCode.."\n" path_file_lua = Path.."\\"..nmr..plgName1.."_("..plgKey1..").lua" if path_file_lua then file12=io.open(path_file_lua, "w") file12:write(newMenu10) file12:close() tableLuaPath1 = path_File_Read1() newName1 = plgName1 newShrt1 = plgKey1 newNmr1 = nmr check_add_plugin() end end --#################################### 6 #####################################-- CE_Plg1.OpBtn5.OnClick=function() -- save plugin local plgName1 = CE_Plg1.OpEdt1.Text local plgKey1 = CE_Plg1.OpEdt2.Text local nmr1 = 0 tableLuaPath1 = path_File_Read1() if #tableLuaPath1 == 0 then tableLuaPath1 = path_File_Read1() aa10 = "" nmr1 = #tableLuaPath1 + 1 edit_or_Add_Plug(1,nmr1,plgName1,plgKey1) else local chk1 = check_Plug_Name(tableLuaPath1,plgName1,plgKey1) if chk1=="true" then tableLuaPath1 = path_File_Read1() aa10 = "" nmr1 = #tableLuaPath1 + 1 edit_or_Add_Plug(1,nmr1,plgName1,plgKey1) else showMessage(chk1) end end end CE_Plg1.OpBtn7.OnClick=function() --edit - save plugin local plgName2 = CE_Plg1.OpEdt3.Text local plgKey2 = CE_Plg1.OpEdt4.Text tableLuaPath1 = path_File_Read1() if #tableLuaPath1 == 0 then tableLuaPath1 = path_File_Read1() aa10 = "" local nmr1 = #tableLuaPath1 + 1 edit_or_Add_Plug(1,nmr2,plgName2,plgKey2) else local chk2 = check_Plug_Name(tableLuaPath1,plgName2,plgKey2) if chk2=="true" then os.remove(remove_file) tableLuaPath1 = path_File_Read1() aa10 = "" local nmr2 = #tableLuaPath1 + 1 edit_or_Add_Plug(1,nmr2,plgName2,plgKey2) else showMessage(chk1) end end end CE_Plg1.OpBtn6.OnClick=function() --delete plugin local plgName2 = CE_Plg1.OpEdt3.Text local plgKey2 = CE_Plg1.OpEdt4.Text os.remove(remove_file) tableLuaPath1 = path_File_Read1() aa10 = "" check_add_plugin() end --#################################### 7 #####################################-- function file_read_add2(path,str,name,shrt) aa = path.."\\"..str..name.."_"..shrt..".lua" local file = io.open(aa, 'r') local fileContent = {} for line in file:lines() do table.insert (fileContent, line) end file:close() return fileContent end function plug_loaded1(path,str,name) local fList local fln1 local fln3 local nsrt = 0 str = tonumber(str) if type(path) == 'table' then fList = path else fList = getFileList(path) end if fList then for i, fName in ipairs(fList) do local FileName = fName:match('^[(%w:\\)].*\\(.-%..-)$') or fName if i == str then remove_file = fName nsrt,fln1,fln3 = FileName:match('(%d)(.*)_((.*))....') end end if fln1 then aa1 = table.concat(file_read_add2(path,nsrt,fln1,fln3),"\n") if aa1~=nil then --print(aa1) shrt = (fln3):sub(2,-2) if shrt=="--" then shrt="" end CE_Plg1.OpLbl4.caption="Plugin Name: ".. fln1 CE_Plg1.OpMmo2.Lines.Text = aa1 CE_Plg1.OpEdt3.Text = fln1 CE_Plg1.OpEdt4.Text = shrt end end end --print(aa1) end --#################################### 8 #####################################-- CE_Plg1.OpCBox1.OnChange=function() local index = CE_Plg1.OpCBox1.ItemIndex idxname = CE_Plg1.OpCBox1.Text if index~=0 then file_num1 = tonumber(index) plug_loaded1(Path,file_num1,idxname) end end --#################################### 9 #####################################-- function file_path() file_name = "" local file_dialog = createOpenDialog() file_dialog.InitialDir = os.getenv('%USERPROFILE%') file_dialog.Filter = 'All files (*.*)|*' if file_dialog.execute() then file_name = file_dialog.FileName name=file_name:match("[^\\]*$") CE_Plg1.OpLbl2.caption="Plugin Name: ".. name return file_name else return nil end end function file_read_add12() aa = file_path() if aa~=nil then local file = io.open(aa, 'r') local fileContent = {} for line in file:lines() do table.insert (fileContent, line) end file:close() return fileContent end end CE_Plg1.OpBtn3.OnClick=function() --load plugin text aa2 = file_read_add12() if aa2~=nil then aa1 = assert(table.concat(aa2,"\n")) --print(aa1) CE_Plg1.OpMmo1.Lines.Text = aa1 end end --################################### 10 #####################################-- CE_Plg1.OpBtn4.OnClick=function() --lua scrpt CE_Plg1.OpMmo1.Lines.Text="" aa=MainForm.frmAutoInject.Assemblescreen.Lines.Text CE_Plg1.OpMmo1.Lines.Text=aa end CE_Plg1.OpBtn15.OnClick=function() --lua scrpt CE_Plg1.OpMmo1.Lines.Text="" end CE_Plg1.OpBtn16.OnClick=function() --lua scrpt CE_Plg1.OpMmo2.Lines.Text="" end CE_Plg1.Btn1.OnClick=function() MyPlug1.WindowState = "wsMinimized" end CE_Plg1.Btn2.OnClick=function() MyPlug1.Close() end end --################################### 010 ####################################-- --################################### 010 ####################################-- PlugOps1 = [[mf = getMainForm() mainMenu = mf.Menu.Items if miPlug1 then miPlug1.Destroy() miPlug1=nil end miPlug1 = createMenuItem(mf.MainMenu) miPlug1.Name = 'miPlug1' miPlug1.Caption = 'AllPlugins' mainMenu.insert(mainMenu.Count-1,miPlug1) Path = getAutorunPath().."Plugins1" --############################################-- function Add_Plugin_Org11() local pth_Org = getAutorunPath().."Add_Plugin_Org.lua" local fnc1 = io.open(pth_Org,'r') local fnc2 = fnc1:read('*a') fnc1:close() proc1 = loadstring(fnc2)() Add_Plugin_Org() end Add_Edit_Plug1 = createMenuItem(miPlug1) Add_Edit_Plug1.Caption = "AddEdit Plugins" Add_Edit_Plug1.onClick = Add_Plugin_Org11 miPlug1.add(Add_Edit_Plug1) --############################################-- ]] path_file_tbl12 = getAutorunPath().."AllPluginTbl1.lua" function Load_update_Tbl_Menu11() if path_file_tbl12 then file11=io.open(path_file_tbl12, "w") file11:write(PlugOps1) file11:close() end file_tbl = io.open(path_file_tbl12, "r") aa1_tbl = file_tbl:read('*a') file_tbl.close() if aa1_tbl then --print(aa1_tbl) load(aa1_tbl)() end end function directory_exists(path2) local file=path2 f = os.rename(file, file) if not f then return false else return true end end if directory_exists(path_file_tbl12)==false then Load_update_Tbl_Menu11() end