Source language: Translate to:

hpwPlayAction

Questions about NeoBook PlugIns

Moderator: Neosoft Support

Re: hpwPlayAction

Postby HPW » Wed Mar 11, 2015 11:16 am

... it loads fine but actions do not work


It loads meen that you have installed it successfully?
When you open a button where your new command is used it is highlighted blue?
What happen in the debugger when you press your button?
Does it show:
PushButtonX > LeftClick
(green bullet)YourCommandName "YourParam"

Did you encryt with a password and do you provide this password in the your app?

You can place a alertbox in your command-script for debugging.

Just some thoughts what can be wrong.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2519
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: hpwPlayAction

Postby Palamar » Wed Mar 11, 2015 8:29 pm

Did you encryt with a password and do you Provide this password in the your app ?


There was the problem. The plugin if or if it has to be validated by a user or " compile" and use it as DEMO . Thanks HPW .
Palamar
 
Posts: 157
Joined: Wed Apr 06, 2005 4:34 pm

Re: hpwPlayAction

Postby mishem » Sat Aug 26, 2017 1:44 am

Hello.

I create EmbeddedPlugin.

How and where to send the password to the team to work?

Can you make an example of creating a plugin with encryption commands and password transfer?
One command in the plugin is enough.
mishem
 
Posts: 575
Joined: Mon Oct 08, 2012 1:51 pm

Re: hpwPlayAction

Postby HPW » Sat Aug 26, 2017 2:54 am

Helo,

There is the sample MyNewEmbeddedPlugin.pub
On page 2 is a RTF-Doc about creating your own plugin.

In the Pub which should use the plugin you must set the corresponding Password somewhere.
You have to provide your pugin user with it.
In the demo it is in page Action:
SetVar "[MyNewEmbeddedPlugin_password]" "123456"
Of course it must be yours plugin-name.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2519
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: hpwPlayAction

Postby mishem » Sat Aug 26, 2017 3:40 am

I create a plugin named NewPlugin and the mAlertBox command.

In mAlertBox.txt
Code: Select all
.hpwPlayMacroSource
AlertBox "[$mAlertBox_1]" "[$mAlertBox_2]"


Compile. Everything works.

---------------------------------------

I encode the command.
Code: Select all
hpwEncodeMacroFile "[Function]" "[Password]" "[PathFolderProject]\[NameAction].txt"


[Function]=
Code: Select all
.hpwPlayMacroSource
AlertBox "[$mAlertBox_1]" "[$mAlertBox_2]"


[Password]=1

Get the file mAlertBox.txt.
Compile.

Running.

Code: Select all
SetVar "[NewPlugin_password]" "1"
mAlertBox "1" "2"


Does not work.

In the debugger, the variables $mAlertBox_1 and $mAlertBox_2 have a value of 1 and 2.
Alert box is not displayed.

Where is the mistake?
mishem
 
Posts: 575
Joined: Mon Oct 08, 2012 1:51 pm

Re: hpwPlayAction

Postby HPW » Sat Aug 26, 2017 5:39 am

Not easy to debug from here. Looks right so far.
With compile you mean the complete process of binding the source with reshack and installing your new plugin?
Is mAlertBox highlighted blue as a known command in your demo?
Are the cfp and cfr files correct?

Can you create the demo MyNewEmbeddedPlugin.nbp / nbr yourself in your enviroment and does it work?

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2519
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: hpwPlayAction

Postby HPW » Sat Aug 26, 2017 5:55 am

For Debugging you can test your encoded macro also with command hpwPlayMacro without any further setup.
When it works, the error is in the Setup/bind process
Hans-Peter
User avatar
HPW
 
Posts: 2519
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: hpwPlayAction

Postby mishem » Sat Aug 26, 2017 6:48 am

Not easy to debug from here. Looks right so far.
With compile you mean the complete process of binding the source with reshack and installing your new plugin?
Is mAlertBox highlighted blue as a known command in your demo?
Can you create the demo MyNewEmbeddedPlugin.nbp / nbr yourself in your enviroment and does it work?

Yes.

