It is currently October 15th, 2024, 1:04 am

I need help with RAM measures coding

Get help with creating, editing & fixing problems with skins
User avatar
truejaz
Posts: 11
Joined: September 10th, 2022, 7:06 pm

I need help with RAM measures coding

Post by truejaz »

Hello everyone
I need help writing code for RAM measures that I am currently working on
So I know the code of the measurement itself and I know how to write the code of the horizontal bar effect
But right now I'm working on a cyberpunk 2077 skin And I want to measure the RAM like the RAM in the game
For those who don't know the game I will explain
In the game you have the ability to hack all kinds of things. The hack is used in RAM and each gigabyte of RAM is displayed as a vertical bar and it shows you how much RAM you have used and how much you have left You can see in the picture that there are 5 vertical bars, 2 in blue which is the available RAM and 2 in red which is the RAM in use and one in the middle which is half red and half blue
2022-09-10 22.46.18 www.youtube.com 1fd06b9137b6.jpg
I want to do the RAM measures like in the game, do you think this is possible? Any help would be greatly appreciated

Disclaimer: I'm not a coder I don't know the codes and I don't know how they work. I'm doing it for fun and everything I've done so far has been a combination of trial and error with all ready made codes
If you want to see pictures of what I have done so far, ask and I will be happy to show you
You do not have the required permissions to view the files attached to this post.
User avatar
CodeCode
Posts: 1391
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: I need help with RAM measures coding

Post by CodeCode »

Well, the perspective (if needed) will be kinda difficult. Unless you capture the images from the screen with with something like windows snipping tool.
Then alignment with the Ram bars would be some equation (i dont know this).

If the squared off version is ok, then shape meters will be your ticket to ride.

Once people know what effect you are trying to achieve - please be verbose - then help will eventually arrive. Depending on which hemisphere finds this post first lol. I'm SE Hemisphere.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
tass_co
Posts: 523
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: I need help with RAM measures coding

Post by tass_co »

truejaz wrote: September 10th, 2022, 8:01 pm Hello everyone
I need help writing code for RAM measures that I am currently working on
So I know the code of the measurement itself and I know how to write the code of the horizontal bar effect
But right now I'm working on a cyberpunk 2077 skin And I want to measure the RAM like the RAM in the game
For those who don't know the game I will explain
In the game you have the ability to hack all kinds of things. The hack is used in RAM and each gigabyte of RAM is displayed as a vertical bar and it shows you how much RAM you have used and how much you have left You can see in the picture that there are 5 vertical bars, 2 in blue which is the available RAM and 2 in red which is the RAM in use and one in the middle which is half red and half blue
2022-09-10 22.46.18 www.youtube.com 1fd06b9137b6.jpg
I want to do the RAM measures like in the game, do you think this is possible? Any help would be greatly appreciated

Disclaimer: I'm not a coder I don't know the codes and I don't know how they work. I'm doing it for fun and everything I've done so far has been a combination of trial and error with all ready made codes
If you want to see pictures of what I have done so far, ask and I will be happy to show you

First of all, the code has flaws.
The MtrFreeMem meter shows the total free space.
So when the value in the range is not 1gb the indicator is wrong.
(Bars represent 1 gb. MtrFreeMem represents total free memory.)
Also, there may be errors.
I think the only way to give depth for the 3d is to create a new image. Then it can be used with Progressbar logic.
Replace MtrBarBg and MtrBarProgress ImageNames according to total RAM size. (Available in skin file as 8/16/32)

If the forum friends can't help, I'll try to improve it in my spare time.

I am sharing the code and skin file.

Code: Select all

[Rainmeter]
Update=1000


[Variables]


;============= MEASURES
[MeaTotalMem]
Measure=PhysicalMemory
Total=1
UpdateDivider=3600

[MeaFreeMem]
Measure=PhysicalMemory
InvertMeasure=1

