Miranda NG Official Community Forum

Forum for English speaking Miranda NG users => Miranda NG general talk => Topic started by: Octopuss on 14 09 2014, 18:11:08

Title: Tipper variables
Post by: Octopuss on 14 09 2014, 18:11:08
Where can I find a list of variables useable in Tipper? I'm pretty lost here. I can't think of any way to figure this out. The wiki page for Tipper also mentions some ini file which is "in the same folder as this document", but that text doesn't make any sense.
Title: Re: Tipper variables
Post by: Wishmaster on 14 09 2014, 18:23:21
They are listed on the Wiki page:
Quote from:  http://wiki.miranda-ng.org/index.php?title=Plugin:Tipper/en

Were name can be any of the following:
Below is a list of all variables. E.g. %sys:uid%.
Title: Re: Tipper variables
Post by: Octopuss on 14 09 2014, 18:27:10
I saw that, but that's really all I can use? I am sure there was a ton more stuff in Miranda IM. I have no idea how I got it there after the years.
Or maybe it's not related to Tipper? Either way, I am completely lost and clueless.
Also, for example I had this in IM: %logon_time% (%logon_ago% ago). It doesn't work here and I have no idea why.
Title: Re: Tipper variables
Post by: Wishmaster on 14 09 2014, 18:45:12
Well, you would have to create a substitution called login_time and login_ago in the substitution list. You can basically read any database setting and comnvert them in a textual format (thats what substitutions do).

See wiki:
Substitutions allow you to put useful contact-related information into the label or value of an item. To create a substitution you need to have a relatively good understanding of the Miranda database – a few hours browsing with DbEditor++ will give you a clue. You create a substitution by specifying a name and the database module and setting names for the data it will contain. You can then put this data into any item (label or value) by enclosing the substitution name in "%" symbols. Many database values are not terribly friendly to humans, so when creating a substitution, you can also choose a translation which will convert the value into a more readable format.

To get technical:
A "substitution" is a name for a database value, represented according to a particular translation. When creating new substitutions, you specify its name, the database module (or the contact's protocol module) and the setting name. Then you select a translation from the drop down list. This transformation will convert the database value into a string.

An "item" is just a label and a value. However, any substitution names (surrounded by % symbols) occuring in either a label or a value will be substituted as described above. If you want to put a % symbol in a value or label, use "%%" instead.

The easiest way is probably to click on new item and select one of the preset items in the dropdown below. It will create all needed substitutions for you, and you can alter them yourself..
Title: Re: Tipper variables
Post by: Octopuss on 14 09 2014, 18:55:42
Ew, that's probably beyond me. I don't understand a bloody thing in the database editor, and the cryptic programming stuff that jumps up in the substitutions dropdown menu doesn't help it much.
I understand the concept, but I don't undertstand how to get the values from the database. There's a ton of entries and I don't know where to look. I tried to search for "login", and didn't get any results :(
Title: Re: Tipper variables
Post by: Wishmaster on 14 09 2014, 19:02:08
Well, for a start you can use the preset items. Click on new substitution and choose a preset from the dropdown.
Title: Re: Tipper variables
Post by: Octopuss on 14 09 2014, 19:04:41
But there are no presets there at all... Just "translations", which I have no idea what is.
Title: Re: Tipper variables
Post by: watcher on 14 09 2014, 19:15:46

Title: Re: Tipper variables
Post by: Octopuss on 14 09 2014, 19:20:58
But he was talking about the dropdown menu for a new substitution, not this.
Anyway, this is not helping me at all either, there's nothing for the login time at all.

I am obviously still missing something.
Title: Re: Tipper variables
Post by: Robyer on 14 09 2014, 19:41:37
TL;DR: you can download Tipper archive from IM addons (http://addons.miranda-im.org/details.php?action=viewfile&id=3717) inside which is in folder "docs" file autoexec_tipper_items_eng.ini, which contains predefined settings and you can import this into your database (just put that file next to miranda32.exe and after restart it should ask you about import, or do it manually through DBEditor++)
How Tipper works? You should understand that from readme, but here is my explanation:
1) You can show in tipper any value from database or one of special (system) values (e.g. which aren't saved in database and are computed at runtime).
2) If you want value from Database, you must know what NAME and TYPE has value you want. And also in which "branch" (or "folder") it is saved. To find out, you can browse all settings via DBEditor++ and look what you might find useful.
3) If TYPE of value is not simple (it's not just number or string, but e.g. datetime) but it has special meaning, you can't just show its "raw" value, but you need to use SUBSTITUTION. That simply tells how that value should be showed (e.g. as date and time) and then you can use name of this substitution in item setting.

How to write it?
a) %sys:xxx% - special (system) value, xxx is one of predefined
b) %raw:xxx% - raw value from DB, xxx is name of value in db, usually with / at the beginning, like.  %raw:/FirstName% which means it is taken from protocol "branch" of that contact. If it's Facebook contact, it will take value "Facebook/FirstName" of that contact automatically. So it's universal (doesn't depend on protocol or accounts's internal name).
c) %xxx% - substitution, xxx is your name of substitution

How to define substitution?
1) You need to set name, this is needed for using it (see point (c))
2) "Module" which is that "branch" in database. If you want protocol branch (that's most likely; as mentioned in (b)), then check "Protocol module".
3) Setting name - that's the name of setting you want to use in substitution
4) Substitution type - how that value should be showed? As datetime, status, etc.

Was this enough explanation or do you need something more? :)
Title: Re: Tipper variables
Post by: Octopuss on 14 09 2014, 19:43:02
Thanks! I didn't know anything from the IM site was compatible with NG.
I'll see if this helps.
Title: Re: Tipper variables
Post by: Robyer on 14 09 2014, 19:46:55
Many things (sounds, skins, icons, plugin settings, etc.) are still compatible (or might be, depending on version). Only DLL plugin files are now always incompatible :-)