Jump to content

Automating the ck with autoit


markyrocks

Recommended Posts

I'd just like to put this out there bc I was having alot of issues with bulk adding variables and endless hours of clicking around and typing ect. Even using copy and pasting was helping but I was still going through and adding in unique variables to if elseif statements ect. So I said to myself I'm doing the same process over and over, why can't I write an autoit script that does the work for me?

 

The answer to that was I can't do it bc the ck for whatever reason (is beyond me and made me want to pull my hair out) the ck ignored simulated mouse clicks and keystrokes.....what a daisy.

 

So I did write a couple autoit functions to do various data processing. Like if you have 100 variables that you want to add to an array. I can copy them into a file, point the autoit script to the file and it will generate the code that I need to copy it back into the papyrus script without typing it all out. Pretty neat, saving me alot of time and effort.

 

That's all fine but how did I overcome the fact that the ck ignores simulated mouse clicks and keystrokes?....

 

That was something that had me scratching my head for a couple days but I enjoy a good challenge. I was actually thinking about using a low level keyboard and mouse hook and injecting my code into the process but even that might be detected bc the events needed to originate b4 the driver level.... so I started thinking about buying a cheap bluetooth dongle and just using my laptop through bluetooth to control my desktop...that is probably a viable option. However I had already set my laptop up to remotely control my desktop through teamviewer. I was actually writing and testing autoit scripts written and executed on my desktop remotely with my laptop... then it dawned on me...what if I executed the script on my laptop and through teamviewer it did what it needed to do... like magic it worked.

 

The only downside to this is that you do lose some functionality. Like my autoit script cant get unique window information through teamviewer. But anything is better than nothing right. What is nice is that the clipboard is shared so I can copy information to the clipboard and compare it to other data in my script. Like if I need to know what quest stage the mouse is hovering over it can click it 5 times copy to clipboard and the my script can see it so it knows how to act accordingly.

 

Idk I'm rambling but ya using autoit has significantly improved my quality of life when it comes to building this monster of a mod that I'm making. If you dont know what autoit is go check it out bc its honestly one of the most forgiving entry level programming languages ever.

I highly recommend it. I had dabbled with c++ b4 I started using autoit. If it wasn't for autoit I'd still probably have no clue what a string is.

Link to comment
Share on other sites

awesome stuff,

that made for a great read

thanks for sharing this behind the scenes into

your Batch-Automation/ AGI-assisted modding praxis, Markyrocks!

 

I'd not have thought of using AutoIt to approach that.

in hindsight,

that'd save on kludging a programmable controller/peripheral and the soldering *glavin*

 

-----

AGI-assisted modding and games'dev'in

makes that turnaround time so much better,

less of that humdrum, more of that playtesting or gaming it up!

Link to comment
Share on other sites

If anyone is wondering where I'm copying the objects names from. I open the object window, type in the search filter to isolate the list of objects I want. Minimize the teamviewer window. Make my script run the function that I have written to copy the names of the objects. Start the script and it automatically opens the teamviewer window and copies the names of the items that are in the object window. It goes through one by one and copies every item, writes it to file and compares the current object to the first so if it gets back to the top of the list it stops.
Link to comment
Share on other sites

So I just finished the last function that I need to build my mod. The function just fills out a quest stages form. It just gets to the bottom of the quest stages window, figures out if there's enough available stages for the program to fill them out. If the stages aren't available it makes new ones... then it gets to the starting queststage for the section its working on, makes a new log entry, selects my script from the dropdown, clicks in the papyrus fragment box, writes the fragment and adds a designers note and the clicks on the next stage in the sequence and does it all over again until it gets to the end...so nice
Link to comment
Share on other sites

So basically I've automated all the aspects of creating my mod.

I have a function that copies the names of the objects u want to add to the terminal.

 

Another that takes the names and adds the variable type ,property, auto const to the names to be copy and pasted into the script. (Then I have to use auto fill to give them there value).

 

Another func to take the variable names and generate if elseif statements and add a unique number so I can point the kmyquest.mycustomfunc(int) directly at the specific item.

 

Another function to break the formal names down to generic names and fills out the terminal form so that it points each item to a specific quest stage.

 

And last but not least fills out the quest stages form ect. As meantioned in my previous post.

 

Obviously I have to create the forms and add some unique information into my automation script so it knows what to do but everything I've done will save me considerable amounts of time and wrist pain. I'm so happy to be at this point. Honestly I'd rather put in the effort to automate monotonous tasks rather than bang away on the keyboard endlessly. My only regret is that I didn't do it sooner I manually built like 75% of this mod b4 I just couldn't stand it anymore. I literally hit a brick wall.

Link to comment
Share on other sites

re post#5

I can relate to that 'what-the' lament.

"Necessity is the |Source| of invention".

 

if only I'd known about 'smart menus', random-walk routines

batchautomation and AGI-assisted procedural-iterative stuff,

and programmable controllers ages ago,

it'd have made making mods easier hehe.

 

 

 

Though, I'm impressed by your innovative kludge to batch-automate that way.

pivoting like that is an interesting avenue for interoperability.

 

 

really makes you wonder,

how many mods (such as at CC etc) are made in an automated style...

 

 

Link to comment
Share on other sites

re post#5

I can relate to that 'what-the' lament.

"Necessity is the |Source| of invention".

Â

 if only I'd known about 'smart menus', random-walk routines

batchautomation and AGI-assisted procedural-iterative stuff,

and programmable controllers ages ago,

it'd have made making mods easier hehe.

Â

 

 

Though, I'm impressed by your innovative kludge to batch-automate that way.

pivoting like that is an interesting avenue for interoperability.

Â

Â

really makes you wonder,

how many mods (such as at CC etc) are made in an automated style...

 

 

All I can say is without out the helper scripts or a couple other people to help a mod this size would be a tall order for one person. Literally in the past 2 hours I've probably done what would have taken 2 days of misery b4. I want to correct something. I thought I was 75% of the way done but now I'm getting new ideas with other added content that these automated processes gives me the desire and energy to add considering the pc is doing the heavy lifting.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...