For Debugging you can test your encoded macro also with command hpwPlayMacro without any further setup.

It's working.

Are the cfp and cfr files correct?

I doubt it.

It must be in a file cfp?
Code: Select all
999|MyNewHidden_PlayMacro|HIDDEN|1;1;1|3


-----------------------------------------------------------------------------

txt
Code: Select all
.hpwPlayMacroSource
mAlertBox "[$mExit_1]" "[$mExit_2]"


cfp
Code: Select all
0|Description of ...||0|0
1|mAlertBox|Description of ...|1;1|2


cfr
Code: Select all
1|mAlertBox||1;1|2


Without encoding plugin builds and runs.

I need to create a hidden command and add it to the cfp and cfr files?
mishem
 
Posts: 575
Joined: Mon Oct 08, 2012 1:51 pm

Re: hpwPlayAction

Postby HPW » Sat Aug 26, 2017 9:02 am

Hello,

takes me some time to dig into this stuff again, but I think I know what your problem is.

Have you edit the NewPlugin.res file's header text to reflect the name change? Was mentioned in the HowTo-RTF.
In 'Version Info' of the res file you have to exchange all MyNewEmbeddedPlugin to NewPlugin.

The plugin-template reads the name from the res-info so it does know its real name and is able to build the variable-name of the password-variable.
That was needed to let a user rename the plugin and it still works.

>I need to create a hidden command and add it to the cfp and cfr files?

Yes, since they are not distributed with your plugin it is not a problem.

Regards
Hans-Peter
Hans-Peter
User avatar
HPW
 
Posts: 2519
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: hpwPlayAction

Postby mishem » Sat Aug 26, 2017 9:24 am

Here all the files with the ready plugin.

http://rgho.st/8X5pbbSYR

Instead of a bat file, I use the NeoBook Run command.

If you encode the file mAlertBox.txt, the plugin will stop working.
mishem
 
Posts: 575
Joined: Mon Oct 08, 2012 1:51 pm

Re: hpwPlayAction

Postby HPW » Sat Aug 26, 2017 9:30 am

The download does not work for me.
Have you tried to edit the res-file and rebuild the nbp by the reshack script?

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2519
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: hpwPlayAction

Postby mishem » Sat Aug 26, 2017 9:37 am

Have you tried to edit the res-file and rebuild the nbp by the reshack script?

Yes.

The download does not work for me.

Try it like this
http://polariton.rghost.ru/download/8X5 ... ertBox.zip


Have you edit the NewPlugin.res file's header text to reflect the name change?

I create a new plugin, not from the template.

------------------------------

I'm doing the Assistant to create Neobook plugin.
All the data is done programmatically.

So I'm making changes to the res file.

Code: Select all
SetVar "[Shablon_RC_File]" "LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL[#13][#10][#13][#10]MAINICON ICON [#34][ICON][#34][#13][#10][#13][#10][#13][#10]1 VERSIONINFO[#13][#10]FILEVERSION 1,5,0,0[#13][#10]PRODUCTVERSION 1,5,0,0[#13][#10]FILEOS 0x4[#13][#10]FILETYPE 0x2[#13][#10]{[#13][#10]BLOCK [#34]StringFileInfo[#34][#13][#10]{[#13][#10]   BLOCK [#34]040904E4[#34][#13][#10]   {[#13][#10]      VALUE [#34]CompanyName[#34], [#34][CompanyName][#34][#13][#10]      VALUE [#34]FileDescription[#34], [#34]Плагин NeoBook[#34][#13][#10]      VALUE [#34]FileVersion[#34], [#34]1.5.0.0[#34][#13][#10]      VALUE [#34]InternalName[#34], [#34][NamePlugin].nbp[#34][#13][#10]      VALUE [#34]LegalCopyright[#34], [#34][CompanyName][#34][#13][#10]      VALUE [#34]LegalTrademarks[#34], [#34][CompanyName][#34][#13][#10]      VALUE [#34]OriginalFilename[#34], [#34][NamePlugin].nbp[#34][#13][#10]      VALUE [#34]ProductName[#34], [#34][NamePlugin][#34][#13][#10]      VALUE [#34]ProductVersion[#34], [#34][ProductVersion][#34][#13][#10]      VALUE [#34]Comments[#34], [#34]Плагин для программы NeoBook[#34][#13][#10]   }[#13][#10]}[#13][#10][#13][#10]BLOCK [#34]VarFileInfo[#34][#13][#10]{[#13][#10]   VALUE [#34]Translation[#34], 0x0409 0x04E4  [#13][#10]}[#13][#10]}"

