RPTools.net

Discussion and Support

Skip to content

It is currently Sat Dec 16, 2017 12:23 am 






Reply to topic  [ 102 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7  Next

Previous topic | Next topic 

  Print view

Author Message
 Offline
Cave Troll
 
Joined: Thu Mar 21, 2013 2:29 pm
Posts: 49
Location: London, UK
 Post subject: Re: Notepad++ Maptool Text Editor config file [UPDATE: 5/31/
PostPosted: Wed Mar 27, 2013 2:57 pm 
I did a bit more fiddling, and put in some error checking and added the save routine.

Changed the hotkeys around too - I ordered it from Notepad's perspective, so F11 is "Load" (From MT to Notepad) and F12 is "Save" From notepad to MT.

Code:
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

coordmode, mouse, window
loadx = 75
loady = 70
textx = 50
texty = 150
savex = 160
savey = 70
closex = 595
closey = 10

F11::
   WinActivate, MapTool
   send {F9}
   WinWait,ahk_class SunAwtDialog, , 2
   if ErrorLevel{
      return
   }

   MouseMove, %loadx%, %loady%
   Click
   WinWait,ahk_class SunAwtDialog, , 2
   Send {Enter}
   Sleep, 1000
   MouseMove, %textx%, %texty%
   Click
   Send, ^a
   Send, ^c
   MouseMove, %closex%, %closey%
   Click
   
   WinActivate, ahk_class Notepad++
   Send, ^a
   Send, ^v
   return

F12::
   WinActivate, ahk_class Notepad++
   Send, ^a
   Send, ^c
   Send, ^z
   
   WinActivate, MapTool
   send {F9}
   WinWait,ahk_class SunAwtDialog, , 2
   if ErrorLevel{
      return
   }

   MouseMove, %textx%, %texty%
   Click
   Send, ^a
   Send, ^v
   
   MouseMove, %savex%, %savey%
   Click
   Sleep, 500

   MouseMove, %closex%, %closey%
   Click
   
   return



Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Thu Mar 21, 2013 2:29 pm
Posts: 49
Location: London, UK
 Post subject: Re: Notepad++ Maptool Text Editor config file [UPDATE: 5/31/
PostPosted: Wed Mar 27, 2013 3:07 pm 
Thinking about this some more, I had a cracking idea.

How about we set up RPEdit so that when you hit a hotkey it selects one of the lib tokens.

That way, my AHK macro could also select the correct token for editing.
I could even go so far as a lookup - it is possible to detect from AHK the file name that you have open, so if I had a lookup in the macro that said "mylib*.mt is lib:mylib", then if you hit the save macro, it knows you are editing lib:mylib, switches to MT, hits the correct hotkey to select that lib, then does the save routine.


Last edited by evilC on Wed Mar 27, 2013 3:43 pm, edited 1 time in total.

Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Thu Mar 21, 2013 2:29 pm
Posts: 49
Location: London, UK
 Post subject: Re: Notepad++ Maptool Text Editor config file [UPDATE: 5/31/
PostPosted: Wed Mar 27, 2013 3:26 pm 
actually, scrub that, I have just sussed the ultimate way.

Set up ONE hotkey in MT (ideally as part of RPEdit). When you hit this hotkey, a dialog pops up asking you to type which library you want to select into a textbox.

When you hit Load/Save in my macro, it looks at the file name and compares that to a config file which tells it what library you are editing. It then hits the MT hotkey, fills the name of the library in the box, waits a bit for MT to select the token, then initiates the current save / load routine.


Last edited by evilC on Wed Mar 27, 2013 3:44 pm, edited 1 time in total.

Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Thu Mar 21, 2013 2:29 pm
Posts: 49
Location: London, UK
 Post subject: Re: Notepad++ Maptool Text Editor config file [UPDATE: 5/31/
PostPosted: Wed Mar 27, 2013 3:40 pm 
Heh, sorry for the spam, but I started thinking through the possibilities of this a little more.

Autohotkey can read the contents of the clipboard. So when you copy from Notepad to MT, it would be quite possible to have it remove everything between /* and */ - in other words, proper comment support for MT!

Obviously, if you copied back "out" of MT and into notepad, you would lose your comments, but seeing as I am thinking of moving to .mt files in notepad as the "Master" and using a VCS, this should not be a problem.

Useful if nothing else for temporarily commenting out problem blocks of code.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7967
Location: Bay Area
 Post subject: Re: Notepad++ Maptool Text Editor config file [UPDATE: 5/31/
PostPosted: Wed Mar 27, 2013 4:40 pm 
Hmm, I'm trying to figure if this is any easier than hitting ctrl-alt-c, ctrl-v and clicking save.

As for comments, I thought of doing that within RPEdit. Basically, when you save code to the macros it would pull out all the comments and save them on the token and when exporting, put them back. But if someone modifies the macro code with in MT, there's no guaranty the comments would go back in the right place. The proper solution would be to have the macroscript have comment parsing. In coldfusion, they use <!--- ---> basically adding another dash to html comments.

I think if I tweaked RPEdit a bit to have an input only frame it may work better with autokey, but if autokey can detect submit buttons and read the correct one, that wouldn't be an issue.

My coding process usually goes like this:
write a bunch of code until I get the point I can test something, copy all and paste in to rpedit. Then I either update one macro at a time in notepad++ doing the ctrl-alt-C copy and paste or if I updated a bunch at once, just copy all and paste. I don't use the load option in rpedit very often and when I do, I just load all.

I'm not sure I'm sold that a hotkey makes this process easier.

_________________
Downloads:


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Thu Mar 21, 2013 2:29 pm
Posts: 49
Location: London, UK
 Post subject: Re: Notepad++ Maptool Text Editor config file [UPDATE: 5/31/
PostPosted: Wed Mar 27, 2013 4:55 pm 
So you do not see the point of being able to hit F12 in notepad, and within 2 seconds you have tabbed into maptool, automatically selected the correct library token, opened the RPEdit interface, stripped // and /* */ style comments from your code, pasted it into the RPEdit window, hit Save, closed the RPEdit window and then reselected the token that was previously selected?


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7967
Location: Bay Area
 Post subject: Re: Notepad++ Maptool Text Editor config file [UPDATE: 5/31/
PostPosted: Wed Mar 27, 2013 5:04 pm 
If I had to do that each time, then that could be useful. I usually just do what I mentioned above. I have a frame open for the lib needed. I rarely work on 2 libs at once. I'm also skeptical of "automatically selected the correct library token" and "reselected the token that was previously selected" seeing how current layer and map will be an issue for this. I'm not trying to put your idea down. I just don't think it's something I'm interested in doing, but if you can get it to work to your satisfaction, then I'll gladly add to this forum.

_________________
Downloads:


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Thu Mar 21, 2013 2:29 pm
Posts: 49
Location: London, UK
 Post subject: Re: Notepad++ Maptool Text Editor config file [UPDATE: 5/31/
PostPosted: Wed Mar 27, 2013 5:24 pm 
I hear you, but I think that is more a factor of necessity. Even with RPEdit, I found myself using the MT editor because I could not be bothered to copy and paste again - it was quicker to make the edit inside MT.

Can you confirm that with RPEdit, if a code from a newer version of the lib gets pasted in, are all the new buttons created OK etc - is it "safe"?

Also, does the text exported by RPEdit include everything for a Library? All settings, properties etc?

Finally, if whilst inside notepad, I copied and pasted a new macro (giving it a new name obviously), when I paste it back in via RPEdit, is that a safe way of creating a macro?

I see what you are saying about finding the token and I had considered that. It would be trivial to circumvent though - MT remembers where you are on a map, so you can easily automate switching to the correct map, selecting the lib token, doing the copy/paste then switching back to the map you were on.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7967
Location: Bay Area
 Post subject: Re: Notepad++ Maptool Text Editor config file [UPDATE: 5/31/
PostPosted: Wed Mar 27, 2013 5:34 pm 
Quote:
Can you confirm that with RPEdit, if a code from a newer version of the lib gets pasted in, are all the new buttons created OK etc - is it "safe"?

Button specific data is in the @PROPS@ line. I have defaults set when not specified so, if you want to only set button color, you would only need to specify that. Putting nothing for an existing button doesn't change any button settings but does update the code.

Quote:
Also, does the text exported by RPEdit include everything for a Library? All settings, properties etc?

Yes, under PROPS.

Quote:
Finally, if whilst inside notepad, I copied and pasted a new macro (giving it a new name obviously), when I paste it back in via RPEdit, is that a safe way of creating a macro?

Yes and that's how I create all my macros. I just start typing in notepad and paste in to rpedit when done. I don't worry about button colors and groups until I have a significant number of macros. Then I do a export and rewrite all my code in np++ to get the PROPS added.

As I mentioned before, I don't do much loading from MT, unless I load all.

edit: There is one thing to look out for. Buried somewhere in the rpedit thread it mentions that you can't use &#59 in your code (;) because of how MT does form submits. The way around that is do this "&#"+59. Also, don't edit the macros directly when you have the lib frame open because of the macro indexing. Macros updated get new indexes and will differ from the rpedit saved settings. But if you do, you can close and reopen or hit refresh button.

There are a couple of upgrade to rpedit I thought of that would make things easier, but I hop project to project as it is. Today I'll be finishing up an upgrade to Plothos's spell manager adding DC checks and other info along with altered output and skill roll automation for use with the 3.5/Pathfinder framework.

_________________
Downloads:


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Thu Mar 21, 2013 2:29 pm
Posts: 49
Location: London, UK
 Post subject: Re: Notepad++ Maptool Text Editor config file [UPDATE: 5/31/
PostPosted: Wed Mar 27, 2013 6:28 pm 
You mean do not have the text "&#59" in the source code? I don't think I will be doing that in a hurry (Maybe when I get on to HTML and forms?), but thanks for the heads up.

I have been working more on this workflow automation, and I have hit upon a brilliant technique that I thought I would share.

To tighten integration, when Autohotkey hits a button to trigger a macro in MT, it is actually possible to get MT to "return" values to AHK.
Simply use input to pop up a dialog with the return value as the default value, and it is ready selected for you! Just have AHK hit ctrl-c, and inspect the clipboard and it has it's return value :)

So for example, AHK hits F5 to select a map. MT pops up an input, ahk types the name of the map and sends enter. MT pops up another dialog with the default value "map found". AHK hits ctrl-c, reads the clipboard and knows MT found the map.
Neat eh? ;)


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Thu Mar 21, 2013 2:29 pm
Posts: 49
Location: London, UK
 Post subject: Re: Notepad++ Maptool Text Editor config file [UPDATE: 5/31/
PostPosted: Thu Mar 28, 2013 12:32 am 
Initial release of my automated conduit:

viewtopic.php?f=6&t=23456&p=238894#p238894


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7967
Location: Bay Area
 Post subject: Re: Notepad++ Maptool Text Editor config file [UPDATE: 5/31/
PostPosted: Thu Mar 28, 2013 1:50 am 
I'll check it out. I assume it saves the whole file, correct? I'm working with a file that has 13000+ lines and it takes a bit to save the whole thing to the token. Think you can do the same thing for a single macro from NP++? Right now, I just keep track of the functions by collapsing all unused ones in NP++ and bookmarking the ones I modify.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9427
Location: Netherlands
 Post subject: Re: Notepad++ Maptool Text Editor config file [UPDATE: 5/31/
PostPosted: Thu Mar 28, 2013 3:02 am 
Interesting development, curious to try it out.

aliasmask wrote:
I'll check it out. I assume it saves the whole file, correct? I'm working with a file that has 13000+ lines and it takes a bit to save the whole thing to the token. Think you can do the same thing for a single macro from NP++? Right now, I just keep track of the functions by collapsing all unused ones in NP++ and bookmarking the ones I modify.


Agreed. Im currently at 21,000+ lines (1.1+ million characters) for one lib and its a bit 'boggish' to throw the lot to and fro.

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS


Top
 Profile  
 
 Offline
Kobold
 
Joined: Wed Oct 19, 2011 4:46 pm
Posts: 12
 Post subject: Re: Notepad++ Maptool Text Editor config file [UPDATE: 5/31/
PostPosted: Mon May 20, 2013 10:38 am 
maptool.xml is not available anymore, if you could upload it once again please.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7967
Location: Bay Area
 Post subject: Re: Notepad++ Maptool Text Editor config file [UPDATE: 5/31/
PostPosted: Mon May 20, 2013 11:35 am 
reonZ wrote:
maptool.xml is not available anymore, if you could upload it once again please.

I haven't edited that page for awhile now, but the closer we get to the end of 1.3 I will make a final revision. The OP has a zip file with all the required files including maptool.xml.

_________________
Downloads:


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 102 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7  Next

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there are 3 users online :: 1 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: Bing [Bot] and 2 guests





cron

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman