View previous topic :: View next topic |
Author |
Message |
Death GOD 7 Expert Cheater Reputation: 0
Joined: 21 Jan 2017 Posts: 105 Location: Heaven and Hell
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
|
Back to top |
|
|
Death GOD 7 Expert Cheater Reputation: 0
Joined: 21 Jan 2017 Posts: 105 Location: Heaven and Hell
|
Posted: Sun Aug 27, 2017 12:12 am Post subject: |
|
|
I used shell execute code.but I only want other users to open X.Exe file and in open dialog box I want to show only *.exe extension files to show
_________________
"If you are good at something,never do it for free"-The Joker
I know you are looking at this post, Hitler |
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sun Aug 27, 2017 7:43 am Post subject: |
|
|
This code below will show files in a directory.
Anyway, I don;t know how to filtering only exe files to display.
f = createForm()
Code: | b = createButton(f)
b.width = 100
b.height = 30
b.Caption = 'Test Me'
function GetFileName(f)
local str = f
local temp = ""
local result = ""
for i = str:len(), 1, -1 do
if str:sub(i,i) ~= "/" then
temp = temp..str:sub(i,i)
else
break
end
end
for j = temp:len(), 1, -1 do
result = result..temp:sub(j,j)
end
return result
end
function exploFile()
load_dialog = createOpenDialog(self)
load_dialog.InitalDir = os.getenv('%USERPROFILE%')
load_dialog.execute()
file = load_dialog.FileName
a = GetFileName(file)
if a == nil then
return a
else
print(a) --- should be change to shellExecute here...
end
end
b.onClick = exploFile
f.show() |
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Sun Aug 27, 2017 1:07 pm Post subject: |
|
|
Corroder wrote: | Anyway, I don;t know how to filtering only exe files to display. | Simple enough, the celua.txt file mentions that a FileDialog has the property " Filter: string - A filter formatted string" and a simple google search gives the format as 'Name|mask[;mask...]' with each name/mask separated by '|' eg. Code: | load_dialog.Filter = 'Executable files|*.EXE;*.BAT;*.CMD;*.sh|Bat files (*.bat)|*.BAT|Exe files (*.exe)|*.EXE|All files (*.*)|*' |
also, since Windows uses \ for paths so looking for / is probably not correct...
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sun Aug 27, 2017 4:38 pm Post subject: |
|
|
Ok, Thanks @FreeER
After read this from http://wiki.cheatengine.org/index.php?title=OpenDialog
and by your sample, here a simple way to filtering files type and displaying its using openDialog.
Code: | load_dialog = createOpenDialog(self)
load_dialog.InitalDir = os.getenv('%USERPROFILE%')
load_dialog.Filter = 'Executable files|*.EXE;*.BAT;*.CMD;*.sh|Bat files (*.bat)|*.BAT|Exe files (*.exe)|*.EXE|All files (*.*)|*'
load_dialog.execute()
print(load_dialog.FileName) --- shoud be change to shell execute to run app |
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
Death GOD 7 Expert Cheater Reputation: 0
Joined: 21 Jan 2017 Posts: 105 Location: Heaven and Hell
|
Posted: Mon Aug 28, 2017 9:32 am Post subject: |
|
|
Got it thanks...
I again need help
1. I want trainer to close and music to stop when I press exit button so I wrote this
And I also want user to confirm that they want to exit.if the users presses yes then exit else do nothing
Code: |
function exitbttnClick(sender)
messageDialog ("...Are you sure?",mtWarning, mbYes,mbCancel)
--and if yes then
closeCE()
xmplayer.stop()
end
|
Please complete the code
2.can you help me in code when process is attached I want music to stop...Help?
_________________
"If you are good at something,never do it for free"-The Joker
I know you are looking at this post, Hitler |
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Mon Aug 28, 2017 12:15 pm Post subject: |
|
|
well print out what messageDialog returns (print(messageDialog(...)).... if it's something like false/0 when you click cancel but true/1 when you click ok then it's as simple as
Code: | if messageDialog(......) then -- or messageDialog == 1
closeCE()
-- xmplayer.stop() -- if CE closes then the music should stop too
return caFree -- I think something wants this as the return value...
end
return caNone |
alternatively you can check celua.txt and/or defines.lua for more information (message dialog results might be of particular interest)
|
|
Back to top |
|
|
Death GOD 7 Expert Cheater Reputation: 0
Joined: 21 Jan 2017 Posts: 105 Location: Heaven and Hell
|
Posted: Mon Aug 28, 2017 8:05 pm Post subject: |
|
|
FreeER wrote: | well print out what messageDialog returns (print(messageDialog(...)).... if it's something like false/0 when you click cancel but true/1 when you click ok then it's as simple as
Code: | if messageDialog(......) then -- or messageDialog == 1
closeCE()
-- xmplayer.stop() -- if CE closes then the music should stop too
return caFree -- I think something wants this as the return value...
end
return caNone |
alternatively you can check celua.txt and/or defines.lua for more information (message dialog results might be of particular interest) |
Thanks again...but the result for yes button was 6 and for cancel was 2.
BTW can you also tell me the code to stop music when process is attached.
Your help is appreciated.
_________________
"If you are good at something,never do it for free"-The Joker
I know you are looking at this post, Hitler |
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Mon Aug 28, 2017 9:33 pm Post subject: |
|
|
Code: | onOpenProcess = function() xmplayer.stop() end | should work
|
|
Back to top |
|
|
Death GOD 7 Expert Cheater Reputation: 0
Joined: 21 Jan 2017 Posts: 105 Location: Heaven and Hell
|
Posted: Tue Aug 29, 2017 9:52 am Post subject: |
|
|
FreeER wrote: | Code: | onOpenProcess = function() xmplayer.stop() end | should work |
Thanks for your help.I have +Rep you.
Sorry for bugging you but can we type like this in messagedialog box:
Code: |
Hello,this is my trainer. --with enter pressed like line breaker
HOPE you enjoy it
|
I could only type single straight line
And also in messagedialog box can we use code in Lua Script that makes text bold or align center
Thanks again
Regards 7[/quote]
_________________
"If you are good at something,never do it for free"-The Joker
I know you are looking at this post, Hitler |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Tue Aug 29, 2017 10:14 am Post subject: |
|
|
Code: |
messageDialog([[something
with
multiple
lines]], mtInformation,mbOK)
|
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Tue Aug 29, 2017 1:15 pm Post subject: |
|
|
DB already showed multiline strings in lua, I believe you could also use \n (or possibly \r\n) to insert line breaks into regular strings as well. However as far as I know you can't have formatted text in a message box.
|
|
Back to top |
|
|
Death GOD 7 Expert Cheater Reputation: 0
Joined: 21 Jan 2017 Posts: 105 Location: Heaven and Hell
|
Posted: Tue Aug 29, 2017 8:06 pm Post subject: |
|
|
Dark Byte wrote: | Code: |
messageDialog([[something
with
multiple
lines]], mtInformation,mbOK)
|
|
FreeER wrote: |
DB already showed multiline strings in lua, I believe you could also use \n (or possibly \r\n) to insert line breaks into regular strings as well. However as far as I know you can't have formatted text in a message box |
Thanks to you both Admin and FreeER.I prefer dark bytes way for multiple lines.
I again have a question for you in messagedialog box can we add custom box type rather than warning,Information, error. ..etc and have custom logo.
Regards 7
_________________
"If you are good at something,never do it for free"-The Joker
I know you are looking at this post, Hitler |
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Tue Aug 29, 2017 8:17 pm Post subject: |
|
|
No, it's just a simple wrapper for Windows' message box. If you want more control/customization then you'll need to create your own form
|
|
Back to top |
|
|
|