Howto: Sync profiles using dropbox

Spinner
Posts: 1
Joined: Fri Aug 26, 2016 12:11 pm

Syncing between Windows and Mac

Post by Spinner » Fri Aug 26, 2016 12:14 pm

I would like to sync my profile between Windows 10 and Mac OS X el capitan. Any suggestions? At the moment I'm just using profile export and import but that requires tons of clicking and fiddling.

lunloon
Posts: 9
Joined: Mon Feb 06, 2017 4:55 am

Re: Howto: Sync profiles using dropbox

Post by lunloon » Mon Feb 13, 2017 1:35 pm

I have synced my profiles across 2 computer over dropbox.
Triggers, scripts and aliases are ok.
When i checked my variables, they are not synced. They worked nicely on computer 1 but it's not there in computer 2. Everything else is, including the triggers in which I made some Lua script which set some global variables.
These variables did not get synced on computer 2.
Anyone experienced this before?

User avatar
Vadi
Posts: 4462
Joined: Sat Mar 14, 2009 3:13 pm

Re: Howto: Sync profiles using dropbox

Post by Vadi » Tue Feb 14, 2017 8:33 pm

Variables are temporary things that get created when Mudlet starts. If you'd like it to be permanent, make a script that does:

variable = "something"

That way it'll get created everytime and since your script will be synced, so will be the variable.

User avatar
SlySven
Posts: 805
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Howto: Sync profiles using dropbox

Post by SlySven » Tue Feb 14, 2017 8:48 pm

If you are sharing the same "save" file (the ones with a date and time as the filename stored in the HOMEDIRECTORY/.config/mudlet/<profileName>/current/ sub-directory) between the two machines/OSs {perhaps your HOMEDIRECTORY/.config/mudlet directory is a network share(different machines) / symlink (multi-boot OS on the same machine)} that is writeable - then variables can be marked to be "saved" with the rest of the profile data between sessions if you bring up the "Variables" display and click on the check-boxes against the variables/tables in the tree on the left side for the required table/variables to be saved!

Also, a new feature for the recent release 3.0 previews / development branches is that you can now store data in a "Map" user area in a map file so if you are sharing and updating a map between those different PCs that might be another solution to storing variables.

lunloon
Posts: 9
Joined: Mon Feb 06, 2017 4:55 am

Re: Howto: Sync profiles using dropbox

Post by lunloon » Wed Feb 15, 2017 5:28 am

Edited: The more i think about it the more confused i became.

So essentially getmudhomedir() should be the same on any machine as long as the mudlet on each machine has mklink the .config to the one on dropbox. i want to make a table and save it using getmudhomedir() (pardon the no caps for now).

Also, the variables i set in Variables should be ticked to get them saved in the profile (if i am not able to make the table). But it seems that mudlet does not load the variables on startup. Do I have to make a script to do that?

I'm sorry I am very confused.

lunloon
Posts: 9
Joined: Mon Feb 06, 2017 4:55 am

Re: Howto: Sync profiles using dropbox

Post by lunloon » Wed Feb 15, 2017 11:39 am

So I redid the table in Variables, forced a table.save on one of the triggers, and now there's a file in the profile which i got a script to table.load when mudlet starts up. Hope this is correct.
Going to check the other computer tomorrow.

gimpel
Posts: 1
Joined: Thu Nov 16, 2017 9:38 pm

Re: Howto: Sync profiles using dropbox

Post by gimpel » Thu Nov 16, 2017 9:48 pm

I have a question, and perhaps an answer for Spinner.

I am syncing between a Mac and PC. For years I did this manually, emailing myself the .xml file to import, such that each machine had their own mostly unique profile. The problem came when I would code something and forget which machine I coded it on. So... now I sync them. Each of them have different sized monitors, and require different control keys as well. To accommodate this I have taken every script/alias/trigger/key that is unique to each machine, and created a new profile that has both. I then deactivate the PC stuffs, when I'm on the MAC, and vice versa. It actually works! I hope that helps.

HERE is the question:
-In mudlet2 when I sync the files, it seems that neither the mac nor the pc properly takes the proper ...current/*.xml file. It always thinks the current one is whatever previous one it had. I have to manually tell mudlet to choose the most recent date of the save file. Only, when I do, it doesn't always grab the most current one. (I test this by adding new triggers).

I have no idea why this is. If anyone can help me out here.

My working solution right now is this:
When I run the sync between the two computers, I then run a script afterwards that eliminates all but the most recent .xml save file. (it moves it to a different location).

When I do this, mudlet works fine. But I know this is a bit of a hack and am wondering if anyone out there has a better idea.

here's the mac side script I run:

<pre>
#!/bin/sh

profcurrentdir=/Users/me/.config/mudlet/profiles/CHARNAME/current

cd $profcurrentdir
mostcurrfile=`ls *.xml|tail -n 1`
movedir=/Users/me/.config/mudlet/profiles/CHARNAME/aa_oldprofiles/

mostcurrfile=`ls *.xml |tail -n 1`

#find the most current file, then copy all the OTHER files into a directory
find ./ -maxdepth 1 -mindepth 1 -not -name $mostcurrfile -print|xargs -I {} mv {} $movedir
</pre>

User avatar
Vadi
Posts: 4462
Joined: Sat Mar 14, 2009 3:13 pm

Re: Howto: Sync profiles using dropbox

Post by Vadi » Fri Nov 17, 2017 4:29 pm

Mudlet sorts the files by the last modified timestamp and loads that in. I guess Dropbox is not syncing it in order and this is where it would be good if Mudlet actually read the timestamps in the file.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests