[Release] Execute Titan Two scripts using Python!

GPC2 script programming for Titan Two. Code examples, questions, requests.

[Release] Execute Titan Two scripts using Python!

Postby Loui2 » Thu Jun 07, 2018 4:22 pm

I've had a couple of people ask me about the PostMessage()/SendMessage() to execute a script in Gtuner via Python, I've decided to just post it.
I have attached the code I made and use for this purpose.

A nice little gif showing it being used two times, first with Gtuner minimized and then second with Gtuner maximized:
Image




I'm learning everyday so my apologies if the code contains bugs, redundancies or inefficient ways of accomplishing a solution.
I did not make the code with the intentions of releasing it, however hopefully I documented the code good enough for people to learn whats going on or to at least put it to some good use!

Feel free to post any bugs or suggestions.





Requires Python and the dependencies used.

This is the include/import statement to help know what dependencies may be needed:
import win32con, win32api, win32gui, win32process, psutil, time

Created and tested on Python 3.6

Learn more about Python here: https://wiki.python.org/moin/BeginnersGuide
And here: https://docs.python.org/3/
Attachments
Gtuner PostMessage().zip
Contains two files:
• "PostMessage_Wrapper.py" just something I previously programmed to simplify using PostMessage() on applications.
• "Gtuner Main.py" an example of how it's used to execute a script on Gtuner.
(2.59 KiB) Downloaded 242 times
User avatar
Loui2
Sergeant First Class
Sergeant First Class
 
Posts: 24
Joined: Sun Oct 15, 2017 11:41 pm

Re: [Release] Execute Titan Two scripts using Python!

Postby J2Kbr » Fri Jun 08, 2018 9:48 am

:joia: :joia: It is funny how there are always something in computer programming that impresses me. I didn't know this was possible. nice work.
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: [Release] Execute Titan Two scripts using Python!

Postby Loui2 » Fri Jun 08, 2018 4:01 pm

J2Kbr wrote::joia: :joia: It is funny how there are always something in computer programming that impresses me. I didn't know this was possible. nice work.

Thank you, I appreciate it :innocent_smile_1:

I also feel the same way about computer programming. It's like an endless stream of wonders :smile0517:
User avatar
Loui2
Sergeant First Class
Sergeant First Class
 
Posts: 24
Joined: Sun Oct 15, 2017 11:41 pm

Re: [Release] Execute Titan Two scripts using Python!

Postby str0ke » Wed Jun 13, 2018 5:15 pm

Pretty sweet! Nice work. Add a capture card and it's going to be bot central on console :)
User avatar
str0ke
Corporal
Corporal
 
Posts: 4
Joined: Wed Jun 13, 2018 4:57 pm

Re: [Release] Execute Titan Two scripts using Python!

Postby PoshLemur » Sun Jun 24, 2018 12:54 am

Good job! Interesting wrapper you made there for Win32 PostMessage, worth checking out. :)
My github account: [link]
User avatar
PoshLemur
Sergeant Major
Sergeant Major
 
Posts: 75
Joined: Thu Mar 08, 2018 9:26 am

Re: [Release] Execute Titan Two scripts using Python!

Postby AhmedEgg » Mon Jun 25, 2018 12:54 am

shame im no good at coding

cause this is awesome
User avatar
AhmedEgg
Sergeant Major
Sergeant Major
 
Posts: 99
Joined: Thu Jun 30, 2016 4:13 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 130 guests