I have a few custom "Run" commands that I use to make scripting a bit smoother. One of my tricks started with Yami and I modified it for my situation.
Steps to add custom commands:
- Run > Run... (F5 by default I think).
- Paste the code into the "Type your program to run here" text box.
- Click Save...
- Name the function and optionally change the shortcut key combination (this can be done at a later time through Settings > Shorcut Mapper > Run Commands).
- Hit OK to save the command.
- Hit Cancel to exit the Run... dialog.
Compile:
This command will compile the active file
- - Use this when working within a AMX Mod X installation (i.e. working in the amxmodx/scripting/ folder).
- Compiles and outputs .amxx file to amxmodx/plugins/ folder.
- Uses the compiler that is adjacent to it.
- If the .amxx file already exists it WILL OVERWRITE it.
Code:
cmd /k ""$(CURRENT_DIRECTORY)\amxxpc.exe" -o"$(CURRENT_DIRECTORY)\..\plugins\$(NAME_PART).amxx" "$(FULL_CURRENT_PATH)""
- Generic:
Code:
cmd /k ""C:\path\to\compiler\folder\amxxpc.exe" -o"C:\path\to\output\folder\$(NAME_PART).amxx" "$(FULL_CURRENT_PATH)""
- Insert the compiler folder path and the output folder path as noted in the command.
- Remove -o"..." argument if you would like to compile to the default location.
- A batch file for comiling and duplicating (needed due to run command length limit). Uses the Generic method above.
Code:
@echo off
REM Name this file "compile_and_duplicate.bat" and put it in your scripting folder.
REM Notepad++ command below
REM cmd /k "$(CURRENT_DIRECTORY)\compile_and_duplicate "$(NAME_PART)" "$(FULL_CURRENT_PATH)""
REM Set folder paths here:
SET compiler_folder=C:\trashme\scripting
SET plugin_folder=C:\trashme\plugins
SET duplicate_folder=C:\trashme\other
SET name_part=%1
SET full_current_path=%2
:: Remove quotes
SET name_part=###%name_part%###
SET name_part=%name_part:"###=%
SET name_part=%name_part:###"=%
SET name_part=%name_part:###=%
:: Remove quotes
SET full_current_path=###%full_current_path%###
SET full_current_path=%full_current_path:"###=%
SET full_current_path=%full_current_path:###"=%
SET full_current_path=%full_current_path:###=%
REM Compile
%compiler_folder%\amxxpc.exe -o"%plugin_folder%\%name_part%.amxx" "%full_current_path%"
REM Duplicate to duplicate_folder
COPY "%plugin_folder%\%name_part%.amxx" "%duplicate_folder%\%name_part%.amxx"
Keyword search:
This will search the funcwiki at amxmodx.org for the word that is closest to your cursor (will highlight the whole word when command is executed). If you highlight a group of characters it will search for the highlighted sequence of characters literally.
Code:
http://www.amxmodx.org/funcwiki.php?search=$(CURRENT_WORD)&go=search
Post other Notepad++ tips or tricks here.
See Also:
Notepad++ Syntax highlighting for AMX Mod X (CS or DOD).
For question regarding Notepad++ not posted here, see the NpWiki++ first.
__________________