Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow returning a string as expression #73

Open
Adrriii opened this issue Dec 30, 2020 · 258 comments
Open

Allow returning a string as expression #73

Adrriii opened this issue Dec 30, 2020 · 258 comments

Comments

@Adrriii
Copy link

Adrriii commented Dec 30, 2020

Basically the idea is to print text conditionnaly, for example :
${if(n300+n200+n100+n50+nmiss,'X','')}

Prints X when still having full marvelous and nothing when you hit something else.
If there's a workaround for this i'm also all ears

@Adrriii
Copy link
Author

Adrriii commented Dec 30, 2020

My current workaround involves creating a custom font and using numbers to display the desired string, and 0 for an empty string.

https://i.imgur.com/PuNy9ZD.png

@Someone999
Copy link
Contributor

Someone999 commented Mar 18, 2021

If you only need string output like image under it, I had made it. But I am not a developer of Sync. I will contact developers to add this.
image

@imsuck
Copy link

imsuck commented Aug 17, 2021

If you only need string output like image under it, I had made it. But I am not a developer of Sync. I will contact developers to add this.
image

Yes please

@Someone999
Copy link
Contributor

I regret to tell you, this project has not been updated for a long time. I don't know will it update.
Although my plugin has this function, but my plugin can not support the complex function express like
sin(sin(x)+1)
The +1 in the express can not be parse correctly.

@Someone999
Copy link
Contributor

If you need, I will update my project at
osuTools
My plugin named InfoReader will be packed with osuTools in a archive.

@imsuck
Copy link

imsuck commented Aug 17, 2021

I regret to tell you, this project has not been updated for a long time. I don't know will it update.
Although my plugin has this function, but my plugin can not support the complex function express like
sin(sin(x)+1)
The +1 in the express can not be parse correctly.

Alright I just want to show my score grades but I guess I'll have to wait

@Someone999
Copy link
Contributor

I tried to add the author of this plugin as friend in the past. But he refused this request.

@Someone999
Copy link
Contributor

Someone999 commented Aug 17, 2021

And some issues I commited for so long time ago have not been handled by anyone.

@Someone999
Copy link
Contributor

It seems like this project has been abandoned, or they are really busy in this time.

@Someone999
Copy link
Contributor

By the way, I think the variables they provided are too few.

@Someone999
Copy link
Contributor

image
I provided socre grade as a variable.

@imsuck
Copy link

imsuck commented Aug 17, 2021

image
I provided socre grade as a variable.

nice

@imsuck
Copy link

imsuck commented Aug 17, 2021

I tried this
SS:${if(n300+1>n300+n100+n50+nmiss,1,0)@0} S:${if((n300/(n300+n100+n50+nmiss)>0.9),if(n50/(n300+n100+n50+nmiss)<0.01,if(nmiss<1,1,0),0),0)@0} A:${if(n300/(n300+n100+n50+nmiss)>0.8,if(nmiss<1,1,if(n300/(n300+n100+n50+nmiss)>0.9,1,0)),0)@0} B:${if(n300/(n300+n100+n50+nmiss)>0.7,if(nmiss<1,1,if(n300/(n300+n100+n50+nmiss)>0.8,1,0)),0)@0} C:${if(n300/(n300+n100+n50+nmiss)>0.6,1,0)@0} D:${if(n300/(n300+n100+n50+nmiss)<0.6,1,0)@0}

@Someone999
Copy link
Contributor

I use so many variables, so I provide the variables I used.

1 similar comment
@Someone999
Copy link
Contributor

I use so many variables, so I provide the variables I used.

@imsuck
Copy link

imsuck commented Aug 17, 2021

image
I provided socre grade as a variable.

can i add this to my Sync! and how to do it?

@Someone999
Copy link
Contributor

At my plugin, this is only thing you need to do.
image

@imsuck
Copy link

imsuck commented Aug 17, 2021

