Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Realm Works Forums > Realm Works Discussion

Notices

Reply
 
Thread Tools Display Modes
Kathorus
Member
 
Join Date: Jan 2013
Posts: 61

Old October 8th, 2016, 06:15 AM
One of the methods of data entry that is suggested for Realm Works is to put in the "Skeleton" of the data so that linking is enabled from the get-go. This could be a lot of clicking for a deep topic, such as spells from the 5e SRD, cities from a world, monsters, weapons, etc.... I still don't think there's a method for add multiple topics at once in the program, so I hacked this together, which basically takes a list of things from one place and makes them a list of topics in Realm Works.

First, the main workhorse for this is AutoHotKeys, which is a robust scripting program that I'm using to handle Windows. (if you're not familiar with it, I suggest reading through the extensive help file)
Second, you need a text editor that has macro ability, I use Notepad++. (again, if you're unfamiliar with the macro functionality, it pays to look it over)
And, of course, Realm Works.

Part 1 - Data prep and macro creation
We need a list of spells, I found an excel sheet with the spell names and pasted those into Notepad++, the important thing is that each topic you wish to create should be on one line in the file.

Next, I created a macro in Notepad++ that does;
'bring me to the top - Ctrl+Home
'select my first line - Shift+End
'cut me to the clipboard - Shift+Delete
'remove my empty line - Delete

I save this marco and give it a keystroke combination.

Part 2 - AutoHotKeys
We need to be able to go to Notepad++, run our macro on our spell list and then go into Realm Works, create a new Topic, paste the spell from the clipboard

First, create a script as explained in AutoHotKeys documentation
Next, Paste this in (the number next to Loop is the number of items in your list)
Code:
Loop, 10 {
		WinActivate, ahk_exe notepad++.exe ; Activate Notepad++ instance
		WinWaitActive, ahk_exe notepad++.exe ; Wait until Notepad++ is active
		Send !^+C ; Send Keystroke for Macro
		Sleep, 1000 ; Sleep for a second			
		WinActivate, ahk_exe RealmWorks.exe ; Activate RealmWorks
		WinWaitActive, ahk_exe RealmWorks.exe ; Wait until RealmWorks is active
		Send ^q^v{Enter} ; Keystrokes to Create Topic, Paste Clipboard, Save Topic 
		Sleep, 1000 ; Sleep for a second
	}
Part 3 - Setup
The script assumes both Notepad++ and Realm Works are open.
In Notepad++, your list should be on the tab with focus.
In Realm Works, you should manually go in and create a new topic under the category you're adding to so that future visits for the script are pointing at the correct category.
Set the number in the Loop to the number of items in your list (I would test a few, prior to running a large list).
Right-Click the script and "Run Script".
Wait a few minutes.

Hope this can be of some use to folks. I can try to answer questions about it, but stuff like this I typically throw together quickly by trial and error.
Kathorus is offline   #1 Reply With Quote
AEIOU
Senior Member
 
Join Date: Jan 2012
Posts: 1,147

Old October 8th, 2016, 08:25 AM
Oh, to be able to parse a spreadsheet or comma delimited file to fill in multiple sections quickly.... Maybe someday.

In the meantime, this is a great step in the right direction. Thank you for the step-by-step. Very useful!

• Report RealmWorks bugs here
• Report Pathfinder HeroLab bugs here
• Report 5e HeroLab bugs here
• Report 5e HeroLab Community Pack bugs here
AEIOU is offline   #2 Reply With Quote
Kathorus
Member
 
Join Date: Jan 2013
Posts: 61

Old October 9th, 2016, 03:11 AM
It looks highly possible to be able to set up scripts that would enter all the data into a topic, but you'd have to know exact keystrokes and have the data formatted, it'd be very tedious to setup.
Kathorus is offline   #3 Reply With Quote
MNBlockHead
Senior Member
 
Join Date: Dec 2014
Location: Twin Cities Area, MN, USA
Posts: 1,322

Old October 9th, 2016, 09:24 PM
Nice! I use PhraseExpress to automate a number of things in RW and to create keyboard shortcuts where none exist. I have done anything like this yet. Might be nice for Monster lists. Thanks for the walkthrough!

RW Project: Dungeons & Dragons 5th edition homebrew world
Other Tools: CampaignCartographer, Cityographer, Dungeonographer, Evernote
MNBlockHead is offline   #4 Reply With Quote
Kathorus
Member
 
Join Date: Jan 2013
Posts: 61

Old October 10th, 2016, 06:18 AM
Yeah, I used it for entering spells and monsters from text lists from the 5e SRD, so about 800 items, took about 20 minutes. Part of that time is that I have sleep steps between application changes and that gives it time to catch up, without those, the script was copy/pasting quicker than the switch, I choose a second, but didn't test anything quicker and it might work with a smaller interval.

For in application stuff, I have a Logitech G15 that I program keystrokes into for highly repetitive tasks or to setup hotkeys.
Kathorus is offline   #5 Reply With Quote
Exmortis
Senior Member
 
Join Date: Sep 2012
Location: Ottawa, Canada
Posts: 776

Old October 10th, 2016, 01:43 PM
Quote:
Originally Posted by Kathorus View Post
One of the methods of data entry that is suggested for Realm Works is to put in the "Skeleton" of the data so that linking is enabled from the get-go. This could be a lot of clicking for a deep topic, such as spells from the 5e SRD, cities from a world, monsters, weapons, etc.... I still don't think there's a method for add multiple topics at once in the program, so I hacked this together, which basically takes a list of things from one place and makes them a list of topics in Realm Works.

First, the main workhorse for this is AutoHotKeys, which is a robust scripting program that I'm using to handle Windows. (if you're not familiar with it, I suggest reading through the extensive help file)
Second, you need a text editor that has macro ability, I use Notepad++. (again, if you're unfamiliar with the macro functionality, it pays to look it over)
And, of course, Realm Works.

Part 1 - Data prep and macro creation
We need a list of spells, I found an excel sheet with the spell names and pasted those into Notepad++, the important thing is that each topic you wish to create should be on one line in the file.

Next, I created a macro in Notepad++ that does;
'bring me to the top - Ctrl+Home
'select my first line - Shift+End
'cut me to the clipboard - Shift+Delete
'remove my empty line - Delete

I save this marco and give it a keystroke combination.

Part 2 - AutoHotKeys
We need to be able to go to Notepad++, run our macro on our spell list and then go into Realm Works, create a new Topic, paste the spell from the clipboard

First, create a script as explained in AutoHotKeys documentation
Next, Paste this in (the number next to Loop is the number of items in your list)
Code:
Loop, 10 {
		WinActivate, ahk_exe notepad++.exe ; Activate Notepad++ instance
		WinWaitActive, ahk_exe notepad++.exe ; Wait until Notepad++ is active
		Send !^+C ; Send Keystroke for Macro
		Sleep, 1000 ; Sleep for a second			
		WinActivate, ahk_exe RealmWorks.exe ; Activate RealmWorks
		WinWaitActive, ahk_exe RealmWorks.exe ; Wait until RealmWorks is active
		Send ^q^v{Enter} ; Keystrokes to Create Topic, Paste Clipboard, Save Topic 
		Sleep, 1000 ; Sleep for a second
	}
Part 3 - Setup
The script assumes both Notepad++ and Realm Works are open.
In Notepad++, your list should be on the tab with focus.
In Realm Works, you should manually go in and create a new topic under the category you're adding to so that future visits for the script are pointing at the correct category.
Set the number in the Loop to the number of items in your list (I would test a few, prior to running a large list).
Right-Click the script and "Run Script".
Wait a few minutes.

Hope this can be of some use to folks. I can try to answer questions about it, but stuff like this I typically throw together quickly by trial and error.
WOW are you kidding me?

That's awesome!

Exmortis aka "Scott"
RW - Needs Rez spell
HL - Game Master/Designer
RPG Tools - Campaign Cartographer 3+, D20 Pro Ultimate
Real Life - IT Security
Hobby - Anything on water or ATV
Exmortis is offline   #6 Reply With Quote
Zaphod Beebledoc
Senior Member
 
Join Date: May 2013
Location: Birmingham, UK
Posts: 459

Old October 10th, 2016, 03:28 PM
Would you be able to create a bunch of Tags do you think?

Sleet was enjoying a tasty beverage at his local tavern, when a Tarrasque showed up in the local area. He managed to valiantly get on it's back and ride it. How he did it is a mystery to this day...

RW: Engine Heart, I Love The Corps! Home Brew: Star Gate: Avalon, Monda Minutia. I'm good with: OpenOffice, Paint, Lego Digital Designer. & not so good with: Realm Works, Hero Lab, CC3+, GIMP, Cityographer, Hexographer, Fractal Mapper, AstroSynth, Inspiration Pad Pro. RW Kickstarter Supporter.
Zaphod Beebledoc is offline   #7 Reply With Quote
Kathorus
Member
 
Join Date: Jan 2013
Posts: 61

Old October 10th, 2016, 03:54 PM
Yeah, it'd be similar, once the tag is open go back into the list, copying the next item, return to Realm Works, paste, determine the keystrokes to hit the "add" button. With a little messing around might even be able to script multiple tag lists. Sounds useful to me already, I'll poke around today or tomorrow and see what's quickly possible.
Kathorus is offline   #8 Reply With Quote
Kathorus
Member
 
Join Date: Jan 2013
Posts: 61

Old October 10th, 2016, 06:21 PM
Or, AutoHotKeys seems to be very well designed. I was able to setup a simple text file with a list of items. I then went into Realm Works made a new Tag group, Clicked the "add tag" button and run the following script, it will bring focus back to Realm Works and process through the list.
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.

WinActivate, ahk_exe RealmWorks.exe ; Activate RealmWorks
WinWaitActive, ahk_exe RealmWorks.exe ; Wait until RealmWorks is active
Loop, Read, Sample.txt ; Sample.txt needs to be in the directory that the script runs from.
{
	clipboard = %A_LoopReadLine% ; load the current line into the window's clipboard
	Send ^v {Return}	; paste the contents of the clipboard into the testbox and press Enter
}

Which means that a similar script could be created for the topics, there is also some built in parsing in AutoHotKeys that would allow delimited files to be used to enter snippets into the topics, but you'd have to have that planned out well.

Last edited by Kathorus; October 10th, 2016 at 06:29 PM. Reason: additional thoughts
Kathorus is offline   #9 Reply With Quote
Kathorus
Member
 
Join Date: Jan 2013
Posts: 61

Old October 11th, 2016, 04:57 AM
Quote:
Originally Posted by Exmortis View Post
WOW are you kidding me?

That's awesome!
Glad you like it.
Kathorus is offline   #10 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 01:17 AM.


Powered by vBulletin® - Copyright ©2000 - 2021, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.