PopulateStr "[Shablon_RC_File]" "[RC_File]"

zmConvertString "AnsiToUtf8" "[RC_File]" "[RC_File]"

FileWrite "[PathFolderProject]\[NamePlugin].rc" "All" "[RC_File]"

Run "[ResHacker]" "-open [#34][PathFolderProject]\[NamePlugin].rc[#34]  -save [#34][PathFolderProject]\[NamePlugin].res[#34] -action compile -log NUL" "Wait+LoadComplete+Minimized+Hidden" "" ""


So I collect a file. Etc.

Code: Select all
Run "[ResHacker]" "-addoverwrite [#34][PathFolderProject]\[NamePlugin].tnbr[#34], [#34][PathFolderProject]\[NamePlugin].nbr[#34], [#34][PathFolderProject]\[NamePlugin].res[#34] , , ," "Wait+LoadComplete+Minimized" "" ""
Loop "1" "[ActionsCount]" "[i]"
    hpwLine "[Actions]" "[i]" "[NameAction]"
    Run "[ResHacker]" "-add [#34][PathFolderProject]\[NamePlugin].nbr[#34], [#34][PathFolderProject]\[NamePlugin].nbr[#34], [#34][PathFolderProject]\[NameAction].txt[#34], PluginCommands,[NameAction],0" "Wait+LoadComplete+Minimized" "" ""
EndLoop
Run "[ResHacker]" "-add [#34][PathFolderProject]\[NamePlugin].nbr[#34], [#34][PathFolderProject]\[NamePlugin].nbr[#34], [#34][PathFolderProject]\[NamePlugin].cfr[#34], PluginConfig,Config,0" "Wait+LoadComplete+Minimized" "" ""

Run "[ResHacker]" "-addoverwrite [#34][PathFolderProject]\[NamePlugin].tnbp[#34], [#34][PathFolderProject]\[NamePlugin].nbp[#34], [#34][PathFolderProject]\[NamePlugin].res[#34] , , ," "Wait+LoadComplete+Minimized" "" ""
Loop "1" "[ActionsCount]" "[i]"
    hpwLine "[Actions]" "[i]" "[NameAction]"
    Run "[ResHacker]" "-add [#34][PathFolderProject]\[NamePlugin].nbp[#34], [#34][PathFolderProject]\[NamePlugin].nbp[#34], [#34][PathFolderProject]\[NameAction].txt[#34], PluginCommands,[NameAction],0" "Wait+LoadComplete+Minimized" "" ""
EndLoop
Run "[ResHacker]" "-add [#34][PathFolderProject]\[NamePlugin].nbp[#34], [#34][PathFolderProject]\[NamePlugin].nbp[#34], [#34][PathFolderProject]\[NamePlugin].cfp[#34], PluginConfig,Config,0" "Wait+LoadComplete+Minimized" "" ""
Run "[ResHacker]" "-add [#34][PathFolderProject]\[NamePlugin].nbp[#34], [#34][PathFolderProject]\[NamePlugin].nbp[#34], [#34][PathFolderProject]\[NamePlugin].ini[#34], PluginConfig,Ini,0" "Wait+LoadComplete+Minimized" "" ""