;============= CALC
[CalcBar]
Measure=Calc
Formula=MeaFreeMem
IfCondition= CalcBar < (1000*1000*1024)
IfTrueAction=[!SetOption MtrFreeMem X "0"][!UpdateMeter MtrFreeMem][!Redraw]
IfCondition2=CalcBar > (1000*1000*1024)
IfTrueAction2=[!SetOption MtrFreeMem X "8"][!UpdateMeter MtrFreeMem][!Redraw]
IfCondition3=CalcBar > (2000*1000*1024)
IfTrueAction3=[!SetOption MtrFreeMem X "16"][!UpdateMeter MtrFreeMem][!Redraw]
IfCondition4=CalcBar > (3000*1000*1024)
IfTrueAction4=[!SetOption MtrFreeMem X "24"][!UpdateMeter MtrFreeMem][!Redraw]
IfCondition5=CalcBar > (4000*1000*1024)
IfTrueAction5=[!SetOption MtrFreeMem X "32"][!UpdateMeter MtrFreeMem][!Redraw]
IfCondition6=CalcBar > (5000*1000*1024)
IfTrueAction6=[!SetOption MtrFreeMem X "40"][!UpdateMeter MtrFreeMem][!Redraw]
IfCondition7=CalcBar > (6000*1000*1024)
IfTrueAction7=[!SetOption MtrFreeMem X "48"][!UpdateMeter MtrFreeMem][!Redraw]
IfCondition8=CalcBar > (7000*1000*1024)
IfTrueAction8=[!SetOption MtrFreeMem X "56"][!UpdateMeter MtrFreeMem][!Redraw]
IfCondition9=CalcBar > (8000*1000*1024)
IfTrueAction9=[!SetOption MtrFreeMem X "64"][!UpdateMeter MtrFreeMem][!Redraw]
IfCondition10=CalcBar > (9000*1000*1024)
IfTrueAction10=[!SetOption MtrFreeMem X "72"][!UpdateMeter MtrFreeMem][!Redraw]
IfCondition11=CalcBar > (10000*1000*1024)
IfTrueAction11=[!SetOption MtrFreeMem X "80"][!UpdateMeter MtrFreeMem][!Redraw]
IfCondition12=CalcBar > (11000*1000*1024)
IfTrueAction12=[!SetOption MtrFreeMem X "88"][!UpdateMeter MtrFreeMem][!Redraw]
IfCondition13=CalcBar > (12000*1000*1024)
IfTrueAction13=[!SetOption MtrFreeMem X "96"][!UpdateMeter MtrFreeMem][!Redraw]
IfCondition14=CalcBar > (13000*1000*1024)
IfTrueAction14=[!SetOption MtrFreeMem X "104"][!UpdateMeter MtrFreeMem][!Redraw]
IfCondition15=CalcBar > (14000*1000*1024)
IfTrueAction15=[!SetOption MtrFreeMem X "112"][!UpdateMeter MtrFreeMem][!Redraw]
IfCondition16=CalcBar > (15000*1000*1024)
IfTrueAction16=[!SetOption MtrFreeMem X "120"][!UpdateMeter MtrFreeMem][!Redraw]
; IfCondition17=CalcBar > (16000*1000*1000)
; IfTrueAction17=[!SetOption MtrFreeMem X "128"][!UpdateMeter MtrFreeMem][!Redraw]
; IfCondition18=CalcBar > (17000*1000*1000)
; IfTrueAction18=[!SetOption MtrFreeMem X "136"][!UpdateMeter MtrFreeMem][!Redraw]
; IfCondition19=CalcBar > (18000*1000*1000)
; IfTrueAction19=[!SetOption MtrFreeMem X "144"][!UpdateMeter MtrFreeMem][!Redraw]
; IfCondition20=CalcBar > (19000*1000*1000)
; IfTrueAction20=[!SetOption MtrFreeMem X "152"][!UpdateMeter MtrFreeMem][!Redraw]
; IfCondition21=CalcBar > (20000*1000*1000)
; IfTrueAction21=[!SetOption MtrFreeMem X "160"][!UpdateMeter MtrFreeMem][!Redraw]
; IfCondition22=CalcBar > (21000*1000*1000)
; IfTrueAction22=[!SetOption MtrFreeMem X "168"][!UpdateMeter MtrFreeMem][!Redraw]
; IfCondition23=CalcBar > (22000*1000*1000)
; IfTrueAction23=[!SetOption MtrFreeMem X "176"][!UpdateMeter MtrFreeMem][!Redraw]
; IfCondition24=CalcBar > (23000*1000*1000)
; IfTrueAction24=[!SetOption MtrFreeMem X "184"][!UpdateMeter MtrFreeMem][!Redraw]
; IfCondition25=CalcBar > (24000*1000*1000)
; IfTrueAction25=[!SetOption MtrFreeMem X "192"][!UpdateMeter MtrFreeMem][!Redraw]
; IfCondition26=CalcBar > (25000*1000*1000)
; IfTrueAction26=[!SetOption MtrFreeMem X "200"][!UpdateMeter MtrFreeMem][!Redraw]
; IfCondition27=CalcBar > (26000*1000*1000)
; IfTrueAction27=[!SetOption MtrFreeMem X "208"][!UpdateMeter MtrFreeMem][!Redraw]
; IfCondition28=CalcBar > (27000*000*1000)
; IfTrueAction28=[!SetOption MtrFreeMem X "216"][!UpdateMeter MtrFreeMem][!Redraw]
; IfCondition29=CalcBar > (28000*1000*1000)
; IfTrueAction29=[!SetOption MtrFreeMem X "224"][!UpdateMeter MtrFreeMem][!Redraw]
; IfCondition30=CalcBar > (29000*1000*1000)
; IfTrueAction30=[!SetOption MtrFreeMem X "232"][!UpdateMeter MtrFreeMem][!Redraw]
; IfCondition31=CalcBar > (30000*1000*1000)
; IfTrueAction31=[!SetOption MtrFreeMem X "240"][!UpdateMeter MtrFreeMem][!Redraw]
; IfCondition32=CalcBar > (31000*1000*1000)
; IfTrueAction32=[!SetOption MtrFreeMem X "248"][!UpdateMeter MtrFreeMem][!Redraw]
; IfCondition33=CalcBar > (32000*1000*1000)
; IfTrueAction33=[!SetOption MtrFreeMem X "256"][!UpdateMeter MtrFreeMem][!Redraw]
; IfCondition34=CalcBar > (33000*1000*1000)
; IfTrueAction34=[!SetOption MtrFreeMem X "264"][!UpdateMeter MtrFreeMem][!Redraw]
; IfCondition35=CalcBar > (34000*1000*1000)
; IfTrueAction35=[!SetOption MtrFreeMem X "272"][!UpdateMeter MtrFreeMem][!Redraw]
; IfCondition36=CalcBar > (35000*1000*1000)
; IfTrueAction36=[!SetOption MtrFreeMem X "280"][!UpdateMeter MtrFreeMem][!Redraw]
IfConditionMode=1

