• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

OTClient Open Website

.Smile

Member
Joined
Jan 27, 2019
Messages
29
Reaction score
11
I am making a button on the module in OTClient and would like to know what is the function to open an external link in case of a website.

Code:
@onClick: ?
 
Solution
Hi .Smile,
LUA:
os.execute("start http://otland.net")
The above would do the trick, perhaps not on the .otui file, use Lua for that.

If you find that not elegant enough due to the console showing up and starting the browser directing it to the desired page you might also use the function openUrl.

That's the method to call it via luascript:
C++:
g_lua.bindSingletonFunction("g_platform", "openUrl", &Platform::openUrl, &g_platform);


Best Wishes
Okke
Hi .Smile,
LUA:
os.execute("start http://otland.net")
The above would do the trick, perhaps not on the .otui file, use Lua for that.

If you find that not elegant enough due to the console showing up and starting the browser directing it to the desired page you might also use the function openUrl.

That's the method to call it via luascript:
C++:
g_lua.bindSingletonFunction("g_platform", "openUrl", &Platform::openUrl, &g_platform);


Best Wishes
Okke
 
Last edited:
Solution
Hi .Smile,
LUA:
os.execute("start http://otland.net")
The above would do the trick, perhaps not on the .otui file, use Lua for that.

If you find that not elegant enough due to the console showing up and starting the browser directing it to the desired page you might also use the function openUrl.

That's the method to call it via luascript:
C++:
g_lua.bindSingletonFunction("g_platform", "openUrl", &Platform::openUrl, &g_platform);


Best Wishes
Okke

Thanks so much for answering, the second option is much better.
 
Last edited:

Similar threads

Back
Top