At my plugin, this is only thing you need to do.
image

how do i download it?

@Someone999
Copy link
Contributor

Well, wait for me update my project first.

@imsuck
Copy link

imsuck commented Aug 17, 2021

Well, wait for me update my project first.

Alright, thank you :)

@Someone999
Copy link
Contributor

image
This request has not been handled yet. So, I suspect that they are no longer attention at this project.

@Someone999
Copy link
Contributor

InfoReader.zip

@Someone999
Copy link
Contributor

Someone999 commented Aug 17, 2021

Decompress this file and copy the folder named InfoReader to Plugins

@imsuck
Copy link

imsuck commented Aug 17, 2021

Decompress this file and copy the folder named InfoReader to Plugins

Thank you, have a good day!

@Someone999
Copy link
Contributor

np

@Someone999
Copy link
Contributor

You can get help by type "getinfo help"

@Someone999
Copy link
Contributor

Someone999 commented Aug 17, 2021

Get advanced help by type "getinfo help command"
If you want to get help of command "var", type "getinfo help var"

@Someone999
Copy link
Contributor

Notice: If you didn't install InGameOverlay, do not use getinfo reinject.

@imsuck
Copy link

imsuck commented Aug 17, 2021

It returned [RTPP:Expression]No variable found (return zero). Variable name: CurrentRank D:

@Someone999
Copy link
Contributor

you need to use "getinfo config"

@Someone999
Copy link
Contributor

image

@Someone999
Copy link
Contributor

This is the another way.

@Someone999
Copy link
Contributor

Someone999 commented Feb 27, 2022

It's necessary to tell you that the config system and MMF system are incompatible with the old's. So you need to change the config file manually to make it works. You can also wait for the migration assistant of the plugin.

@Someone999
Copy link
Contributor

The new plugin is here now. The plugin will detect the old settings and merge them with itself's.
You need to delete or move the old InfoReader folder out (Make a backup is the better choice), then decompress and copy the new one into the plugin folder.

InfoReader.zip

@Someone999
Copy link
Contributor

If null appears in Sync output, take InfoReader.db in InfoReader folder to plugin folder.

@Someone999
Copy link
Contributor

Someone999 commented Feb 28, 2022

The plugin will restart Sync after the migration. You can check all settings with the command "getinfo config program".

Mmfs can not add or delete in the config window now. But you can view or config all mmfs in the config window with the command "getinfo config mmf".

If you want to add or delete mmf, you need to open the config file with the command "getinfo config open", and add the mmf following the existed settings. There are 4 kinds of Mmf available.

Formats are here
The names can not repeat.

NormalMmf

[MmfConfigs.Mmfs.SomeName]
MmfType = "NormalMmf"
EnabledStatus = "Rank" #There can input more than one Status.
Name = "SomeName"
UpdateInterval = 5
Enabled = true
FormatFile = "AFileName"

StatusMmf

[MmfConfigs.Mmfs.InfoReaderMmfResult]
MmfType = "StatusMmf"
EnabledStatus = "Rank" #There can input more than one Status.
Name = "InfoReaderMmfResult"
UpdateInterval = 5
Enabled = true
FormatFile = "AFileName1"

ModeMmf

[MmfConfigs.Mmfs.SomeName1]
MmfType = "ModeMmf"
EnabledMode = "Osu" #There can input more than one mode.
Name = "SomeName1"
UpdateInterval = 5
Enabled = true
FormatFile = "AFileName2"

StatusModeMmf

[MmfConfigs.Mmfs.SomeName2]
MmfType = "StatusModeMmf"
EnabledMode = "Osu" # As same as above
EnabledStatus = "Playing" # As same as above
Name = "SomeName2"
UpdateInterval = 5
Enabled = true
FormatFile = "AFileName3"

@Someone999
Copy link
Contributor

Status can be found at Changelog of 1.0.17

@Someone999
Copy link
Contributor

Someone999 commented Feb 28, 2022