;============= BARS
[MtrBarBg]
Meter=Image
ImageName=Back16.png
X=0
Y=0

[MtrBarProgress]
Meter=Bar
MeasureName=MeaFreeMem
BarImage=Bar16.png
BarOrientation=Horizontal
X=0
Y=0
DynamicVariables=1

[MtrFreeMem]
Meter=Bar
MeasureName=MeaFreeMem
X=0
W=6
H=26
BarColor=123,180,188
SolidColor=253,110,94
BarOrientation=Vertical
DynamicVariables=1

[MeterString1]
Meter=String
Text=1
FontColor=255,255,255
FontFace=Arial
FontSize=6
StringAlign=Left
X=0
Y=30

[MeterString8]
Meter=String
Text=8
FontColor=255,255,255
FontFace=Arial
FontSize=6
StringAlign=Left
X=56
Y=30

[MeterString16]
Meter=String
Text=16
FontColor=255,255,255
FontFace=Arial
FontSize=6
StringAlign=Left
X=118
Y=30
11.09.2022 - 12.49.04-.png
FreeMem_1.0.rmskin
You do not have the required permissions to view the files attached to this post.
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
truejaz
Posts: 11
Joined: September 10th, 2022, 7:06 pm

Re: I need help with RAM measures coding

Post by truejaz »

:jawdrop Wow this looks a lot better than I thought possible. Thank you very much, this is great
User avatar
tass_co
Posts: 523
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: I need help with RAM measures coding

Post by tass_co »

truejaz wrote: September 11th, 2022, 12:54 pm :jawdrop Wow this looks a lot better than I thought possible. Thank you very much, this is great
I believe I have now fixed the existing issues with the version I have shared :thumbup:
Progressbar now evaluates according to the 1gb space range available in each bar. Regardless of the total value 8-)

I converted the incoming data to String. I removed the first digit with Substitute. (Sometimes 2 digit depending on ram size)
Then I changed this string back to number to be able to use it in bar meter... :great:
GIF 11.09.2022 18-48-00.gif
Memory_Cyberpunk.2077.Style_2.0.rmskin
You do not have the required permissions to view the files attached to this post.
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
truejaz
Posts: 11
Joined: September 10th, 2022, 7:06 pm

Re: I need help with RAM measures coding

Post by truejaz »

That's incredible...The work you've done is so amazing it puts everything I've done so far to shame
User avatar
tass_co
Posts: 523
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: I need help with RAM measures coding

Post by tass_co »

truejaz wrote: September 11th, 2022, 6:42 pm That's incredible...The work you've done is so amazing it puts everything I've done so far to shame
I'm glad I could help :thumbup:
I don't know where i going from here, but i promise it won't be boring... :great:
Judian81
Posts: 180
Joined: May 6th, 2021, 2:57 pm

Re: I need help with RAM measures coding

Post by Judian81 »

tass_co wrote: September 11th, 2022, 3:49 pm Memory_Cyberpunk.2077.Style_2.0.rmskin
sorry to intrude. but i tryed your skin. it look very cool. but i do not know if this works right.

mem meter.png

another skin that gives information about ram usage tells me it uses 52 procent.
You do not have the required permissions to view the files attached to this post.
User avatar
tass_co
Posts: 523
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: I need help with RAM measures coding

Post by tass_co »

Judian81 wrote: September 12th, 2022, 2:57 pm sorry to intrude. but i tryed your skin. it look very cool. but i do not know if this works right.
mem meter.png
I can't test every GB of data as RAM varies with open apps. But there is definitely a mistake. I will try every GB somehow and try to fix the problem.
Judian81 wrote: September 12th, 2022, 2:57 pm another skin that gives information about ram usage tells me it uses 52 procent.
I will check that too :thumbup:
I don't know where i going from here, but i promise it won't be boring... :great:
Judian81
Posts: 180
Joined: May 6th, 2021, 2:57 pm

Re: I need help with RAM measures coding

Post by Judian81 »

tass_co wrote: September 12th, 2022, 3:25 pm I can't test every GB of data as RAM varies with open apps. But there is definitely a mistake. I will try every GB somehow and try to fix the problem.
ow. wait. i just have 8 GB of ram. so i had to change the ImageName=Back16.png to ImageName=Back8.png right?!