Perhaps somewhere I err. Here I sit I understand and I can not understand in any way. :(
mishem
 
Posts: 575
Joined: Mon Oct 08, 2012 1:51 pm

Re: hpwPlayAction

Postby mishem » Sat Aug 26, 2017 9:42 am

Generally I do so that the plug-in can be built from NeoBook functions.
We write a function in NeoBook with parameters, and afterwards we convert it to a plugin. If necessary, just make some changes to the function.
mishem
 
Posts: 575
Joined: Mon Oct 08, 2012 1:51 pm

Re: hpwPlayAction

Postby mishem » Sat Aug 26, 2017 9:47 am

If interested, all the plugin build code.
I can throw off the whole project, but there are comments all in Cyrillic.

Code: Select all
.........................................................................................
......................Извлекаем необходимые файлы для плагина............................
.........................................................................................


.................................Проверяем существование программы ResourceHacker.exe...............................
GoSub "ResourceHacker"

..............................Создаем файлы tnbp;tnbr...................................

SetVar "[Ext]" "tnbp;tnbr"
StrParse "[Ext]" ";" "[Ext]" "[Ext.Num]"
Loop "1" "[Ext.Num]" "[i]"
    FileExists "[PathFolderProject]\[NamePlugin].[Ext[i]]" "[Result]"
    If "[Result]" "=" "True"
        FileErase "[PathFolderProject]\[NamePlugin].[Ext[i]]"
    EndIf
    ExtractFile "[Embedded]Example.[Ext[i]]" "[PathFolderProject]\[NamePlugin].[Ext[i]]"

    FileExists "[PathFolderProject]\[NamePlugin].[Ext[i]]" "[Result]"
    If "[Result]" "=" "False"
        DeleteArray "[Ext]" "All"
        ClearVariables "Ext,Ext.Num,i,Result"
        Return
    EndIf
EndLoop

DeleteArray "[Ext]" "All"
ClearVariables "[Ext],[Ext.Num],[i],[Result]"

.............................................................................................
......................Изменяем необходимые файлы для плагина.................................
.............................................................................................

...................................Файл RES..................................................

.Шаблон RC файла с переменными для изменения содержимого файла RES
.(Название плагина, автор, значок и т.д.)
SetVar "[Shablon_RC_File]" "LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL[#13][#10][#13][#10]MAINICON ICON [#34][ICON][#34][#13][#10][#13][#10][#13][#10]1 VERSIONINFO[#13][#10]FILEVERSION 1,5,0,0[#13][#10]PRODUCTVERSION 1,5,0,0[#13][#10]FILEOS 0x4[#13][#10]FILETYPE 0x2[#13][#10]{[#13][#10]BLOCK [#34]StringFileInfo[#34][#13][#10]{[#13][#10]   BLOCK [#34]040904E4[#34][#13][#10]   {[#13][#10]      VALUE [#34]CompanyName[#34], [#34][CompanyName][#34][#13][#10]      VALUE [#34]FileDescription[#34], [#34]Плагин NeoBook[#34][#13][#10]      VALUE [#34]FileVersion[#34], [#34]1.5.0.0[#34][#13][#10]      VALUE [#34]InternalName[#34], [#34][NamePlugin].nbp[#34][#13][#10]      VALUE [#34]LegalCopyright[#34], [#34][CompanyName][#34][#13][#10]      VALUE [#34]LegalTrademarks[#34], [#34][CompanyName][#34][#13][#10]      VALUE [#34]OriginalFilename[#34], [#34][NamePlugin].nbp[#34][#13][#10]      VALUE [#34]ProductName[#34], [#34][NamePlugin][#34][#13][#10]      VALUE [#34]ProductVersion[#34], [#34][ProductVersion][#34][#13][#10]      VALUE [#34]Comments[#34], [#34]Плагин для программы NeoBook[#34][#13][#10]   }[#13][#10]}[#13][#10][#13][#10]BLOCK [#34]VarFileInfo[#34][#13][#10]{[#13][#10]   VALUE [#34]Translation[#34], 0x0409 0x04E4  [#13][#10]}[#13][#10]}"
.Заполняем все переменные в шаблоне
PopulateStr "[Shablon_RC_File]" "[RC_File]"
.ResourceHacker не понимает кодировку Ansi
zmConvertString "AnsiToUtf8" "[RC_File]" "[RC_File]"
.Сохраняем файл rc
FileWrite "[PathFolderProject]\[NamePlugin].rc" "All" "[RC_File]"

.Вносим с помощью Resource Hacker данные в файл [NamePlugin].res
Run "[ResHacker]" "-open [#34][PathFolderProject]\[NamePlugin].rc[#34]  -save [#34][PathFolderProject]\[NamePlugin].res[#34] -action compile -log NUL" "Wait+LoadComplete+Minimized+Hidden" "" ""

ClearVariables "[Shablon_RC_File],[RC_File]"

...................................Файл INI..................................................
.Заполняем переменную PlugInCommandlist (список разделов и команд для отображения в окне О плагине)
StrParse "[ListBoxSections]" "|" "[ListBoxSections]" "[ListBoxSectionsCount]"
Loop "1" "[ListBoxSectionsCount]" "[i]"
    If "[PlugInCommandlist]" "=" ""
        SetVar "[PlugInCommandlist]" "[ListBoxSections[i]]"
    Else
        SetVar "[PlugInCommandlist]" "[PlugInCommandlist]|[ListBoxSections[i]]"
    EndIf
    hpwReplaceRegExp "^|\|" "[Sections[i]]" "|#" "" "[Result]"
    SetVar "[PlugInCommandlist]" "[PlugInCommandlist][Result]"
EndLoop

DeleteArray "[ListBoxSections]" "All"
ClearVariables "[ListBoxSectionsCount],[i],[Result]"

.Заполняем переменную ParameterHints (список команд и их описание)
StrParse "[Actions]" "|" "[Actions]" "[ActionsCount]"
Loop "1" "[ActionsCount]" "[i]"
    FileRead "[PathFolderFunctions]\[Actions[i]]" "All" "[Function]"

    .Поиск параметров функции в файле
    hpwExecRegExpList "Param=(.*?\r)" "[Function]" "" "[Result]"
    hpwReplaceRegExp "Param=(.*?\r)" "[Result]" "${1}" "1" "[Param]"

    StrParse "[Param]" "[#13]" "[Param]" "[TotalParam]"

    If "[TotalParam]" ">" "0"
        Loop "1" "[TotalParam]" "[n]"
            StrParse "[Param[n]]" "|" "[Result]" ""
            SetVar "[Result1]" "[Actions[i]]_[n]"
            If "[ParameterHints]" "=" ""
                SetVar "[ParameterHints]" "[Result1]=[Result3]"
            Else
                SetVar "[ParameterHints]" "[ParameterHints][#13][#10][Result1]=[Result3]"
            EndIf
        EndLoop
    EndIf

    DeleteArray "[Result]" "All"
    DeleteArray "[Param]" "All"
    ClearVariables "[Result],[Param],[TotalParam],[n],[Function]"
EndLoop

SetVar "[INI]" "[#91]PlugInHeader[#93][#13][#10]PlugInHint=[Comments][#13][#10]PlugInVersion=[ProductVersion][#13][#10]PlugInPublisher=[CompanyName][#13][#10]PlugInWebSite=[LegalTrademarks][#13][#10]PlugInCommandlist=[PlugInCommandlist][#13][#10][#13][#10][#91]ParameterHints[#93][#13][#10][ParameterHints]"
FileWrite "[PathFolderProject]\[NamePlugin].ini" "All" "![INI]"

DeleteArray "[Actions]" "All"
ClearVariables "[PlugInCommandlist],[ParameterHints],[INI],[ActionsCount],[i]"

...................................Файл CFP..................................................
SetVar "[ID]" "1"
StrParse "[ListBoxSections]" "|" "[ListBoxSections]" "[ListBoxSectionsCount]"

Loop "1" "[ListBoxSectionsCount]" "[i]"
    .Записываем название разела
    If "[PlugInCommandlist]" "=" ""
        SetVar "[PlugInCommandlist]" "0|[ListBoxSections[i]]||0|0"
    Else
        SetVar "[PlugInCommandlist]" "[PlugInCommandlist][#13][#10]0|[ListBoxSections[i]]||0|0"
    EndIf

    .Получаем имена команд
    StrParse "[Sections[i]]" "|" "[Actions]" "[ActionsCount]"

    Loop "1" "[ActionsCount]" "[n]"
        FileRead "[PathFolderFunctions]\[Actions[n]]" "All" "[Function]"

        .Получаем из файла функции комментарий
        hpwExecRegExpList "Comment=(.*?\r)" "[Function]" "" "[Result]"
        hpwReplaceRegExp "Comment=(.*?\r)" "[Result]" "${1}" "1" "[Comment]"
        StrReplace "[Comment]" "|" "[#91]CRLF[#93]" "[Comment]" ""
        StrReplace "[Comment]" "[#13]" "" "[Comment]" ""
        StrReplace "[Comment]" "[#10]" "" "[Comment]" ""

        .Получаем из файла функции параметры и их колличество
        hpwExecRegExpList "Param=.*?\|(.*?)\|.*?\r" "[Function]" "[#13][#10]" "[Result]"
        hpwReplaceRegExp "Param=.*?\|(.*?)\|.*?\r" "[Result]" "${1}" "1" "[Param]"

        If "[Param]" "<>" ""
            hpwLineCount "[Param]" "[ParamCount]"
            Loop "1" "[ParamCount]" "[m]"
                hpwLine "[Param]" "[m]" "[Result]"
                ListBoxFindItem "TypeParameter" "[Result]" "[Result]"
                hpwLineReplace "[Param]" "[Result]" "[m]" "[Param]"
            EndLoop
        Else
            SetVar "[ParamCount]" "0"
        EndIf
        If "[ParamCount]" ">" "0"
            StrReplace "[Param]" "[#13][#10]" ";" "[Param]" ""
            StrLen "[Param]" "[Result]"
            StrDel "[Param]" "[Result]" "1" "[Param]"
        EndIf

        SetVar "[PlugInCommandlist]" "[PlugInCommandlist][#13][#10][ID]|[Actions[n]]|[Comment]|[Param]|[ParamCount]"
        SetVar "[ID]" "[ID]+1"
    EndLoop

EndLoop

FileWrite "[PathFolderProject]\[NamePlugin].cfp" "All" "![PlugInCommandlist]"

DeleteArray "[ListBoxSections]" "All"
DeleteArray "[Actions]" "All"

ClearVariables "[ListBoxSectionsCount],[ActionsCount],[Function],[i],[n],[m],[Result],[Comment],[Param],[ParamCount],[ID]"

...................................Файл CFR..................................................
hpwExecRegExpList "(?m)^([#91]^0[#93]\|.*?\|).*?(\|.*?\|\d)" "[PlugInCommandlist]" "[#13][#10]" "[PlugInCommandlist]"
hpwReplaceRegExp "(?m)^([#91]^0[#93]\|.*?\|).*?(\|.*?\|\d)" "[PlugInCommandlist]" "${1}${2}" "1" "[PlugInCommandlist]"
FileWrite "[PathFolderProject]\[NamePlugin].cfr" "All" "![PlugInCommandlist]"

ClearVariables "[PlugInCommandlist]"

.........................Создаем файлы команд для плагина....................................
.Список всех команд NeoBook
SetVar "[ListActionsNeoBook]" "AlertBox|ArticleJumpTo|Balloon|BringAppToFront|BrowserBack|BrowserExecScript|BrowserExport|BrowserFind|BrowserForward|BrowserGetElement|BrowserGoTo|BrowserHome|BrowserLoadFromStr|BrowserPrint|BrowserSearch|BrowserSetElement|BrowserStop|Call|ChangeFileExt|CheckInternetConnection|ClearVariables|ClickMouse|CloseApp|CloseCustomWindow|CloseWindow|ConnectToInternet|CreateFolder|CustomWindow|DateToNum|DebugBreakPoint|DefineVar|Delay|DeleteArray|DisableApp|DisableMenuItem|DisableObject|DisconnectFromInternet|DOSCommand|DownloadFile|DropFile|EnableApp|EnableMenuItem|EnableObject|ExecuteAddon|Exit|ExitLoop|ExitWhile|ExtractFile|ExtractFileDrive|ExtractFileExt|ExtractFileName|ExtractFilePath|FileCopy|FileDelLine|FileErase|FileExists|FileInsLine|FileLen|FileList|FileOpenBox|FileRead|FileSaveBox|FileSize|FileToVar|FileWrite|Find|FindFirst|FindNext|FlashBack|FlashForward|FlashGetVar|FlashGotoFrame|FlashPause|FlashPlay|FlashRewind|FlashSetVar|FlashStop|FocusObject|FolderBox|FolderExists|GetArrayInfo|GetMousePos|GetObjectHandle|GetObjectInfo|GetVolume|GetWindowPos|GIFPlay|GIFStop|GoSub|GotoFirstPage|GotoLastPage|GotoLine|GotoNextPage|GotoPage|GotoPageNum|GotoPrevPage|HelpTopic|HideMasterPage|HideMenuItem|HideObject|If|IfEx|ImageWindow|InputBox|InternetFileExists|InternetFileSize|InternetGet|InternetLink|InternetPost|IsAppRunning|ListBoxAddItem|ListBoxChangeItem|ListBoxDeleteItem|ListBoxFindItem|ListBoxGetItem|ListBoxMoveItem|ListBoxSize|ListBoxSort|LoadIcon|LoadVariables|Loop|Math|MCICommand|MediaPlayerPause|MediaPlayerPlay|MediaPlayerRewind|MediaPlayerStop|Menu|MenuEx|MessageBox|MoveObject|MoveObjectAlongPath|NumToDate|ObjectToBack|ObjectToFront|PauseSlideShow|PictureMagnify|PlayCartoonFile|PlaySoundFile|PlayTone|PlayVideoFile|PopulateStr|PopUpImage|PrintDataFile|PrintImageFile|PrintImageFileWH|PrintPage|PrintSetup|PrintTextFile|Random|RefreshObject|RegistryRead|RegistryWrite|RemoveFolder|Return|ReturnToPage|Run|RunInRectangle|RunNeoBook|SaveVariables|SearchStr|SendAppToBack|SendKeys|SendMenuCommand|SendMail|SetMousePos|SetObjectCaption|SetObjectFileName|SetObjectFill|SetObjectFont|SetObjectLine|SetPageBackground|SetPageEffect|SetPrinterOrientation|SetVar|SetVolume|SetWindowPos|ShowErrors|ShowMasterPage|ShowMenuItem|ShowObject|SizeObject|SoundBuzzer|StartSlideShow|StickyNote|StopMedia|StopMovingObject|StopSlideShow|StrDel|StrIns|StrLen|StrLower|StrParse|StrReplace|StrUpper|SubStr|Suspend|SystemInfo|SystemSound|TextWindow|TimerStart|TimerStop|TrackbarSetMax|TrackbarSetMin|While|WhileEx"

StrReplace "[Actions]" "|" "[#13]" "[Actions]" ""
hpwLineCount "[Actions]" "[ActionsCount]"

Loop "1" "[ActionsCount]" "[i]"
    hpwLine "[Actions]" "[i]" "[NameAction]"
    FileRead "[PathFolderFunctions]\[NameAction]" "All" "[Function]"

    .Поиск параметров функции в файле
    hpwExecRegExpList "Param=(.*?\r)" "[Function]" "" "[Result]"
    hpwReplaceRegExp "Param=(.*?\r)" "[Result]" "${1}" "1" "[Param]"

    StrParse "[Param]" "[#13]" "[Param]" "[TotalParam]"

    If "[TotalParam]" ">" "0"
        Loop "1" "[TotalParam]" "[n]"
            StrParse "[Param[n]]" "|" "[Result]" ""
            StrReplace "[Function]" "[Result1]" "[#91]$[NameAction]_[n][#93]" "[Function]" ""
            DeleteArray "[Result]" "All"
        EndLoop
    EndIf
   
    hpwReplaceRegExp "{.*End}(.*)" "[Function]" "${1}" "1" "[Function]"
   
    .Проверяем функцию на наличие команд NeoBook
    hpwExecRegExpBool "[#91]ListActionsNeoBook[#93]" "[Function]" "[Result]"
    If "[Result]" "=" "0"
        MessageBox "Внимание" "Функция [NameAction] не содержит команды NeoBook. Все равно хотите продолжить?." "Да|Нет" "[Result]"
        If "[Result]" "=" "2"
            Return
        EndIf
    EndIf
   
    SetVar "[Function]" ".hpwPlayMacroSource[Function]"
   
    .Зашифровать исходный код
    If "[Encode]" "<>" ""
.        hpwEncodeMacroStr "[Function]" "[Password]" "[Function]"
        hpwEncodeMacroFile "[Function]" "[Password]" "[PathFolderProject]\[NameAction].txt"
      Else
        FileWrite "[PathFolderProject]\[NameAction].txt" "All" "[Function]"
    EndIf
   

EndLoop

ClearVariables "[ListActionsNeoBook]"

...................................Вместо Файла BAT..................................................

Run "[ResHacker]" "-addoverwrite [#34][PathFolderProject]\[NamePlugin].tnbr[#34], [#34][PathFolderProject]\[NamePlugin].nbr[#34], [#34][PathFolderProject]\[NamePlugin].res[#34] , , ," "Wait+LoadComplete+Minimized" "" ""
Loop "1" "[ActionsCount]" "[i]"
    hpwLine "[Actions]" "[i]" "[NameAction]"
    Run "[ResHacker]" "-add [#34][PathFolderProject]\[NamePlugin].nbr[#34], [#34][PathFolderProject]\[NamePlugin].nbr[#34], [#34][PathFolderProject]\[NameAction].txt[#34], PluginCommands,[NameAction],0" "Wait+LoadComplete+Minimized" "" ""
EndLoop
Run "[ResHacker]" "-add [#34][PathFolderProject]\[NamePlugin].nbr[#34], [#34][PathFolderProject]\[NamePlugin].nbr[#34], [#34][PathFolderProject]\[NamePlugin].cfr[#34], PluginConfig,Config,0" "Wait+LoadComplete+Minimized" "" ""

Run "[ResHacker]" "-addoverwrite [#34][PathFolderProject]\[NamePlugin].tnbp[#34], [#34][PathFolderProject]\[NamePlugin].nbp[#34], [#34][PathFolderProject]\[NamePlugin].res[#34] , , ," "Wait+LoadComplete+Minimized" "" ""
Loop "1" "[ActionsCount]" "[i]"
    hpwLine "[Actions]" "[i]" "[NameAction]"
    Run "[ResHacker]" "-add [#34][PathFolderProject]\[NamePlugin].nbp[#34], [#34][PathFolderProject]\[NamePlugin].nbp[#34], [#34][PathFolderProject]\[NameAction].txt[#34], PluginCommands,[NameAction],0" "Wait+LoadComplete+Minimized" "" ""
EndLoop
Run "[ResHacker]" "-add [#34][PathFolderProject]\[NamePlugin].nbp[#34], [#34][PathFolderProject]\[NamePlugin].nbp[#34], [#34][PathFolderProject]\[NamePlugin].cfp[#34], PluginConfig,Config,0" "Wait+LoadComplete+Minimized" "" ""
Run "[ResHacker]" "-add [#34][PathFolderProject]\[NamePlugin].nbp[#34], [#34][PathFolderProject]\[NamePlugin].nbp[#34], [#34][PathFolderProject]\[NamePlugin].ini[#34], PluginConfig,Ini,0" "Wait+LoadComplete+Minimized" "" ""


StrReplace "[Actions]" "[#13]" "|" "[Actions]" ""

ClearVariables "ActionsCount,i,NameAction,Function,Result,Param,TotalParam,n"
DeleteArray "[Param]" "All"


If I finish, I'll lay out the whole project at our forum.
To me the main thing to understand where I not so do.
mishem
 
Posts: 575
Joined: Mon Oct 08, 2012 1:51 pm

Re: hpwPlayAction

Postby HPW » Sat Aug 26, 2017 9:53 am

I send you a PM with my mail.
Hans-Peter
User avatar
HPW
 
Posts: 2519
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

PreviousNext

Return to PlugIn Discussions

Who is online

Users browsing this forum: No registered users and 2 guests