Scripting

You need help to start using UVK? You have a doubt on a UVK feature? Post here!
Forum rules
We have no special rules for UVK forums. Just try to be polite and clear in your posts.
Please don't post spam in this forum. Spammers will be banned by IP, e-mail and username.
We reserve the right to delete all posts and ban all users we consider not having respected these rules without warning.
Post Reply
Charger440
Posts: 1529
Joined: Sun May 25, 2014 7:44 am
Location: Missouri

Scripting

Post by Charger440 »

I stated that I was thinking about a very ambitious script project and I think I have run into a road block. The GUI works just fine but I wanted the buttons to start UVK functions. When I add the function names to the button code I get an error message saying there is no Wend statement then the function in the button code actually runs without ever loading the GUI.

I am gonna keep looking but is this even doable Fred?
Jim

It is not "Can it be done?" but rather, "How can we do it?"
wmmiller
Posts: 1098
Joined: Fri Dec 07, 2012 6:02 am
Location: Minnesota, USA

Re: Scripting

Post by wmmiller »

It is not "Can it be done?" but rather, "How can we do it?"

I saw this somewhere. 8-)
Play stupid games….win stupid prizes
Charger440
Posts: 1529
Joined: Sun May 25, 2014 7:44 am
Location: Missouri

Re: Scripting

Post by Charger440 »

LOL your on a roll today Bill :)
It can be done if it was coded to actually interpret different codes inline.
Jim

It is not "Can it be done?" but rather, "How can we do it?"
wmmiller
Posts: 1098
Joined: Fri Dec 07, 2012 6:02 am
Location: Minnesota, USA

Re: Scripting

Post by wmmiller »

Sorry Jim. I just couldn’t help myself. :lol: I wish I could help you but I can’t.
Play stupid games….win stupid prizes
Fred
Site Admin
Posts: 2360
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Scripting

Post by Fred »

Jim, I'm actually glad you are putting your script skills into good use.

I can't say for sure without seeing the code but I would guess that either you are not closing the While loop with a WEnd statement, or there's something wrong after While that prevents the script from reaching WEnd.
One thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
Fred
Site Admin
Posts: 2360
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Scripting

Post by Fred »

Just so you know, I moved this topic to the Help and support forum because it is not a tutorial.
One thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
Xander
Posts: 438
Joined: Sun May 24, 2015 11:55 pm
Contact:

Re: Scripting

Post by Xander »

Jim, do you want to post your code (or at least its skeleton) so we can help troubleshoot it? AutoIt GUI isn't my forté but I've done plenty of While/Wend's
Charger440
Posts: 1529
Joined: Sun May 25, 2014 7:44 am
Location: Missouri

Re: Scripting

Post by Charger440 »

Xander

While/Wend isn't too bad. What I was trying to do was put "<UpdateJava>" in the while/Wend. If I took that out it worked just fine but if I added it then AutoIT would give an error but Java would update with no interaction....

That should sorta answer Fred's question as well
Jim

It is not "Can it be done?" but rather, "How can we do it?"
Fred
Site Admin
Posts: 2360
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Scripting

Post by Fred »

Jim, You can't mix AutoIt and UVK script code. You can only add UVK scripting code after the end of your AutoIt script.
One thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
Xander
Posts: 438
Joined: Sun May 24, 2015 11:55 pm
Contact:

Re: Scripting

Post by Xander »

That'll do it. Think of using Autoit scripts within UVK as a Call command. Once you're out, you're out...until you're back in to UVK.

Why have the UpdateJava within the loop anyway? You can only update a single PC once so might as well do it either before or after your loop.
Charger440
Posts: 1529
Joined: Sun May 25, 2014 7:44 am
Location: Missouri

Re: Scripting

Post by Charger440 »

Xander I have a feeling Fred knows what I was wanting to, atleast to a limited degree.

I don't want to loop the <UpdateJava>, there would not be much sense in that as you would have just done and it most likely would not have changed. Think outside the box :)

AutoIT from what I can tell is not object oriented so make it wait and see function you want to perform you have to include a While/Wend in it. You also have to put a "Sleep" in there (VB calls it "DoEvents") so that it does not site there grinding resources while it's waiting on you to make a decision. Because I am not sure of Freds feelings on such a thing a thing I am not going to state what my ultimate goal was with that idea. But that should give you better idea of why I was using a while/Wend :)
Jim

It is not "Can it be done?" but rather, "How can we do it?"
Xander
Posts: 438
Joined: Sun May 24, 2015 11:55 pm
Contact:

Re: Scripting

Post by Xander »

Charger440 wrote:Xander I have a feeling Fred knows what I was wanting to, atleast to a limited degree.
I'll just keep my mouth shut then.
Fred
Site Admin
Posts: 2360
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Scripting

Post by Fred »

Jim, please do not use Sleep() in the while loop. whoever told you that does not know how it works. AutoIt is already optimized to idle the CPU in message loops.
One thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
Charger440
Posts: 1529
Joined: Sun May 25, 2014 7:44 am
Location: Missouri

Re: Scripting

Post by Charger440 »

Xander wrote:
Charger440 wrote:Xander I have a feeling Fred knows what I was wanting to, atleast to a limited degree.
I'll just keep my mouth shut then.
Well, I wouldn't quite put it that way. I just meant that I bet Fred knew what I was wanting to do or at least had an idea.
Jim

It is not "Can it be done?" but rather, "How can we do it?"
Charger440
Posts: 1529
Joined: Sun May 25, 2014 7:44 am
Location: Missouri

Re: Scripting

Post by Charger440 »

Fred wrote:Just so you know, I moved this topic to the Help and support forum because it is not a tutorial.
Fred I can use all the help I can get :)
:lol:
Jim

It is not "Can it be done?" but rather, "How can we do it?"
Post Reply