View previous topic :: View next topic |
Author |
Message |
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sun Apr 01, 2018 9:51 pm Post subject: Batch script to Lua script or AA script |
|
|
These batch script to control system volume (increase/decrease volume) :
Code: | -- vol_up.bat //increasing system volume
@if (@a==@b) @end /*
:: batch portion
@ECHO OFF
cscript /e:jscript "%~f0"
:: JScript portion */
var shl = new ActiveXObject("WScript.Shell");
for (var i=0; i<5; i++) {
shl.SendKeys(String.fromCharCode(0xAF));
} |
and
Code: | -- vol_dn.bat //idecreasing system volume
@if (@a==@b) @end /*
:: batch portion
@ECHO OFF
cscript /e:jscript "%~f0"
:: JScript portion */
var shl = new ActiveXObject("WScript.Shell");
for (var i=0; i<5; i++) {
shl.SendKeys(String.fromCharCode(0xAE));
} |
Is there any chance to change those script to Lua or AA script ?
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
TheyCallMeTim13 Wiki Contributor Reputation: 50
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Sun Apr 01, 2018 10:46 pm Post subject: |
|
|
This worked for me, had no idea; had to try.
But the key codes aren't in the "defines.lua" file, so you'll have to define then if you want.
Code: | VK_VOL_UP = 0xAF
doKeyPress(VK_VOL_UP) |
_________________
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Mon Apr 02, 2018 4:56 am Post subject: |
|
|
TheyCallMeTim13 wrote: | This worked for me, had no idea; had to try.
|
Thank a lot,, these code work properly and also done with add / register VK_VOL_UP = 0xAF and VK_VOL_DN = 0xAE to "defines.lua" on my CE 6.7
Cheers
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 31
Joined: 16 Feb 2017 Posts: 1234
|
Posted: Mon Apr 02, 2018 5:29 am Post subject: Re: Batch script to Lua script or AA script |
|
|
Corroder wrote: | These batch script to control system volume (increase/decrease volume) :
Code: | -- vol_up.bat //increasing system volume
@if (@a==@b) @end /*
:: batch portion
@ECHO OFF
cscript /e:jscript "%~f0"
:: JScript portion */
var shl = new ActiveXObject("WScript.Shell");
for (var i=0; i<5; i++) {
shl.SendKeys(String.fromCharCode(0xAF));
} |
and
Code: | -- vol_dn.bat //idecreasing system volume
@if (@a==@b) @end /*
:: batch portion
@ECHO OFF
cscript /e:jscript "%~f0"
:: JScript portion */
var shl = new ActiveXObject("WScript.Shell");
for (var i=0; i<5; i++) {
shl.SendKeys(String.fromCharCode(0xAE));
} |
Is there any chance to change those script to Lua or AA script ? |
@Corroder is in pursuit of a new job.
Let's see, what will be the result.
Thanks to you; Those who know Cheat Engine,
They explore the fun side.
Never back down!
--Note:
@TheyCallMeTim13; I sent the +1 RAP points.
I always thank you for your help and patience.
_________________
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Mon Apr 02, 2018 6:43 am Post subject: |
|
|
Quote: | @Corroder is in pursuit of a new job.
Let's see, what will be the result. |
Just make a simple Internet / Web Radio using CE Lua script and IDE.
and codes from @TheyCallMeTim13 use to substitute my script to call
batch files from file stream.
Code: | mypath = TrainerOrigin or getMainForm()
file1 = 'dn.bat'
file2 = 'up.bat'
findTableFile(file1).saveToFile(mypath..'\\'..file1)
findTableFile(file2).saveToFile(mypath..'\\'..file2)
function volUP()
f = mypath..'\\'..'up.bat'
shellExecute(f, SW_HIDE)
end
function volDN()
f = mypath..'\\'..'dn.bat'
shellExecute(f, SW_HIDE)
end |
substitute with :
Code: | function volUP()
doKeyPress(0xAF)
end
function volDN()
doKeyPress(0xAE)
end
|
and assign that two functions to image click events.
and this to mute / unmute (toggle) windows system volume :
Description: |
|
Filesize: |
25 KB |
Viewed: |
5437 Time(s) |
|
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8516 Location: 127.0.0.1
|
Posted: Wed Apr 04, 2018 7:41 pm Post subject: |
|
|
Lua has access to os.execute which can execute command line scripts, commands, etc. if you absolutely need to access the command line in that way. You can use it to launch powershell to execute powershell scripts for more power too if needed.
_________________
- Retired. |
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Wed Apr 04, 2018 8:59 pm Post subject: |
|
|
Thanks atom0s for info. And yes i have tried Powerscript also, via bath file, vbs script which call Powershell script or just test directly via command line (cmd).
Example to mute / unmute volume :
Code: | $wshShell = new-object -com wscript.shell
$wshShell.SendKeys([char]173) |
All just fine. Just face one problem when using os.execute through Lua script is can not avoid cmd windows pop-up / blink. But it doesn't matter since I made my app only for my personal use.
Then these function below, actually I used to avoid cmd windows pop-up because it run not from os.execute.
Code: | function volUP()
doKeyPress(0xAF)
end
function volDN()
doKeyPress(0xAE)
end |
Again, thank you...
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
|