Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


ShellExecute variable

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
ByTransient
Expert Cheater
Reputation: 5

Joined: 05 Sep 2020
Posts: 240

PostPosted: Thu Jan 28, 2021 12:36 pm    Post subject: ShellExecute variable Reply with quote

I don't know if anyone has encountered this.
If there is no different fix, you can use the examples below.

This works fine;
Code:
shellExecute("chrome.exe","https://www.google.com/")


This is not working; (Also tried; Maxthon set as default browser)
Code:
shellExecute("Maxthon.exe","https://www.google.com/")


This works fine;
Code:
shellExecute("Maxthon.exe",shellExecute("https://www.google.com/"))


I don't understand why, but the solution is working for now.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 150

Joined: 06 Jul 2014
Posts: 4657

PostPosted: Thu Jan 28, 2021 4:39 pm    Post subject: Reply with quote

Probably a bug in how that browser parses command line arguments.
https://forum.maxthon.com/index.php?/topic/23414-command-line-parameter-to-launch-maxthon/

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
ByTransient
Expert Cheater
Reputation: 5

Joined: 05 Sep 2020
Posts: 240

PostPosted: Thu Jan 28, 2021 9:08 pm    Post subject: Reply with quote

Unfortunately, the forum topic has been archived and no solution has been found.
I could suggest the code below. Maybe it would work for them. Smile
These commands are working;
Code:
shellExecute("Maxthon.exe",shellExecute("https://www.google.com/"))


or

Code:
io.popen("Maxthon.exe",shellExecute("https://www.google.com/"))
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 468

Joined: 09 May 2003
Posts: 25718
Location: The netherlands

PostPosted: Fri Jan 29, 2021 3:49 am    Post subject: Reply with quote

if maxthon is your default browser then
Code:

shellExecute("https://www.google.com/")


shellexecute works like the run dialog that shows when pressing winkey+r

_________________
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
View user's profile Send private message MSN Messenger
ByTransient
Expert Cheater
Reputation: 5

Joined: 05 Sep 2020
Posts: 240

PostPosted: Fri Jan 29, 2021 9:58 am    Post subject: This post has 1 review(s) Reply with quote

Ok it worked when it became the default browser.
PC Win10 64 bit.
Available on PC; I have 32-64 bit Chrome, 32 bit Maxthon, 32-64 bit Mozilla, I Explorer, M Edge.

It's not meant to open with the default browser.
In other words, it was a game link that had to be opened and enabling the user to open the game in the browser of his choice, according to the user's choice.

Code:
shellExecute ("Maxthon.exe", shellExecute ("https://apps.sample/game=etc"))

Still the method I gave above works fine.

The example below explains why I think so.
I'm only posting for novices like me to provide ideas.
Feature code I added to Trainer;

Code:
--------------------------------- Launch ---------------------------------------
if Launcpans1 then Launcpans1.destroy() end
Launcpans1=createForm() Launcpans1.Height=230 Launcpans1.Width=175
Launcpans1.Position=poDesktopCenter Launcpans1.BorderStyle="bsNone"
--------------------------------------------------
local Launclab1=createPanel(Launcpans1)
Launclab1.Width=155 Launclab1.Height=28 Launclab1.Left=10  Launclab1.Top=93
Launclab1.Font.Size=10 Launclab1.Font.Style="fsBold" Launclab1.OptimalFill=true
Launclab1.caption="Download Launcher"

local Launclab2=createPanel(Launcpans1)
Launclab2.Width=155 Launclab2.Height=28 Launclab2.Left=10  Launclab2.Top=126
Launclab2.Font.Size=10 Launclab2.Font.Style="fsBold" Launclab2.OptimalFill=true
 Launclab2.caption="Close Launcher"

local Launclab3=createComboBox(Launcpans1) Launclab3.AutoSize=false
Launclab3.Width=155 Launclab3.Height=28 Launclab3.Left=10  Launclab3.Top=161
Launclab3.Font.Size=10 Launclab3.Font.Style="fsBold" Launclab3.OptimalFill=true

local Launcpan2=createPanel(Launcpans1) Launcpan2.Height=28 Launcpan2.Width=95
Launcpan2.Left=40 Launcpan2.Top=192 Launcpan2.color=0xffff00 Launcpan2.cursor= - 21
Launcpan2.caption="CLOSE" Launcpan2.Font.Style="fsBold" Launcpan2.Font.Size=11

local Launcpan3=createLabel(Launcpans1) Launcpan3.AutoSize=false Launcpan3.Height=85
Launcpan3.Width=155 Launcpan3.Left=10 Launcpan3.Top=5 Launcpan3.Alignment="taCenter"
Launcpan3.Font.Style="fsBold" Launcpan3.Font.Size=15
Launcpan3.caption="Select\nLauncher\nOptions.."
--------------------------------------------------
Launcpans1.OnMouseDown = function() Launcpans1.DragNow() end
Launcpan3.OnMouseDown = function() Launcpans1.DragNow() end

function btnEff22(btis22) --16776960 --yesil
btis22.color=16446000
btis22.cursor= - 21
btis22.BevelWidth=3
btis22.Font.Color=0
btis22.BevelColor=16711744
btis22.OnMouseMove=function()
btis22.BevelColor=16747215 end --16777215 end
btis22.OnMouseLeave=function()
btis22.BevelColor=16711744  --16711744
end
end
btnEff22(Launclab1) btnEff22(Launclab2) btnEff22(Launcpan2)
---------------------------------------------------
Launclab1.OnClick=function()
shellExecute("")
end

Launclab2.OnClick=function()
local procesID = getProcessIDFromProcessName("Game one.exe")
if procesID==nil then
showMessage("Launcher  Close!")
else
os.execute("taskkill /pid "..procesID)
sleep(100)
showMessage("Launcher  Close!")
end
end

Launclab3.Items.Add("Open Game Browser")
Launclab3.Items.Add("Google Chrome")
Launclab3.Items.Add("Mozilla Firefox")
Launclab3.Items.Add("Microsoft Edge")
Launclab3.Items.Add("Opera")
Launclab3.Items.Add("Internet Explorer")
Launclab3.Items.Add("Maxthon")
Launclab3.ItemIndex=0

Launclab3.OnChange=function()
local indd1=Launclab3.ItemIndex
if indd1==0 then return end
if indd1==1 then
shellExecute("chrome.exe","https://apps.sample/game=etc")
end
if indd1==2 then
shellExecute("firefox.exe","https://apps.sample/game=etc")
end
if indd1==3 then
shellExecute("msedge.exe","https://apps.sample/game=etc")
end
if indd1==4 then
shellExecute("opera.exe","https://apps.sample/game=etc")
end
if indd1==5 then
shellExecute("iexplore.exe","https://apps.sample/game=etc")
end
if indd1==6 then
shellExecute("Maxthon.exe",shellExecute("https://apps.sample/game=etc"))
end
end

Launcpan2.OnClick=function()
Launcpans1.close() --or Launcpans1.Destroy()
end
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 468

Joined: 09 May 2003
Posts: 25718
Location: The netherlands

PostPosted: Fri Jan 29, 2021 10:32 am    Post subject: Reply with quote

you need to give the full path to maxthon.exe
_________________
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
View user's profile Send private message MSN Messenger
ByTransient
Expert Cheater
Reputation: 5

Joined: 05 Sep 2020
Posts: 240

PostPosted: Fri Jan 29, 2021 11:36 am    Post subject: Reply with quote

Dark Byte wrote:
you need to give the full path to maxthon.exe


Code:
shellExecute([[C:\Program Files\Maxthon\Maxthon.exe]],"https: //apps.sample/game=etc")


Ok this works for me.
But as you can tell from the folder where it was installed, I did a selective installation. (32 bit Maxthon in 64 bit program folder)

However, the file path may differ on different PCs (the program allows different file / folder selection during installation), this can be desktop or "E \:" folder.

DarkByte, let me use "shellExecute("",shellExecute(""))" nested. Smile Smile
This way it works right.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 468

Joined: 09 May 2003
Posts: 25718
Location: The netherlands

PostPosted: Fri Jan 29, 2021 1:09 pm    Post subject: Reply with quote

the way that works for you doesn't work as you think

Code:

shellExecute ("Maxthon.exe", shellExecute ("https://apps.sample/game=etc"))


what ce does is:
First execute
Code:

shellExecute ("https://apps.sample/game=etc")

and write that result into X. Since shellExecute returns nothing, it's nil

then execute
Code:

shellExecute ("Maxthon.exe", nil)


So, first it starts the default browser on your system with that url, and then it tries to execute Maxthon.exe . If it's not found in the system path, do nothing

_________________
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
View user's profile Send private message MSN Messenger
ByTransient
Expert Cheater
Reputation: 5

Joined: 05 Sep 2020
Posts: 240

PostPosted: Fri Jan 29, 2021 2:24 pm    Post subject: Reply with quote

The code below was tested on 3-4 PCs and works fine.
Especially Maxthon was problematic, with current coding it fixed.
As @ParkourPenguin mentioned, I guess this is a fault with Maxthon.

But as I said, I have a lot of users who are not familiar with the default browser topic, this is the browser selection plugin I created for them.
(And @ParkourPenguin, thanks for your "taskkill / pid" code.)

The system default for the code below is Google Chrome.
But each browser starts the game in its own code without any problems.
The different code is Maxthon and it seems that it still hasn't solved the "Command not opening" issue on its forum site.

Code:
Launclab3.Items.Add("Open Game Browser")
Launclab3.Items.Add("Google Chrome")
Launclab3.Items.Add("Mozilla Firefox")
Launclab3.Items.Add("Microsoft Edge")
Launclab3.Items.Add("Opera")
Launclab3.Items.Add("Internet Explorer")
Launclab3.Items.Add("Maxthon")
Launclab3.ItemIndex=0

Launclab3.OnChange=function()
local indd1=Launclab3.ItemIndex
if indd1==0 then return end
if indd1==1 then
shellExecute("chrome.exe","https://www.google.com/")
end
if indd1==2 then
shellExecute("firefox.exe","https://www.google.com/")
end
if indd1==3 then
shellExecute("msedge.exe","https://www.google.com/")
end
if indd1==4 then
shellExecute("opera.exe","https://www.google.com/")
end
if indd1==5 then
shellExecute("iexplore.exe","https://www.google.com/")
end
if indd1==6 then
shellExecute("Maxthon.exe",shellExecute("https://www.google.com/"))
end
end


( I hope you won't install Maxthon browser to test this. Smile )
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites