It is currently May 19th, 2024, 12:54 pm

Running VBS script from button

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16238
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Running VBS script from button

Post by balala »

LuciferVisuals wrote: April 18th, 2023, 4:07 pm Re The Toggle bang, Originally I could not get it io work with !Activate, Yincognito said it was because it was already Active and made a few suggestions one being I change it to !Deactivate followed by ! Activate in the same mouse click which worked perfectly, So I removed the Toggle.
Alright, understood.
LuciferVisuals wrote: April 18th, 2023, 4:07 pm I do have some old backups so I could find the original code if you wanted to see it. But from my point of view, once it was working I moved on. This project changes quite a lot every day.
No, I don't want. If you got it working as expected and you moved on, there is no reason to work with those old files.
LuciferVisuals wrote: April 18th, 2023, 4:07 pm I think am at the limit of my understanding at the moment, I think I reached saturation point, at least for a while. Please remember I wrote the first line of any code in my entire life less than three weeks ago, I have read your advice above about four times, and my mind keeps switching off (I understand most of what you say in isolation, but my head loses track of it by the time I get half way through). But I promise I will go through it again (repeatedly) if I have to until I do understand it, but I can't comment on it at the moment because it's not sinking in.
Take a rest and charge your batteries. No rush at all (at least from my point of view)...
LuciferVisuals wrote: April 18th, 2023, 4:07 pm I am adding a new help section the buttons to load and unload it are below, It works perfectly to both load and unload the first time you use them, but then they stop working. Can you see at a glance what's wrong, (In nice simple beginners terms) I have pasted it below.
I assume the culprit is how do you show and hide the buttons. On the [ShowHelp] meter you have a bang to show the [HideHelp] meter and another to hide [ShowHelp] (the current) meter. However when you click the [HideHelp] meter (which you get shown when you clicked the [ShowHelp] meter), the bangs are hiding the [ShowHelp] and showing the [HideHelp] meter. If take carefully a look, you'll realize that when you click [ShowHelp] everything goes on as it has to, but when [HideHelp] is revealed and [ShowHelp] is hidden, the further click does nothing, because it should show the already visible meter and should hide the anyway hidden meter. The parameters of the !ShowMeter and !HideMeter bangs in both ButtonCommand options are identical. Replace those parameters on the bangs of the ButtonCommand option of the [HideHelp] meter.
Besides this, as Yincognito already wrote, the !Rainmeter... bang prefix has been deprecated ago and shouldn1t be used anymore, even if it still works (it's required by the backward compatibility). But you should renounce them.
And one more, which I already wrote: the !DeactivateConfig bang doesn't require the name of the skin, just the name of the config you want to deactivate. This is why the [!ActivateConfig "Stargates\Remote-Help" "Remote-Help.ini"] bang (used in the ButtonCommand option of the [ShowHelp] meter) is proper, however the [!DeactivateConfig "Stargates\Remote-Help" "Remote-Help.ini"] bang (ButtonCommand option of the [HideHelp] meter) deosn1t require the red marked skin name.
Here is the altered version of the above two meter, which I assume will work:

Code: Select all

[HideHelp]
Meter=Button
ButtonImage=#@#Buttons\HideHelp.png
X=470
Y=745
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "Hide Help"][!UpdateMeter "MeterString-Footer-2"][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter "MeterString-Footer-2"][!Redraw]
ButtonCommand=[!ShowMeter ShowHelp][!HideMeter HideHelp][!Redraw][!DeactivateConfig "Stargates\Remote-Help"]
Hidden=1

[ShowHelp]
Meter=Button
ButtonImage=#@#Buttons\ShowHelp.png
X=470
Y=745
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "Show Help"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
ButtonCommand=[!ShowMeter HideHelp][!HideMeter ShowHelp][!Redraw][!ActivateConfig "Stargates\Remote-Help" "Remote-Help.ini"]
LuciferVisuals wrote: April 18th, 2023, 4:07 pm ALSO, I have ask Yincognito the same question, not because I doubt either of you but simply because I have been talking to both of you and didn't don't want either of you thinking I favoured the other, but let me know for next time whether asking two Sages the same question is a no no.
I personally don't think anything like this. I'm glad if can help anyone out there, but it's up of anyone to use or use not my solutions. I'm never angry if anyone don't want to use what I recommended, especially if finds a better solution than mine (and I'm sure usually such a better solution does exist, I'm not a wizard). So, don't worry, it's a pleasure for me to help, when I can. In my beginner skinner period I also got a lot of help on this forum, so now I help with pleasure.
LuciferVisuals wrote: April 18th, 2023, 4:07 pm Thank you again for your time and patience with me, I can promise you it's not a waste of time, It all sinks in "Eventually" LOL
I never thought it's a waste of time.
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

balala wrote: April 18th, 2023, 6:56 pm Alright, understood.



I never thought it's a waste of time.
I have learned more from you that you can ever realise. I think I will benefit more from some of you advice when my coding gets better to be honest, Looking at it, it even looks to me as though I understand more that I really do, or perhaps I do understand more than I think, I just need to do more at this level to become more familiar with what I am doing before I add new coding concepts. New ideas are ok, like my help screen, providing I can do it with the code I already know, It's not hard work. Obviously I'll add the odd new bit of code when absolutely necessary. I'm sure once I stop getting confused about what I already know, I'll be more than keen to push ahead

On another subject, I had a disaster this morning, I was using Notepad++ to put square brackets round all my Bangs, It really screwed things up big time. I had made a backup before doing it, but the code had changed so much in between times, that when I put the help screen bit in I was getting dozens of red error messages. Everything worked perfectly though. I only found them because atm I check that log often. Anyway it's taken the entire day to get rid of them all.

Anyway as always thanks for your time.

Keith
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

Yincognito wrote: April 18th, 2023, 12:47 pm As promised, I did try it today (after moving the Scripts folder somewhere else just in case),
It's funny I was wondering why I was so reluctant to actually remove the Scripts folder or the old folder that was going to use them, even though they were not in use any more, and I had decided that they definitely were not going to be used in this skin, so why my reluctance?

I realised what it was, when I very first started, before I wrote even "Hello World" in Rainmeter, they were the very first computer code I ever wrote, first the batch files, and then the VBS scripts to run the batch files invisibly. So while this may sound crazy, it was a sort of sentimental attachment, I suppose. I wrote them, took ages to get them working, but it was a milestone.

Once I actually started on rainmeter skins, I quickly realised they did not work how I had originally assumed they would, and so I slowly let go of my original ideas, but was reluctant to take that last step and remove them altogether. BTW talking of removing things, I was wondering why my project is so big, its still have quite a lot of images used during construction, once all the crap is removed it's only about 4 MB.

Sorting out the Notepad issue I mentioned turned into a nightmare, it's taken the entire day to get rid of every resulting error message in the log. Anyway done it now.

Glad you liked the project, thought it might surprise you! Even though i'ts not finished, I find myself using it more and more, it's much faster that desktop icons.

Have a good one

Keith
User avatar
Yincognito
Rainmeter Sage
Posts: 7286
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Running VBS script from button

Post by Yincognito »

LuciferVisuals wrote: April 18th, 2023, 3:38 pmCan you see at a glance what's wrong, I have pasted it below.
Sorry for the delay, I was quite busy with some other stuff while still being logged in - hopefully this is solved by now, as far as I could read.
LuciferVisuals wrote: April 18th, 2023, 9:46 pmI realised what it was, when I very first started, before I wrote even "Hello World" in Rainmeter, they were the very first computer code I ever wrote
If they were the first ever in any language I would keep them stored some place else for the memories. If they were the first ever related to Rainmeter I would do the same, but only if they represent a completed stage / version of a skin. I do have such local "repositories" myself - not a very online person.
LuciferVisuals wrote: April 18th, 2023, 9:46 pmSorting out the Notepad issue I mentioned turned into a nightmare, it's taken the entire day to get rid of every resulting error message in the log. Anyway done it now.
Ouch! It has only once happened to me in Notepad++, because after that I always check how the replacement went before continuing. Since I don't close it before these moments, a "disaster" is averted by clicking on Undo until satisfied.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
CodeCode
Posts: 1367
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Running VBS script from button

Post by CodeCode »

Yincognito wrote: April 19th, 2023, 3:59 am Sorry for the delay, I was quite busy with some other stuff while still being logged in - hopefully this is solved by now, as far as I could read.


If they were the first ever in any language I would keep them stored some place else for the memories. If they were the first ever related to Rainmeter I would do the same, but only if they represent a completed stage / version of a skin. I do have such local "repositories" myself - not a very online person.


Ouch! It has only once happened to me in Notepad++, because after that I always check how the replacement went before continuing. Since I don't close it before these moments, a "disaster" is averted by clicking on Undo until satisfied.
Just thought to point out, that SublimeText3 has a great rainmeter package for both auto complete and suggesting from parts of your own code. On top of that even if you close the main program sublimetext3 but left your ini or inc in place there are nearly unlimited undo - until you actually close the file whilst sublimetext3 remained open and was closed with no re-opening files.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

Yincognito wrote: April 19th, 2023, 3:59 am this is solved by now, as far as I could read.
Trying something new here..... Well for me, seeing if this will split your orignal post into bits so I can reply under each point making my response easier to understand. Yes its all done. I had simply overcomplicated it, with the two buttons, Once I changed it to one and toggled it that worked perfectly.
If they were the first ever in any language I would keep them stored some place else for the memories.
Yes .bat files were the code I ever wrote, I was well impressed, but then I was trying to find how to run them without the cmd prompt window popping up. Discovered that was not possible. But then discovered, that I could write a short VBS script which would then run the .bats and the whole thing is invisible. Very impressed with my self, And I have kept them, when I finish this, I will go and have another play with them.

I have found the ultimate back up BTW. you can buy a 120 GB ssd on e-bay for peanuts (about my budget). Think I paid £10. So I cloned my original c:\ drive (With acronis) and replaced it with one, that and lashing out another £10 to increase the ram to 8 Gb speeded up this ancient computer quite a lot. Bought an Nvidia 3D graphics card for under £10 and the windows performance index improved from 3.something to almost 8.

Anyway I suddenly had an epiphany. Bought a couple more SSD's for the same amount. So now apart from copying my entire project to my D: drive every night, which takes about 25 seconds, about once a week, I clone the entire c:\ to another ssd, (Takes 5 mins) SSD to SSD. I rotate the other two drives so I'm not overwriting the same drive.... Think Power cut. In a worse case scenario, just boot to acronis and clone the most recent back over the working c:\ drive, also 5mins....... Faster, and better and definitely safer than windows System restore. :thumbup:

(Hmmm thinks, with evil glint in his eye... might make a couple of batch files for that and put them on buttons..... Lol), :twisted:
Since I don't close it before these moments, a "disaster" is averted by clicking on Undo until satisfied.
Now you tell me......

TBH I knew that, but and here is my big mistake, I knew I had a recent back up, so thought I would just use that and paste the newer additions into it. That's where it went wrong, then it went from bad to worse, as I tried to sort it out, my coding might be basic and simple, but there is a lot of it and in all interlinks. It all worked perfectly, except for an increasing number of red error messages. Frustrating or what..... And while those error messages help you find the problem WHEN THERE IS ONLY ONE on a new bit of code, they are not so helpful when there is an increasing number of between 20 and 30 of them appearing "Apparently" at random, sometimes popping up, sometimes not. (Yes there has to be a logical reason for that.... But what fun it is finding intermittent errors)

Anyway, ALL SORTED NOW, and quite a feeling of accomplishment, once I stopped kicking myself.

BUT SSD to SSD BACKUP of the boot drive IS A SIMPLY BRILLIANT BACK UP SOLUTION. Don't miss that in all the waffle.

