albers14 Posted June 8, 2015 Share Posted June 8, 2015 local sW, sH = guiGetScreenSize() local browser = createBrowser(sW,sH,false,false) function renderYt() dxDrawImage(0,0,sW,sH,browser,0,0,0,tocolor(255,255,255,255),true) showCursor(true) end function createIt() loadBrowserURL(source,"https://www.youtube.com/watch?v=RgKAFK5djSk") focusBrowser(browser) addEventHandler("onClientRender", root, renderYt) end addEventHandler("onClientBrowserCreated", browser, createIt) addEventHandler("onClientClick", root, function(button, state) if state == "down" then injectBrowserMouseDown(browser, button) outputChatBox("Injected") else injectBrowserMouseUp(browser, button) outputChatBox("InjectedUp") end end) So that is my code. Seems like it doesnt detect my clicks on the website, but mta detects it fine? (Outputting to chat) Any ideas how to fix this? Link to comment
Miika Posted June 8, 2015 Share Posted June 8, 2015 Are you using mta 1.5 nightly? Because it's under developing, all services maybe not work. Link to comment
K4stic Posted June 8, 2015 Share Posted June 8, 2015 **Be sure that you use MTA 1.5 On line 13 at Function "loadBrowserURL" instead of Source put the browser Element like you did and in line 14 at Function "focusBrowser" may code not work because of this as i don't see anything else to be wrong Link to comment
Mr.unpredictable. Posted June 8, 2015 Share Posted June 8, 2015 (edited) Are you using mta 1.5 nightly?Because it's under developing, all services maybe not work. It works fine for me, Check my video So that is my code. Seems like it doesnt detect my clicks on the website, but mta detects it fine? (Outputting to chat) Any ideas how to fix this? You didn't inject mouse movement use the event onClientCursorMove and injectBrowserMouseMove function to do that anyway try this local sW, sH = guiGetScreenSize() local browser = createBrowser(sW,sH,false,false) function renderYt() dxDrawImage(0,0,sW,sH,browser,0,0,0,tocolor(255,255,255,255),true) showCursor(true) end function createIt() loadBrowserURL(source,"https://www.youtube.com/watch?v=RgKAFK5djSk") focusBrowser(browser) addEventHandler("onClientRender", root, renderYt) end addEventHandler("onClientBrowserCreated", browser, createIt) addEventHandler("onClientClick", root, function(button, state) if state == "down" then injectBrowserMouseDown(browser, button) outputChatBox("Injected") else injectBrowserMouseUp(browser, button) outputChatBox("InjectedUp") end end) addEventHandler ( "onClientCursorMove", root, function ( relativeX , relativeY , absoluteX , absoluteY ) injectBrowserMouseMove ( browser, absoluteX , absoluteY) end ) Edited June 8, 2015 by Guest Link to comment
albers14 Posted June 8, 2015 Author Share Posted June 8, 2015 Owh ye thats true. Thanks for your help man! Link to comment
Mr.unpredictable. Posted June 8, 2015 Share Posted June 8, 2015 Owh ye thats true. Thanks for your help man! Np Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now