Categories > Coding > Lua >

Auto press a key from the kayboard?

Posts: 29

Threads: 18

Joined: Oct, 2021

Reputation: 0

Posted

How can I code a software that will auto-press a key from the keyboard so I can autofarm?

  • 0

Added

Give me an example please

  • 0

Syraxes_

Web Developer

vip

Posts: 1307

Threads: 40

Joined: Jul, 2021

Reputation: 67

Replied

@TheGraySpy

 

Read the Synapse docs.

 

Synapse X Documentation

  • 0

Added

Example code:

 

keypress(0x44) -- I think, I use SentKeyEvent for compability. 
  • 0

I'm not lazy, I'm just highly motivated to do nothing. #I💚Dogs.

Posts: 29

Threads: 18

Joined: Oct, 2021

Reputation: 0

Replied

I use JJSploit.Not synapse.I want an example that contains

VirtualInputManager:SendKeyEvent
  • 0

Syraxes_

Web Developer

vip

Posts: 1307

Threads: 40

Joined: Jul, 2021

Reputation: 67

Replied

@TheGraySpy

 

game:GetService("VirtualInputManager"):SendKeyEvent(true,Enum.KeyCode.E,false,game) -- Press E key.

 

I'm on Telephone. So Credits

  • 0

I'm not lazy, I'm just highly motivated to do nothing. #I💚Dogs.

Posts: 29

Threads: 18

Joined: Oct, 2021

Reputation: 0

Replied

Namaste.I will test it to see if it works

 

  • 0

Added

When I press execute it work one time and after it doesn't work.Can you help me?

  • 0

Syraxes_

Web Developer

vip

Posts: 1307

Threads: 40

Joined: Jul, 2021

Reputation: 67

Replied

while wait() do

game:GetService("VirtualInputManager"):SendKeyEvent(true,Enum.KeyCode.E)

end

 Try with this.

  • 0

I'm not lazy, I'm just highly motivated to do nothing. #I💚Dogs.

hookfunction

fake wumat

vip

Posts: 145

Threads: 20

Joined: Aug, 2021

Reputation: 19

Replied

made this some time ago

local utf8 = {
	["A"] = 0x41,
	["B"] = 0x42,
	["C"] = 0x43,
	["D"] = 0x44,
	["E"] = 0x45,
	["F"] = 0x46,
	["G"] = 0x47,
	["H"] = 0x48,
	["I"] = 0x49,
	["J"] = 0x4A,
	["K"] = 0x4B,
	["L"] = 0x4C,
	["M"] = 0x4D,
	["N"] = 0x4E,
	["O"] = 0x4F,
	["P"] = 0x50,
	["Q"] = 0x51,
	["R"] = 0x52,
	["S"] = 0x53,
	["T"] = 0x54,
	["U"] = 0x55,
	["V"] = 0x56,
	["W"] = 0x57,
	["X"] = 0x58,
	["Y"] = 0x59,
	["Z"] = 0x5A,
}

function pressKey(key, times, delay)
	key = string.upper(key)
	for i = 1, tonumber(times) do
		keypress(utf8[key])
		wait(delay)
	end
end
function clickMouse(which, times, delay)
	local clicks = {
		["1"] = mouse1click,
		["2"] = mouse2click
	}
	local clickfunc = clicks[which]
	for i = 1, times do
		clickfunc()
		wait(delay)
	end
end
-- pressKey("w", 1, 0.5) // key to press, how many times to press it, delay after the presses? idk im from poland LMAO
-- clickMouse("1", 1, 0.5) // which mouse button ( 1 = left, 2 = right ), how many times to click it, delay after the clicks
  • 0

                                                                        https://cdn.discordapp.com/attachments/909012795851407390/927492917394821140/siggy.png

Syraxes_

Web Developer

vip

Posts: 1307

Threads: 40

Joined: Jul, 2021

Reputation: 67

Replied

@hookfunction

 

Vouch very cool scripts. Thanks!!

  • 0

I'm not lazy, I'm just highly motivated to do nothing. #I💚Dogs.

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )