Community Forum

OPEN URL .LUA

Forum Overview >> Scripting

CategoryScripting
Created28.05.2014 13:33


Diman Prop (Unknown) 28.05.2014 13:34
hi
tell me how to make a script to Lua he opened webpage
I did so


wind = {};

function wind .prerequisitesPresent(specializations)
return SpecializationUtil.hasSpecialization(Motorized, specializations);
end;



function wind:donCommand( pl, text, teamonly )
if (text == "!don") then
pl:SendLua([[gui.OpenURL("http://www.mesite.com")]])

end
end
end



function wind:keyEvent(unicode, sym, modifier, isDown)

if isDown and sym == Input.KEY_KP_4 then
pl:SendLua = not pl:SendLua;
end;


end;

function wind:update(dt)


end;



function wind:draw()


end;

Janis Heller (Unknown) 24.09.2014 15:12
As I understand making webrequests is not allowed in FS.
The same for interacting in with the OS in a deeper way, like using:
http://lua-users.org/wiki/OsLibraryTutorial


Note: Log in to post. Create a new account here.