Jump to content

clipboard text


Master_MTA

Recommended Posts

Posted

how i can get the clipboard text

?

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted (edited)

You can't due to privacy reasons.

Edited by John Smith
  • Confused 1

If you find my post useful or if it helped you, please like my post :)
Ingame name: ZoeN

560x95_FFFFFF_FF9900_000000_000000.png

Posted
2 minutes ago, John Smith said:

You can't due to privacy reasons.

hmmm so that mean i can't create edit box dx like gui?

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted
txt =  "" 
function setClipboard (texts) 
txt = texts 
end

function isClipboard () 
if txt ~= ""  then 
return true 
else
return false 
end
end

function getClipboard () 
return txt 
 end 
 
-- Example

 addCommandHandler("qq",
 function (cmd,...) 
 if arg ~= "" then 
  local w = table.concat({...}, " ") 
 setClipboard(w)
 outputChatBox("Done "..w.."") 
 end
 end
 )
 
 addCommandHandler("dd",
function () 
if  isClipboard ()  then 
outputChatBox(""..getClipboard().."") 
else
outputChatBox("error")
end
end 
)

 

76561198264399996.png

 

 

 

 

Posted
51 minutes ago, Ahmed Ly said:

txt =  "" 
function setClipboard (texts) 
txt = texts 
end

function isClipboard () 
if txt ~= ""  then 
return true 
else
return false 
end
end

function getClipboard () 
return txt 
 end 
 
-- Example

 addCommandHandler("qq",
 function (cmd,...) 
 if arg ~= "" then 
  local w = table.concat({...}, " ") 
 setClipboard(w)
 outputChatBox("Done "..w.."") 
 end
 end
 )
 
 addCommandHandler("dd",
function () 
if  isClipboard ()  then 
outputChatBox(""..getClipboard().."") 
else
outputChatBox("error")
end
end 
)

 

that wasn't my mean i mean if player was browser he is pc normal  then he was copy any text

then i need to get this copied text not only in mta 

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

  • Moderators
Posted

You can't 'get' it ingame.

Only 'set' it, which you can use in any other application.

 

Clear?

  • Thanks 2

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted
45 minutes ago, IIYAMA said:

You can't 'get' it ingame.

Only 'set' it, which you can use in any other application.

 

Clear?

thx

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted
19 hours ago, IIYAMA said:

You can't 'get' it ingame.

Only 'set' it, which you can use in any other application.

 

Clear?

no thing is possible for Master_MTA

small usfel function u can use it with dx edit box like i was want

with small example 

--------------------------useful function
function getClipboard()
if (getKeyState('rctrl')==true or getKeyState('lctrl')==true) and getKeyState('v')==true then
local edit= guiCreateEdit (  0,0,0,0, '',false,nil )
guiSetAlpha(edit,0)
guiEditSetCaretIndex ( edit, 0  )
local text=guiGetText(edit)
destroyElement(edit)
return text
end
return false
end
--------------------------------------------
GUIEditor = {
    edit = {},
    window = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.window[1] = guiCreateWindow(542, 304, 403, 102, "", false)
        guiWindowSetSizable(GUIEditor.window[1], false)

        GUIEditor.edit[1] = guiCreateEdit(62, 39, 279, 24, "", false, GUIEditor.window[1])    
    end
)
addEventHandler('onClientKey',root,function(btn,st)
if st then
guiSetText(GUIEditor.edit[1],getClipboard() or '')
end
end)

 

  • Like 1
  • Thanks 1

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

  • Moderators
Posted

It isn't the same as what getClipboard would do, because ctrl + v is required. But it is definitely useful.

  • Thanks 1

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted
32 minutes ago, IIYAMA said:

It isn't the same as what getClipboard would do, because ctrl + v is required. But it is definitely useful.

 

2 hours ago, Master_MTA said:

small usfel function u can use it with dx edit box like i was want

 

that i was said xD any way that will help us when we want to set Dx edit box text 

  • Like 1

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...