Luon: a simple, statically typed programming language for LuaJIT
https://github.com/rochus-keller/Luon/blob/master/Readme.md
https://redd.it/1hdap3i
@r_lua
https://github.com/rochus-keller/Luon/blob/master/Readme.md
https://redd.it/1hdap3i
@r_lua
GitHub
Luon/Readme.md at master · rochus-keller/Luon
A compiler and IDE for the Luon programming language - a liaison beween Lua and Oberon+ - targeting LuaJIT - rochus-keller/Luon
how do i make a way for this tile to move smoothly, my map uses a tile system
function love.draw()
love.graphics.setColor(255, 255, 255)
drawMap()
drawUi()
love.graphics.draw(player.me, player.fakex, player.fakey)
love.graphics.draw(text, 32, 32)
if(mouse.x<map.width and mouse.y<map.height) then
love.graphics.setColor(255, 255, 255, .5)
love.graphics.rectangle("fill", mouse.x32, mouse.y32, 32, 32)
end
end
function test (x, y, xd, yd)
currentTile = mapTile(x+xd,y+yd, "get") --get map tile x+x distance y+y distance
text:set(currentTile) --idk if there is a debugger for mac i just use text
if currentTile == 0 then --air
return true
elseif currentTile == 2 then --pushable
if test(x+xd, y+yd, xd, yd) == true then
map.mapxyidx(x+xd, y+yd) = 0 --pushable removed
map.mapxyidx(x+xd*2, y+yd*2) = 2 --added back in the direction player is moving
return true
else
return false
end
elseif currentTile == 1 then
return false --wall
end
https://redd.it/1hddg7j
@r_lua
function love.draw()
love.graphics.setColor(255, 255, 255)
drawMap()
drawUi()
love.graphics.draw(player.me, player.fakex, player.fakey)
love.graphics.draw(text, 32, 32)
if(mouse.x<map.width and mouse.y<map.height) then
love.graphics.setColor(255, 255, 255, .5)
love.graphics.rectangle("fill", mouse.x32, mouse.y32, 32, 32)
end
end
function test (x, y, xd, yd)
currentTile = mapTile(x+xd,y+yd, "get") --get map tile x+x distance y+y distance
text:set(currentTile) --idk if there is a debugger for mac i just use text
if currentTile == 0 then --air
return true
elseif currentTile == 2 then --pushable
if test(x+xd, y+yd, xd, yd) == true then
map.mapxyidx(x+xd, y+yd) = 0 --pushable removed
map.mapxyidx(x+xd*2, y+yd*2) = 2 --added back in the direction player is moving
return true
else
return false
end
elseif currentTile == 1 then
return false --wall
end
https://redd.it/1hddg7j
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
How do I change a variable in another file?
Sorry if this seems a bit simple, but I've been looking though a bunch of different sites and videos and couldn't find an answer.
I'm trying to edit a variable in a noscript from within another. I'm able to bring in the "corruption" noscript as an object utilising "noscript", but I can't edit any of the values inside "corruption", at least not from "noscript". Not sure if there's some specific line of code I'm missing or if I'm doing it incorrectly.
corruption.lua
--Edit these values
corrupted = 0 --How much corruption the player starts with (Default = 0)
healthDrain = 0.02 --How much health the opponent takes with each note (Default = 0.02)
--------------------------------------------------------------------------------------------------
local corruption = require("mods/Corruption Victims/modules/corruption") --This brings in the noscript successfully
corruption.healthDrain = 0.1 --This doesn't work
noscript.lua
https://redd.it/1hebaki
@r_lua
Sorry if this seems a bit simple, but I've been looking though a bunch of different sites and videos and couldn't find an answer.
I'm trying to edit a variable in a noscript from within another. I'm able to bring in the "corruption" noscript as an object utilising "noscript", but I can't edit any of the values inside "corruption", at least not from "noscript". Not sure if there's some specific line of code I'm missing or if I'm doing it incorrectly.
corruption.lua
--Edit these values
corrupted = 0 --How much corruption the player starts with (Default = 0)
healthDrain = 0.02 --How much health the opponent takes with each note (Default = 0.02)
--------------------------------------------------------------------------------------------------
local corruption = require("mods/Corruption Victims/modules/corruption") --This brings in the noscript successfully
corruption.healthDrain = 0.1 --This doesn't work
noscript.lua
https://redd.it/1hebaki
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
no recoil noscript idea for r6 siege
Hi. Do you think it would be possible to create a Luan noscript to control recoil by implementing a pixel decoder i.e. for example if the screen is moving down to the right at the same time? Would the Opposes noscript to keep the vision straight would it be possible in your opinion? and what program should I use? ps I'm new to lua and trying to understand something
https://redd.it/1heuw60
@r_lua
Hi. Do you think it would be possible to create a Luan noscript to control recoil by implementing a pixel decoder i.e. for example if the screen is moving down to the right at the same time? Would the Opposes noscript to keep the vision straight would it be possible in your opinion? and what program should I use? ps I'm new to lua and trying to understand something
https://redd.it/1heuw60
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Cool lay code sharing
So I’ve recently been working a lot on a set of roblox movement noscripts to handle things like swimming and sprinting.
While I was taking a break I was thinking what other cool lua code people are working on.
Whether you just want to talk about it or actually share it is up to you!
https://redd.it/1hf0c65
@r_lua
So I’ve recently been working a lot on a set of roblox movement noscripts to handle things like swimming and sprinting.
While I was taking a break I was thinking what other cool lua code people are working on.
Whether you just want to talk about it or actually share it is up to you!
https://redd.it/1hf0c65
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Is there a standard package manager for lua?
Hello, I come from a coding background, but am new to lua(only ever wrote noscripts for aseprite).
I'm curious is there a standard package manager for lua?
ala bundler for ruby or mix for elixir.
Some context, I found a pretty cool looking game engine(love) and figured I'd make something to get a feel for it. The getting started guide suggests installing it system wide which seems bad and some quick googling for a package manager produced multiple results, so I wasn't sure where to start.
Figured it might be a dumb question with an obvious answer so worth asking before I research it myself.
Thank you everyone for the help.
https://redd.it/1hfmptw
@r_lua
Hello, I come from a coding background, but am new to lua(only ever wrote noscripts for aseprite).
I'm curious is there a standard package manager for lua?
ala bundler for ruby or mix for elixir.
Some context, I found a pretty cool looking game engine(love) and figured I'd make something to get a feel for it. The getting started guide suggests installing it system wide which seems bad and some quick googling for a package manager produced multiple results, so I wasn't sure where to start.
Figured it might be a dumb question with an obvious answer so worth asking before I research it myself.
Thank you everyone for the help.
https://redd.it/1hfmptw
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Code Error - Need Help!
Received an error on line 14 code in Trading Station, which uses Lua. The error states "Colon (;) expected here." Here is the code through line 14. Does any one have any thoughts?
\-- ICT Breaker Block Algorithm for Trading Station
\-- Time Windows: 9:20-9:40 AM, 10:20-10:40 AM, 10:50-11:10 AM EST
\-- Parameters
local lookback = 20 -- Lookback period for swing high/low detection
local riskRewardRatio = 2 -- Risk-reward ratio for take profit
local timeWindows = {
{start = "09:20", end = "09:40"},
{start = "10:20", end = "10:40"},
{start = "10:50", end = "11:10"}
}
\-- Variables
local swingHighs = {}
local swingLows = {}
local breakerBlock = nil
local entryPrice = nil
local stopLoss = nil
local takeProfit = nil
\-- Helper function to check if the current time is within the allowed time windows
function isWithinTimeWindow(currentTime)
for _, window in ipairs(timeWindows) do
if currentTime >= window.start and currentTime <= window.end then
return true
end
end
return false
end
\-- Initialize the strategy
function Init()
strategy:name("ICT Breaker Block Strategy for NQ")
strategy:denoscription("Executes trades based on ICT Breaker Block concept during specific time windows.")
strategy.parameters:addInteger("Lookback", "Lookback period for swing high/low detection", "", lookback)
strategy.parameters:addDouble("RiskRewardRatio", "Risk-reward ratio for take profit", "", riskRewardRatio)
end
https://redd.it/1hg0d6f
@r_lua
Received an error on line 14 code in Trading Station, which uses Lua. The error states "Colon (;) expected here." Here is the code through line 14. Does any one have any thoughts?
\-- ICT Breaker Block Algorithm for Trading Station
\-- Time Windows: 9:20-9:40 AM, 10:20-10:40 AM, 10:50-11:10 AM EST
\-- Parameters
local lookback = 20 -- Lookback period for swing high/low detection
local riskRewardRatio = 2 -- Risk-reward ratio for take profit
local timeWindows = {
{start = "09:20", end = "09:40"},
{start = "10:20", end = "10:40"},
{start = "10:50", end = "11:10"}
}
\-- Variables
local swingHighs = {}
local swingLows = {}
local breakerBlock = nil
local entryPrice = nil
local stopLoss = nil
local takeProfit = nil
\-- Helper function to check if the current time is within the allowed time windows
function isWithinTimeWindow(currentTime)
for _, window in ipairs(timeWindows) do
if currentTime >= window.start and currentTime <= window.end then
return true
end
end
return false
end
\-- Initialize the strategy
function Init()
strategy:name("ICT Breaker Block Strategy for NQ")
strategy:denoscription("Executes trades based on ICT Breaker Block concept during specific time windows.")
strategy.parameters:addInteger("Lookback", "Lookback period for swing high/low detection", "", lookback)
strategy.parameters:addDouble("RiskRewardRatio", "Risk-reward ratio for take profit", "", riskRewardRatio)
end
https://redd.it/1hg0d6f
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Looking for a Lua Fullstack Developer - Serverless Web Apps for a German Startup
Hey everyone, i've posted here a couple of times about the platform that the startup i work for is developing.
It's a german startup called Tenum and we're looking for a Lua fullstack developer (preferably as a freelancer) to help us build serverless web applications on our platform. The platform is still under development, but already a great experience to get things done fast.
If you have solid experience with Lua and web development and would like to work with a new technology on various customer projects, I'd love to hear from you.
This would be the ideal process:
1. After you've contacted me here on Reddit or via email, we'll set up a quick call with the founder.
2. Then we'll show you the platform and discuss the details.
3. If there's a fit, we'll start working together.
We'd prefer someone whose time zone is well aligned with ours (CET).
If you're interested, dm me or email me at hello@tenum.ai with a short note about yourself and your experience.
Thanks a lot!
https://redd.it/1hgenoi
@r_lua
Hey everyone, i've posted here a couple of times about the platform that the startup i work for is developing.
It's a german startup called Tenum and we're looking for a Lua fullstack developer (preferably as a freelancer) to help us build serverless web applications on our platform. The platform is still under development, but already a great experience to get things done fast.
If you have solid experience with Lua and web development and would like to work with a new technology on various customer projects, I'd love to hear from you.
This would be the ideal process:
1. After you've contacted me here on Reddit or via email, we'll set up a quick call with the founder.
2. Then we'll show you the platform and discuss the details.
3. If there's a fit, we'll start working together.
We'd prefer someone whose time zone is well aligned with ours (CET).
If you're interested, dm me or email me at hello@tenum.ai with a short note about yourself and your experience.
Thanks a lot!
https://redd.it/1hgenoi
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Logitech g hub Lia noscripts not working on steam but work on Ubisoft. Why is that?
Can somone help me with my lua noscripts they will not work when I launch the game through steam?
https://redd.it/1hgjsn2
@r_lua
Can somone help me with my lua noscripts they will not work when I launch the game through steam?
https://redd.it/1hgjsn2
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Beginning
I really want to start Lua as a hobby to make games but have absolutely no idea on where/how to start. Anyone please help me.
https://redd.it/1hgnv52
@r_lua
I really want to start Lua as a hobby to make games but have absolutely no idea on where/how to start. Anyone please help me.
https://redd.it/1hgnv52
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Short Ai
Hi everybody, I made a small ai that kinda works. You can use it by using copy and pasting it and typing in the console commands like “I like dancing” or “I hate cats.”
math.randomseed(os.time()) -- Randomize for variability
-- Memory system to store user preferences
local memory = {}
-- Expanded knowledge base with new categories
local knowledgeBase = {
greetings = {
{ word = "hello", response = "Hey there! How’s it going?" },
{ word = "hi", response = "Hi! What’s up?" },
{ word = "hey", response = "Hey! How are you?" }
},
farewells = {
{ word = "bye", response = "Goodbye! See you soon." },
{ word = "goodbye", response = "Take care! Until next time." }
},
affirmatives = {
{ word = "yes", response = "Alright! That sounds good to me." },
{ word = "sure", response = "Sure thing!" }
},
negatives = {
{ word = "no", response = "That’s okay, maybe next time." },
{ word = "never", response = "Fair enough, we’ll leave it at that." }
},
commonwords = {
{ word = "I", response = "Tell me more about yourself!" },
{ word = "the", response = "Got it! Let's keep going." },
{ word = "and", response = "Alright, I’m listening!" },
{ word = "a", response = "That’s interesting! Keep going." }
},
emotions = {
{ word = "happy", response = "It’s great to hear you’re happy!" },
{ word = "sad", response = "I’m here for you if you want to talk." },
{ word = "excited", response = "Excitement is contagious! Tell me more!" }
},
actions = {
{ word = "run", response = "Running is a great way to stay fit!" },
{ word = "walk", response = "A nice walk can clear your mind." },
{ word = "jump", response = "Jumping around sounds fun!" }
},
animals = {
{ word = "dog", response = "Dogs are amazing companions!" },
{ word = "cat", response = "Cats can be so playful and curious!" },
{ word = "lion", response = "Lions are truly majestic creatures." }
},
nature = {
{ word = "mountain", response = "Mountains are breathtaking, aren’t they?" },
{ word = "river", response = "Rivers bring such peace and beauty." },
{ word = "forest", response = "Forests are full of life and mystery." }
},
colors = {
{ word = "red", response = "Red is such a bold and vibrant color!" },
{ word = "blue", response = "Blue always feels calm and peaceful." },
{ word = "green", response = "Green reminds me of nature and life!" }
}
}
-- Split input into words
function splitWords(input)
local words = {}
for word in input:lower():gmatch("%S+") do
table.insert(words, word)
end
return words
end
-- Find matches in the knowledge base
function findMatches(words)
for , inputWord in ipairs(words) do
for , entries in pairs(knowledgeBase) do
for , entry in ipairs(entries) do
if inputWord == entry.word:lower() then
return entry.response
end
end
end
end
return nil
end
-- Update memory system
function updateMemory(words)
local memoryKeywords = { "like", "love", "enjoy", "hate", "dislike" }
for i, word in ipairs(words) do
for , key in ipairs(memoryKeywords) do
if word == key and words[i + 1] then
local topic = words[i + 1]
memory[topic] = key
return "Got it! I’ll remember you " .. key .. " '" .. topic .. "'."
end
end
end
return nil
end
-- Generate response
function generateResponse(words)
-- Update memory if user specifies preferences
local memoryResponse = updateMemory(words)
if memoryResponse then return memoryResponse end
-- Find and return a response if a match exists
local response = findMatches(words)
if response then
return response
end
-- Check memory for known topics
for , word in ipairs(words) do
Hi everybody, I made a small ai that kinda works. You can use it by using copy and pasting it and typing in the console commands like “I like dancing” or “I hate cats.”
math.randomseed(os.time()) -- Randomize for variability
-- Memory system to store user preferences
local memory = {}
-- Expanded knowledge base with new categories
local knowledgeBase = {
greetings = {
{ word = "hello", response = "Hey there! How’s it going?" },
{ word = "hi", response = "Hi! What’s up?" },
{ word = "hey", response = "Hey! How are you?" }
},
farewells = {
{ word = "bye", response = "Goodbye! See you soon." },
{ word = "goodbye", response = "Take care! Until next time." }
},
affirmatives = {
{ word = "yes", response = "Alright! That sounds good to me." },
{ word = "sure", response = "Sure thing!" }
},
negatives = {
{ word = "no", response = "That’s okay, maybe next time." },
{ word = "never", response = "Fair enough, we’ll leave it at that." }
},
commonwords = {
{ word = "I", response = "Tell me more about yourself!" },
{ word = "the", response = "Got it! Let's keep going." },
{ word = "and", response = "Alright, I’m listening!" },
{ word = "a", response = "That’s interesting! Keep going." }
},
emotions = {
{ word = "happy", response = "It’s great to hear you’re happy!" },
{ word = "sad", response = "I’m here for you if you want to talk." },
{ word = "excited", response = "Excitement is contagious! Tell me more!" }
},
actions = {
{ word = "run", response = "Running is a great way to stay fit!" },
{ word = "walk", response = "A nice walk can clear your mind." },
{ word = "jump", response = "Jumping around sounds fun!" }
},
animals = {
{ word = "dog", response = "Dogs are amazing companions!" },
{ word = "cat", response = "Cats can be so playful and curious!" },
{ word = "lion", response = "Lions are truly majestic creatures." }
},
nature = {
{ word = "mountain", response = "Mountains are breathtaking, aren’t they?" },
{ word = "river", response = "Rivers bring such peace and beauty." },
{ word = "forest", response = "Forests are full of life and mystery." }
},
colors = {
{ word = "red", response = "Red is such a bold and vibrant color!" },
{ word = "blue", response = "Blue always feels calm and peaceful." },
{ word = "green", response = "Green reminds me of nature and life!" }
}
}
-- Split input into words
function splitWords(input)
local words = {}
for word in input:lower():gmatch("%S+") do
table.insert(words, word)
end
return words
end
-- Find matches in the knowledge base
function findMatches(words)
for , inputWord in ipairs(words) do
for , entries in pairs(knowledgeBase) do
for , entry in ipairs(entries) do
if inputWord == entry.word:lower() then
return entry.response
end
end
end
end
return nil
end
-- Update memory system
function updateMemory(words)
local memoryKeywords = { "like", "love", "enjoy", "hate", "dislike" }
for i, word in ipairs(words) do
for , key in ipairs(memoryKeywords) do
if word == key and words[i + 1] then
local topic = words[i + 1]
memory[topic] = key
return "Got it! I’ll remember you " .. key .. " '" .. topic .. "'."
end
end
end
return nil
end
-- Generate response
function generateResponse(words)
-- Update memory if user specifies preferences
local memoryResponse = updateMemory(words)
if memoryResponse then return memoryResponse end
-- Find and return a response if a match exists
local response = findMatches(words)
if response then
return response
end
-- Check memory for known topics
for , word in ipairs(words) do
if memoryword then
return "You told me you " .. memoryword .. " '" .. word .. "'. Do you still feel that way?"
end
end
-- Fallback response
return "Hmm, I’m not sure about that. Can you tell me more?"
end
-- Main Loop
print("AI Chat: Just type anything, and I’ll respond! Type 'exit' to quit.")
while true do
io.write("> ")
local input = io.read()
if input:lower() == "exit" then
print("Goodbye! Have a great day!")
break
else
local words = splitWords(input)
print(generateResponse(words))
end
end
https://redd.it/1hgot1a
@r_lua
return "You told me you " .. memoryword .. " '" .. word .. "'. Do you still feel that way?"
end
end
-- Fallback response
return "Hmm, I’m not sure about that. Can you tell me more?"
end
-- Main Loop
print("AI Chat: Just type anything, and I’ll respond! Type 'exit' to quit.")
while true do
io.write("> ")
local input = io.read()
if input:lower() == "exit" then
print("Goodbye! Have a great day!")
break
else
local words = splitWords(input)
print(generateResponse(words))
end
end
https://redd.it/1hgot1a
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Downgrade lua 5.3 para lua 5.1 e luarocks
# Atualmente eu estou usando lua 5.3 já instalei alguns apps nele como vlc, neovim, etc
# Quero saber se existe uma maneira de desinstalar o 5.3 e instalar o 5.1 sem quebrar os pacotes já instalado. ai vem a pergunta porque quero dar um downgrade estou tentando renderizar imagens no meu terminal kitty com plugin do neovim eu consigo já redenrizar com terminal puro mas sempre tenho problemas porque o plugin do neovim só funciona com lua 5.1 e eu já uso o 5.3 a um bom tempo. Alguem tem alguma dica do que fazer?
https://preview.redd.it/dnnp8bv20i7e1.png?width=843&format=png&auto=webp&s=e540b789d1f66cfd0f8050d80c269683efd2cbbd
https://preview.redd.it/as31cagy0i7e1.png?width=1210&format=png&auto=webp&s=8a968393a5fc9fbb23303adac0006863ad42b994
# Um exemplo do terminal renderizando puro e um exemplo de como fica meio bugado dentro do neovim mesmo não acusando erro no neovim nem no luarocks. Abaixo o exemplo da minha configuracao do plugin 3rd https://github.com/3rd/image.nvim
--
-- Filename: ~/github/dotfiles-latest/neovim/neobean/lua/plugins/image-nvim.lua
-- ~/github/dotfiles-latest/neovim/neobean/lua/plugins/image-nvim.lua
-- For dependencies see
--
--
-- -- Uncomment the following 2 lines if you use the local luarocks installation
-- -- Leave them commented to instead use
-- -- instead of luarocks.nvim
-- Notice that in the following 2 commands I'm using luaver
-- package.path = package.path
-- .. ";"
-- .. vim.fn.expand("$HOME")
-- .. "/.luaver/luarocks/3.11.05.1/share/lua/5.1/magick/?/init.lua"
-- package.path = package.path
-- .. ";"
-- .. vim.fn.expand("$HOME")
-- .. "/.luaver/luarocks/3.11.05.1/share/lua/5.1/magick/?.lua"
--
-- -- Here I'm not using luaver, but instead installed lua and luarocks directly through
-- -- homebrew
-- package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?/init.lua"
-- package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?.lua"
-- Configuração para Lua 5.1 no Arch Linux
package.path = package.path
.. ";"
.. vim.fn.expand("$HOME")
.. "/.luarocks/share/lua/5.1/magick/?/init.lua"
.. ";"
.. vim.fn.expand("$HOME")
.. "/.luarocks/share/lua/5.1/magick/?.lua"
.. ";"
.. "/usr/share/lua/5.1/?.lua"
.. ";"
.. "/usr/lib/lua/5.1/?.lua"
package.cpath = package.cpath
.. ";"
.. vim.fn.expand("$HOME")
.. "/.luarocks/lib/lua/5.1/?.so"
.. ";"
.. "/usr/lib/lua/5.1/?.so"
return {
{
-- luarocks.nvim is a Neovim plugin designed to streamline the installation
-- of luarocks packages directly within Neovim. It simplifies the process
-- of managing Lua dependencies, ensuring a hassle-free experience for
-- Neovim users.
-- https://github.com/vhyrro/luarocks.nvim
"vhyrro/luarocks.nvim",
-- this plugin needs to run before anything else
priority = 1001,
opts = {
rocks = { "magick" },
},
},
{
"3rd/image.nvim",
enabled = true,
dependencies = { "luarocks.nvim" },
config = function()
require("image").setup({
backend = "kitty",
kittymethod = "normal",
integrations = {
-- Notice these are the settings for markdown files
markdown = {
enabled = true,
clearininsertmode = false,
-- Set this to false if you don't want to render images coming from
-- a URL
downloadremoteimages = true,
-- Change this if you would only like to render the image where the
-- cursor is at
-- I set this to true, because if the file has way too many images
# Atualmente eu estou usando lua 5.3 já instalei alguns apps nele como vlc, neovim, etc
# Quero saber se existe uma maneira de desinstalar o 5.3 e instalar o 5.1 sem quebrar os pacotes já instalado. ai vem a pergunta porque quero dar um downgrade estou tentando renderizar imagens no meu terminal kitty com plugin do neovim eu consigo já redenrizar com terminal puro mas sempre tenho problemas porque o plugin do neovim só funciona com lua 5.1 e eu já uso o 5.3 a um bom tempo. Alguem tem alguma dica do que fazer?
https://preview.redd.it/dnnp8bv20i7e1.png?width=843&format=png&auto=webp&s=e540b789d1f66cfd0f8050d80c269683efd2cbbd
https://preview.redd.it/as31cagy0i7e1.png?width=1210&format=png&auto=webp&s=8a968393a5fc9fbb23303adac0006863ad42b994
# Um exemplo do terminal renderizando puro e um exemplo de como fica meio bugado dentro do neovim mesmo não acusando erro no neovim nem no luarocks. Abaixo o exemplo da minha configuracao do plugin 3rd https://github.com/3rd/image.nvim
--
-- Filename: ~/github/dotfiles-latest/neovim/neobean/lua/plugins/image-nvim.lua
-- ~/github/dotfiles-latest/neovim/neobean/lua/plugins/image-nvim.lua
-- For dependencies see
--
~/github/dotfiles-latest/neovim/neobean/README.md--
-- -- Uncomment the following 2 lines if you use the local luarocks installation
-- -- Leave them commented to instead use
luarocks.nvim-- -- instead of luarocks.nvim
-- Notice that in the following 2 commands I'm using luaver
-- package.path = package.path
-- .. ";"
-- .. vim.fn.expand("$HOME")
-- .. "/.luaver/luarocks/3.11.05.1/share/lua/5.1/magick/?/init.lua"
-- package.path = package.path
-- .. ";"
-- .. vim.fn.expand("$HOME")
-- .. "/.luaver/luarocks/3.11.05.1/share/lua/5.1/magick/?.lua"
--
-- -- Here I'm not using luaver, but instead installed lua and luarocks directly through
-- -- homebrew
-- package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?/init.lua"
-- package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?.lua"
-- Configuração para Lua 5.1 no Arch Linux
package.path = package.path
.. ";"
.. vim.fn.expand("$HOME")
.. "/.luarocks/share/lua/5.1/magick/?/init.lua"
.. ";"
.. vim.fn.expand("$HOME")
.. "/.luarocks/share/lua/5.1/magick/?.lua"
.. ";"
.. "/usr/share/lua/5.1/?.lua"
.. ";"
.. "/usr/lib/lua/5.1/?.lua"
package.cpath = package.cpath
.. ";"
.. vim.fn.expand("$HOME")
.. "/.luarocks/lib/lua/5.1/?.so"
.. ";"
.. "/usr/lib/lua/5.1/?.so"
return {
{
-- luarocks.nvim is a Neovim plugin designed to streamline the installation
-- of luarocks packages directly within Neovim. It simplifies the process
-- of managing Lua dependencies, ensuring a hassle-free experience for
-- Neovim users.
-- https://github.com/vhyrro/luarocks.nvim
"vhyrro/luarocks.nvim",
-- this plugin needs to run before anything else
priority = 1001,
opts = {
rocks = { "magick" },
},
},
{
"3rd/image.nvim",
enabled = true,
dependencies = { "luarocks.nvim" },
config = function()
require("image").setup({
backend = "kitty",
kittymethod = "normal",
integrations = {
-- Notice these are the settings for markdown files
markdown = {
enabled = true,
clearininsertmode = false,
-- Set this to false if you don't want to render images coming from
-- a URL
downloadremoteimages = true,
-- Change this if you would only like to render the image where the
-- cursor is at
-- I set this to true, because if the file has way too many images
-- it will be laggy and will take time for the initial load
onlyrenderimageatcursor = true,
-- markdown extensions (ie. quarto) can go here
filetypes = { "markdown", "vimwiki", "html" },
},
neorg = {
enabled = true,
clearininsertmode = false,
downloadremoteimages = true,
onlyrenderimageatcursor = false,
filetypes = { "norg" },
},
-- This is disabled by default
-- Detect and render images referenced in HTML files
-- Make sure you have an html treesitter parser installed
-- ~/github/dotfiles-latest/neovim/neobean/lua/plugins/treesitter.lua
html = {
enabled = true,
onlyrenderimageatcursor = true,
-- Enabling "markdown" below allows you to view html images in .md files
-- https://github.com/3rd/image.nvim/issues/234
-- filetypes = { "html", "xhtml", "htm", "markdown" },
filetypes = { "html", "xhtml", "htm" },
},
-- This is disabled by default
-- Detect and render images referenced in CSS files
-- Make sure you have a css treesitter parser installed
-- ~/github/dotfiles-latest/neovim/neobean/lua/plugins/treesitter.lua
css = {
enabled = true,
},
},
maxwidth = nil,
maxheight = nil,
maxwidthwindowpercentage = nil,
-- This is what I changed to make my images look smaller, like a
-- thumbnail, the default value is 50
-- maxheightwindowpercentage = 20,
maxheightwindowpercentage = 40,
-- toggles images when windows are overlapped
windowoverlapclearenabled = false,
windowoverlapclearftignore = { "cmpmenu", "cmpdocs", "" },
-- auto show/hide images when the editor gains/looses focus
editoronlyrenderwhenfocused = true,
-- auto show/hide images in the correct tmux window
-- In the tmux.conf add `set -g visual-activity off`
tmuxshowonlyinactivewindow = true,
-- render image files as images when opened
hijackfilepatterns = { ".png", ".jpg", ".jpeg", ".gif", ".webp", ".avif" },
})
end,
},
}
https://redd.it/1hgon09
@r_lua
onlyrenderimageatcursor = true,
-- markdown extensions (ie. quarto) can go here
filetypes = { "markdown", "vimwiki", "html" },
},
neorg = {
enabled = true,
clearininsertmode = false,
downloadremoteimages = true,
onlyrenderimageatcursor = false,
filetypes = { "norg" },
},
-- This is disabled by default
-- Detect and render images referenced in HTML files
-- Make sure you have an html treesitter parser installed
-- ~/github/dotfiles-latest/neovim/neobean/lua/plugins/treesitter.lua
html = {
enabled = true,
onlyrenderimageatcursor = true,
-- Enabling "markdown" below allows you to view html images in .md files
-- https://github.com/3rd/image.nvim/issues/234
-- filetypes = { "html", "xhtml", "htm", "markdown" },
filetypes = { "html", "xhtml", "htm" },
},
-- This is disabled by default
-- Detect and render images referenced in CSS files
-- Make sure you have a css treesitter parser installed
-- ~/github/dotfiles-latest/neovim/neobean/lua/plugins/treesitter.lua
css = {
enabled = true,
},
},
maxwidth = nil,
maxheight = nil,
maxwidthwindowpercentage = nil,
-- This is what I changed to make my images look smaller, like a
-- thumbnail, the default value is 50
-- maxheightwindowpercentage = 20,
maxheightwindowpercentage = 40,
-- toggles images when windows are overlapped
windowoverlapclearenabled = false,
windowoverlapclearftignore = { "cmpmenu", "cmpdocs", "" },
-- auto show/hide images when the editor gains/looses focus
editoronlyrenderwhenfocused = true,
-- auto show/hide images in the correct tmux window
-- In the tmux.conf add `set -g visual-activity off`
tmuxshowonlyinactivewindow = true,
-- render image files as images when opened
hijackfilepatterns = { ".png", ".jpg", ".jpeg", ".gif", ".webp", ".avif" },
})
end,
},
}
https://redd.it/1hgon09
@r_lua
GitHub
Render HTML images in markdown files · Issue #234 · 3rd/image.nvim
If I open an HTML or CSS file I can render the images in them because of these options html = { enabled = true, }, css = { enabled = true, }, So in my html file I do see the following image rendere...
What’s the difference between “else” and “elseif”?
I am a beginner who just recently started learning off YouTube.
Most of the things I can make out what they mean after watching some videos
But I still don't understand the meaning of the "elseif" statement
I know some degree of visual programming (scratch...), so I for sure know what the "if" and "else" statement means.
But for "elseif", I don't quite understand what the statement does
Like I can say things like
>variable = 2
>if variable == 1 then
> print("blah")
>else
> print("blee")
(correct me if I made a mistake in my example)
Something like this
I figured if I use "elseif", the results will be the same
So what's the purpose of the "elseif" statement?
https://redd.it/1hgurz3
@r_lua
I am a beginner who just recently started learning off YouTube.
Most of the things I can make out what they mean after watching some videos
But I still don't understand the meaning of the "elseif" statement
I know some degree of visual programming (scratch...), so I for sure know what the "if" and "else" statement means.
But for "elseif", I don't quite understand what the statement does
Like I can say things like
>variable = 2
>if variable == 1 then
> print("blah")
>else
> print("blee")
(correct me if I made a mistake in my example)
Something like this
I figured if I use "elseif", the results will be the same
So what's the purpose of the "elseif" statement?
https://redd.it/1hgurz3
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Where to start?
I want to start Lua for fun so I can program on Roblox, I really want to start learning but don’t know where to start. Most coding websites just throw you straight in, but I want the ABSOLUTE beginner help. What I want is like a website or tutorial on Youtube but I doesn’t matter about platform.
Please!!
https://redd.it/1hgzm21
@r_lua
I want to start Lua for fun so I can program on Roblox, I really want to start learning but don’t know where to start. Most coding websites just throw you straight in, but I want the ABSOLUTE beginner help. What I want is like a website or tutorial on Youtube but I doesn’t matter about platform.
Please!!
https://redd.it/1hgzm21
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Can one determine total gc memory allocated?
If I understand correctly,
https://redd.it/1hh09uz
@r_lua
If I understand correctly,
collectgarbage 'count' gives the amount of allocated memory at the time of invocation. Is there a way in standard Lua/LuaJIT to determine the total memory including that previously collected at the time of invocation? That is, is there a way without modifying Lua itself to determine/benchmark how allocation heavy a piece of code is over a particular run? I'm thinking of something like get-bytes-consed from the SBCL Lisp implementation. Something similar to *gc-run-time* might be nice too.https://redd.it/1hh09uz
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
My lua noscripts do not work when I launch r6 through steam but when I load up a different account through Ubisoft they work can somone help me get them working for stream?
My lua noscripts do not work when I launch r6 through steam but when I load up a different account through Ubisoft they work can somone help me get them working for stream?
https://redd.it/1hh2yvd
@r_lua
My lua noscripts do not work when I launch r6 through steam but when I load up a different account through Ubisoft they work can somone help me get them working for stream?
https://redd.it/1hh2yvd
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
How do i make a configuration file that a lua reads from?
Hi, i want to make my lua noscript read from a .cfg or a .txt or whatever format is the easiest to toggle things inside it's menu
The code for what controls the checkboxes, sliders, dropboxes looks like this:
What i want is to have somewhere my lua reads from to see what to toggle on and off as a configuration file for the lua noscript, how can i do this, hopefully i gave enough information for people to help me, if not please let me know
https://redd.it/1hi0ur0
@r_lua
Hi, i want to make my lua noscript read from a .cfg or a .txt or whatever format is the easiest to toggle things inside it's menu
The code for what controls the checkboxes, sliders, dropboxes looks like this:
local Controls = { checkbox1 = false, checkbox2 = false, checkbox3 = false, checkbox4= true, Dropdown1 = 1, Dropdown2 = 1, Slider1 = 90, Slider1Input = "", Slider1Editing = false, } What i want is to have somewhere my lua reads from to see what to toggle on and off as a configuration file for the lua noscript, how can i do this, hopefully i gave enough information for people to help me, if not please let me know
https://redd.it/1hi0ur0
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
hello
https://preview.redd.it/wbn7acdk308e1.png?width=844&format=png&auto=webp&s=d4e48660728fd31ad8b66574865957f04e389313
Hello, I have a problem with the Fivem server because on the paid hosting the noscript package does not work, but on the free one it already works and I keep getting the following error
https://redd.it/1hij6m2
@r_lua
https://preview.redd.it/wbn7acdk308e1.png?width=844&format=png&auto=webp&s=d4e48660728fd31ad8b66574865957f04e389313
Hello, I have a problem with the Fivem server because on the paid hosting the noscript package does not work, but on the free one it already works and I keep getting the following error
https://redd.it/1hij6m2
@r_lua
Just a Lil help
Could any Lua/Luau master give me some tips on how to improve my programming? I've already learned a lot from some tutorials on YouTube (a lot). My goal is just to learn enough to be able to create a game on Roblox, as a start, of course.
Thx
https://redd.it/1hivu43
@r_lua
Could any Lua/Luau master give me some tips on how to improve my programming? I've already learned a lot from some tutorials on YouTube (a lot). My goal is just to learn enough to be able to create a game on Roblox, as a start, of course.
Thx
https://redd.it/1hivu43
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community