My first SSD just happened to ba a used Kingstone, just mentioning that because it came with it's own free cloning software, for Kingston drives. This is a cut down version of Acronis, but appears to work with anything as long as there is a kingston SSD involved somewhere in the system. Full versions of Acronis which allow you to clone the drive the stick it straight into another machine are available elsewhere, "wink wink nod nod know what I mean" :Whistle

Keith

No need to reply, this was just for info.
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

CodeCode wrote: April 19th, 2023, 6:12 am Just thought to point out, that SublimeText3 has a great rainmeter package
Ohh "Piece of candy" :lol:

I'll look at that, but wont play with it yet, not till I get this to a more or less finished stage, (I have come this far in four months, my head is about to explode, so I have put a block on trying anything else new, for a while and decided to focus on consolidating and working within what I already know... Which is a very small drop in an infinite ocean, but I only just learnt to swim.

But that sounds very useful and tempting, so I will come back to it... Thank you.

Keith
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

To anyone following this.

I just made such a simple change that makes this so much better, I changed the skin position of all these from normal to on top. made it easier while i was fixing my last Cluster£@*#.

But what an improvement, as now the little remote remains onscreen all the time, just like an icon inconspicuous but visible even when you are using other programs, click it and the remote control tablet appears over what you are doing, giving you instant access to everything you have set up, click the icon one again and the control tablet disappears leaving just just the icon. Cool but simple. Finally some pure luck ;-)

Keith
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

Open question not technical any advice or opinions welcome.

Right back in one of my first post Balala said something like "We all started with someone else's scripts and modified them".

I was just trying to find it but it was taking a while, hadn't realised how many post there now were to wade through so instead or replying with that quote, I thought I would just ask anyone who has previously contacted me (because I know you all know what you are talking about), which doesn't mean other don't, of course, but I know you all do.

TBH I probably should of started like that, I did do it with the childlock.ini, but that turned out to be harder than doing it myself in the end, so haven't been tempted to do it again until now....

HERE IS THE QUESTION.

Somewhat late in the day, I want to get back to the stargate theme I was originally interested in. There are some skins (probably a lot if I actually look for them), which I could now easily modify to do other things, just as an example opening a stargate as a help screen for my remote control. So I got three or four. WHERE DO I STAND USING THE ORIGINAL CODE, the ones I found on first glance don't state any creative commons licence (don't even have a metatext section). I'm not trying to steal anyone's work, the code in these works perfectly, but is in fact much more simple and basic than mine, If I wrote them from scratch they would probably come out the same, especially now I have seen them.

SO CAN I JUST LITERALLY TAKE THEM AND START MODIFYING THEM. I think I can (Pretty sure actually), I just don't want to find out the hard way that I should not have done that. Anything I should be careful about? Or pay special attention to?

But if "Go For It" covers it that's also fine as an answer.

Keith
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

Pressing ahead for the moment assuming the answer to my question is basically "Go For It"

The stargate skins I have seen dont have the "Whoosh" Effect on the portal when it opens, I haven't tried yet but think I can see how that's done, and will plod away with that myself unless I get stuck.

Firstly (having learned the hard way) I thought I would ask if anyone has seen a stargate skin with the Whoosh effect, little point reinventing the wheel, if it's already been done well?

Secondly I don't mind making the whoosh animation myself, that will be interesting, but thinking ahead I looked at the portal that all the stargates I have seen use, ( I think I can improve on that to use less resources, but not tried yet, and won't bother atm) as it will certainly do till after I master making a "Whoosh".

All these Portals run like an endless loop, which is fine for the portal, and it's easy to turn on and off. Anyone know off hand what the code would be to make an animation run once only, EG the whoosh effect, which obviously I would not want looping, just a one off whosh then the portal.Probably superimpose the whoosh over the portal, as you would not see the portal while Whoosh is in progress. Probably something easy like don't put whoosh in the background frame, Start with an empty stargate then on a button load whoosh (ro run once) and portal to start at the same time but keep going.

Any tips on this would be very welcome, not urgent, I can guess how busy you guys are, and I have to work out how to make the whoosh animation first which will keep me busy for a while.

Keith