Modes are Osu, Taiko, Catch, Mania

@Someone999
Copy link
Contributor

The file can use the related path.
. presents current directory, .. presents the last directory, / or \ at the start presents the root directory.
Examples

If current path is "D:\Sync\Plugins\InfoReader"

.. presents D:\Sync\Plugins
. presents D:\Sync\Plugins\InfoReader
/ or \ at start presents D:\
..\dir or ../dir presents D:\Sync\Plugins\dir
.\dir or ./dir presents D:\Sync\Plugins\InfoReader\dir
\dir or /dir presents D:\dir

@Someone999
Copy link
Contributor

The file name can use the related path.

PathCharacter Meaning
. Current directory
.. Last directory
\\ or / at start Root directory

Examples
Assume current directory is "D:\Sync\Plugins\InfoReader"

PathCharacter Meaning
. D:\Sync\Plugins\InfoReader
.. D:\Sync\Plugins
\\ or / at start D:

@Someone999
Copy link
Contributor

I used a editor which implemented the syntax highlighting. I only added .ifrfmt to support list. So I recommend that use .ifrfmt extension if you need to create format file by your self.

@Someone999
Copy link
Contributor

Someone999 commented Mar 1, 2022

osuTools.zip
Some things are fixed in the new osuTools. Decompress and copy osuTools.dll to InfoReader folder and overwrite the old one.

@Someone999
Copy link
Contributor

I wrote an all-new expression parser, this may use more memory and CPU resource, but it's more potent than the previous one.
Now you can type expressions like this.
image

@Someone999
Copy link
Contributor

Someone999 commented Apr 8, 2022

TestFunc contains two methods, Log and If.
The method name is case ignored.

@Someone999
Copy link
Contributor

Someone999 commented Apr 8, 2022

When you want to use a string.
image

@Someone999
Copy link
Contributor

Someone999 commented Apr 8, 2022

In inputbox you must to write
if(Log(5,7)>5.5,5*7,"6+2")

@imsuck
Copy link

imsuck commented Apr 8, 2022

👀

@Someone999
Copy link
Contributor

You can not convert an integer to a boolean also.
Example:
if(1,1,0) will lead to an error like this

image

@Someone999
Copy link
Contributor

image
Nested if is allowed because it's a function

@Someone999
Copy link
Contributor

I'd never thought I can do it. Xd

@Someone999
Copy link
Contributor

Someone999 commented Apr 8, 2022

I will send plugin here after tested.

@imsuck
Copy link

imsuck commented Apr 10, 2022

how can I build the plugin myself?

@Someone999
Copy link
Contributor

Someone999 commented Apr 10, 2022

There is a tutorial

@Someone999
Copy link
Contributor

Someone999 commented Apr 10, 2022

You need to use .net framework 4.5.2 or newer to program.

@Someone999
Copy link
Contributor

There is my code.
InfoReaderV2

@Someone999
Copy link
Contributor

The configuration part, I18n part, and the command part are not suitable for my code because I implemented my custom system.

@Someone999
Copy link
Contributor

Someone999 commented Apr 10, 2022

If you want to implement your pp data provider, you need to reference RealTimePPDisplayer and add it to the dependency.
If you want to implement your osu data processor, you need to reference OsuRTDataProvider and all it to the dependency.
You can add dependencies like this.
image

@Someone999
Copy link
Contributor

Someone999 commented Apr 10, 2022

If you want to use the config window, you need to reference ConfigGUI, all ConfigElement in your config class will be added to the window.

@Someone999
Copy link
Contributor

Someone999 commented Apr 12, 2022

If you want to get help with use OsuRTDataProvider, you can read the code in osuTools/OrtdpWrapper

@Someone999
Copy link
Contributor

Someone999 commented Apr 14, 2022

I'm rewriting my modules and you can develop with me if you are interested.
osuToolsV2
OrtdpWrapper

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants