World of Warcraft Addon/Script question.
https://preview.redd.it/6ao89k5k7o2d1.png?width=355&format=png&auto=webp&s=3af05531d828bc922da97fa0e5812b4ea41314e3
Hello, ever since the new Cataclysm expansion launched my noscript for abbreviating the Player Frame/Target Frame/Focus Frame broke. It still works on the Player Frame only (the left 53k) but as you can see, the Target Frame is not abbreviated (53437) I also get about 30 lua errors.
The noscript I use to abbreviate that used to work is here:
hooksecurefunc("TextStatusBar_UpdateTextStringWithValues", function()
PlayerFrameHealthBar.RightText:SetText(AbbreviateNumbers(UnitHealth("player")))
PetFrameHealthBar.RightText:SetText(AbbreviateNumbers(UnitHealth("pet")))
PetFrameManaBar.RightText:SetText(AbbreviateNumbers(UnitPower("pet")))
PlayerFrameManaBar.RightText:SetText(AbbreviateNumbers(UnitPower("player")))
TargetFrameHealthBar.RightText:SetText(AbbreviateNumbers(UnitHealth("target")))
TargetFrameManaBar.RightText:SetText(AbbreviateNumbers(UnitPower("target")))
FocusFrameHealthBar.RightText:SetText(AbbreviateNumbers(UnitHealth("focus")))
FocusFrameManaBar.RightText:SetText(AbbreviateNumbers(UnitPower("focus")))
end)
https://redd.it/1d0q7sz
@r_lua
https://preview.redd.it/6ao89k5k7o2d1.png?width=355&format=png&auto=webp&s=3af05531d828bc922da97fa0e5812b4ea41314e3
Hello, ever since the new Cataclysm expansion launched my noscript for abbreviating the Player Frame/Target Frame/Focus Frame broke. It still works on the Player Frame only (the left 53k) but as you can see, the Target Frame is not abbreviated (53437) I also get about 30 lua errors.
The noscript I use to abbreviate that used to work is here:
hooksecurefunc("TextStatusBar_UpdateTextStringWithValues", function()
PlayerFrameHealthBar.RightText:SetText(AbbreviateNumbers(UnitHealth("player")))
PetFrameHealthBar.RightText:SetText(AbbreviateNumbers(UnitHealth("pet")))
PetFrameManaBar.RightText:SetText(AbbreviateNumbers(UnitPower("pet")))
PlayerFrameManaBar.RightText:SetText(AbbreviateNumbers(UnitPower("player")))
TargetFrameHealthBar.RightText:SetText(AbbreviateNumbers(UnitHealth("target")))
TargetFrameManaBar.RightText:SetText(AbbreviateNumbers(UnitPower("target")))
FocusFrameHealthBar.RightText:SetText(AbbreviateNumbers(UnitHealth("focus")))
FocusFrameManaBar.RightText:SetText(AbbreviateNumbers(UnitPower("focus")))
end)
https://redd.it/1d0q7sz
@r_lua
NEED HELP TRIGGERING ANIMATION
Hello, I am new to noscripting and I am trying to make a humanoid play an animation when walking through a part.
The trigger part.
When walking through this part, the part is supposed to bed destroyed then the Humanoid spawns in playing and triggers another noscript to play the animation and sound. The sound plays and the Humanoid does spawn in for 3 seconds as intended but the animation does not play.
The Trigger noscript that destroys itself when touched and spawns the humanoid in for 3 seconds.
The noscript that is supposed to play the animation once it picks up that the Trigger Part has been destroyed.
Full explorer
So everything works as intended but the Animation does not play (I did insert an AnimationId). Please help with getting the animation to play
https://redd.it/1d0zuw9
@r_lua
Hello, I am new to noscripting and I am trying to make a humanoid play an animation when walking through a part.
The trigger part.
When walking through this part, the part is supposed to bed destroyed then the Humanoid spawns in playing and triggers another noscript to play the animation and sound. The sound plays and the Humanoid does spawn in for 3 seconds as intended but the animation does not play.
The Trigger noscript that destroys itself when touched and spawns the humanoid in for 3 seconds.
The noscript that is supposed to play the animation once it picks up that the Trigger Part has been destroyed.
Full explorer
So everything works as intended but the Animation does not play (I did insert an AnimationId). Please help with getting the animation to play
https://redd.it/1d0zuw9
@r_lua
lson: JSON+ de/serializer in pure lua
https://github.com/civboot/civlua/tree/main/lib/lson
Hey y'all, I just wrote a JSON+LSON de/serializer in pure Lua. It's public domain and clocks in at only 260 lines of code.
LSON is a new spec I created with slightly cleaner syntax than JSON as well as support for binary data, which I plan to use for the civboot project's "database" etc. It's main advantage is it supports binary data and is slightly cleaner (no commas)
https://redd.it/1d1asy4
@r_lua
https://github.com/civboot/civlua/tree/main/lib/lson
Hey y'all, I just wrote a JSON+LSON de/serializer in pure Lua. It's public domain and clocks in at only 260 lines of code.
LSON is a new spec I created with slightly cleaner syntax than JSON as well as support for binary data, which I plan to use for the civboot project's "database" etc. It's main advantage is it supports binary data and is slightly cleaner (no commas)
https://redd.it/1d1asy4
@r_lua
GitHub
civlua/lib/lson at main · civboot/civlua
self contained software to build a minimalist dev environment. - civboot/civlua
Help. I am finding Lua too complicated to work with.
Hello !
First of all, I am by no means a hater. I just want to share the experience I had with this language in the last couple of days. I am primarily a Python developer but I am also working with C++, C# and I've toyed with JavaScript in the past.
My biggest issue with this programming language is the support for errors.
Even in relatively simple applications, when there is something that goes wrong, I am really not shown any information about why my noscript is not working. Upon further investigation, I've found out that there are certain cases where I get returned a "nil" value rather than an exception. This makes it very had to debug the code as I have no clue where to look first, and that forces me to inspect the entire code without the slightest idea of what could cause the problem. At that point I must spam "print" functions to see where the code breaks (and It would seem print won't print me an object's ID if I pass it as a parameter). I don't know if I wrote a wrong variable name or if my function indeed doesn't return or gets any feedback at all. Lua seems very comfortable at throwing nil values even as function parameters, case where my function will simply do nothing rather than give an error. For context, I was working on a sockets application and compared to Python or C#, the process was very tedious.
This reminds me of when I tried to use JavaScript, where my code would do nothing and I wouldn't know why.
I know that Lua was meant to be very lightweight as an embedded language, part of which I understand, based on my limited experience, why it is considered more a noscripting language rather than a GPL.
Another things I dislike are how messy OOP can be in this language (without a proper "class" keyword) or how each statement requires the "end" word for declaration (those "end" words keep stacking and make it harder to read when looking for something specific). But these are things I can live with. But that "nil" thing scares me.
I hope I didn't sound rude in anyway, I simply shared my thoughts and experience (although limited) with this language. I am seeking for feedback and perhaps solutions to my problems.
https://redd.it/1d1e8az
@r_lua
Hello !
First of all, I am by no means a hater. I just want to share the experience I had with this language in the last couple of days. I am primarily a Python developer but I am also working with C++, C# and I've toyed with JavaScript in the past.
My biggest issue with this programming language is the support for errors.
Even in relatively simple applications, when there is something that goes wrong, I am really not shown any information about why my noscript is not working. Upon further investigation, I've found out that there are certain cases where I get returned a "nil" value rather than an exception. This makes it very had to debug the code as I have no clue where to look first, and that forces me to inspect the entire code without the slightest idea of what could cause the problem. At that point I must spam "print" functions to see where the code breaks (and It would seem print won't print me an object's ID if I pass it as a parameter). I don't know if I wrote a wrong variable name or if my function indeed doesn't return or gets any feedback at all. Lua seems very comfortable at throwing nil values even as function parameters, case where my function will simply do nothing rather than give an error. For context, I was working on a sockets application and compared to Python or C#, the process was very tedious.
This reminds me of when I tried to use JavaScript, where my code would do nothing and I wouldn't know why.
I know that Lua was meant to be very lightweight as an embedded language, part of which I understand, based on my limited experience, why it is considered more a noscripting language rather than a GPL.
Another things I dislike are how messy OOP can be in this language (without a proper "class" keyword) or how each statement requires the "end" word for declaration (those "end" words keep stacking and make it harder to read when looking for something specific). But these are things I can live with. But that "nil" thing scares me.
I hope I didn't sound rude in anyway, I simply shared my thoughts and experience (although limited) with this language. I am seeking for feedback and perhaps solutions to my problems.
https://redd.it/1d1e8az
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Help with CameraTurnScript (roblox)
I am trying to replicate the way you turn around in Baldi's Basics in Roblox, so I made a code. The thing wrong is, when i hold down the TURN_KEY and I turn around, I'm walking in the direction of when the camera turns around. I need someone to make the movement controls reversed when you hold down the TURN_KEY
https://redd.it/1d1jioz
@r_lua
I am trying to replicate the way you turn around in Baldi's Basics in Roblox, so I made a code. The thing wrong is, when i hold down the TURN_KEY and I turn around, I'm walking in the direction of when the camera turns around. I need someone to make the movement controls reversed when you hold down the TURN_KEY
https://redd.it/1d1jioz
@r_lua
Pastebin
Camera Turn Script - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
lua-fenster - Probably the most minimal cross-platform GUI library
https://github.com/jonasgeiler/lua-fenster
https://redd.it/1d1ply3
@r_lua
https://github.com/jonasgeiler/lua-fenster
https://redd.it/1d1ply3
@r_lua
GitHub
GitHub - jonasgeiler/lua-fenster: 📚 The most minimal cross-platform GUI library - now in Lua!
📚 The most minimal cross-platform GUI library - now in Lua! - jonasgeiler/lua-fenster
C++ style oop
Hello,
I made this:
Test = function(isBase, id)
---@private
local o = {
id = id or 5,
base = isBase or true,
}
o.index = o
o.getId = function(self)
return self.id
end
o.isBase = function(self)
return self.base
end
return o
end
Test2 = function(isBase, id, name)
local o = {
name = name,
}
setmetatable(o, Test(isBase, id))
return o
end
local test = Test2(true, "test")
local test1 = { Test2(false, 15, "lol"), Test2(false, 35, "lol") }
for , v in ipairs(test1) do
print(v:getId())
end
to somewhat mimic cpp style constructor at least.
So here is my question, is it correct path or it would result with unwanted behaviour?
https://redd.it/1d2z2m6
@r_lua
Hello,
I made this:
Test = function(isBase, id)
---@private
local o = {
id = id or 5,
base = isBase or true,
}
o.index = o
o.getId = function(self)
return self.id
end
o.isBase = function(self)
return self.base
end
return o
end
Test2 = function(isBase, id, name)
local o = {
name = name,
}
setmetatable(o, Test(isBase, id))
return o
end
local test = Test2(true, "test")
local test1 = { Test2(false, 15, "lol"), Test2(false, 35, "lol") }
for , v in ipairs(test1) do
print(v:getId())
end
to somewhat mimic cpp style constructor at least.
So here is my question, is it correct path or it would result with unwanted behaviour?
https://redd.it/1d2z2m6
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
A template for hybrid development between C and Lua
Symbiotic-Lua is a template for hybrid development between C and Lua, being very useful for hybrid teams, or to facilitate the creation of programs. It generates a native Windows/Linux binary, without the need to install Lua, so it can be used to build desktop apps, or run in environments that cannot install Lua.
https://github.com/OUIsolutions/Symbiotic-Lua
https://redd.it/1d3aao5
@r_lua
Symbiotic-Lua is a template for hybrid development between C and Lua, being very useful for hybrid teams, or to facilitate the creation of programs. It generates a native Windows/Linux binary, without the need to install Lua, so it can be used to build desktop apps, or run in environments that cannot install Lua.
https://github.com/OUIsolutions/Symbiotic-Lua
https://redd.it/1d3aao5
@r_lua
GitHub
GitHub - OUIsolutions/Symbiotic-Lua: a template for hybrid programming between lua and C
a template for hybrid programming between lua and C - OUIsolutions/Symbiotic-Lua
Newbie Needs Unit Test Help
I have this simple test spec:
describe("Input Capture Service", function()
local api
local inputcaptureservice
beforeeach(function()
-- Mock the API object
api = mock({
executeString = function() end
}, true)
-- Create an instance of the inputcaptureservice with the mocked API
inputcaptureservice = inputcaptureservicemodule.inputcaptureservice(api)
end)
describe("getdigits", function()
it("should call api:executeString with the correct command", function()
-- Arrange
local soundfile = "test.wav"
local maxdigits = 5
local terminator = '#'
local expectedcommand = "playandgetdigits 1 5 1 5000 # test.wav silencestream://500"
-- Act
inputcaptureservice.getdigits(soundfile, maxdigits, terminator)
-- Assert
local stub = require("luassert.stub")
assert.stub(api.executeString).was.calledwith(expectedcommand)
end)
end)
Test results:
Input Capture Service getdigits should call api:executeString with the correct command spec/inputcapturespec.lua:32: Function was never called with matching arguments.
Called with (last call if any): (values list) ((table: 0x13ff416e0)
{ executeString = { by_default = { invokes = function: 0x13ff3e530 returns = function: 0x13ff3e4c0 } callback = function: 0x13ff3f650 called = function: 0x13ffca310 called_with = function: 0x13ff3e360 calls = { 1 = { ... more } } clear = function: 0x13ffca130 invokes = function: 0x13ff3e530 on_call_with = function: 0x13ff3e5d0 returned_with = function: 0x13ff3e390 returns = function: 0x13ff3e4c0 returnvals = { 1 = { ... more } } revert = function: 0x13ff3e3c0 target_key = 'executeString' target_table = { executeString = { ... more } } } }, (string) 'playandgetdigits 1 5 1 5000 # test.wav silencestream://500') Expected: (values list) ((string) 'playandgetdigits 1 5 1 5000 # test.wav silencestream://500')
I can't sort out what I'm doing wrong with the stub here.
I've verified that the expected string is indeed being passed down the line correctly.
It's my first four days with Lua, pls halp, lol
https://redd.it/1d3lotl
@r_lua
I have this simple test spec:
describe("Input Capture Service", function()
local api
local inputcaptureservice
beforeeach(function()
-- Mock the API object
api = mock({
executeString = function() end
}, true)
-- Create an instance of the inputcaptureservice with the mocked API
inputcaptureservice = inputcaptureservicemodule.inputcaptureservice(api)
end)
describe("getdigits", function()
it("should call api:executeString with the correct command", function()
-- Arrange
local soundfile = "test.wav"
local maxdigits = 5
local terminator = '#'
local expectedcommand = "playandgetdigits 1 5 1 5000 # test.wav silencestream://500"
-- Act
inputcaptureservice.getdigits(soundfile, maxdigits, terminator)
-- Assert
local stub = require("luassert.stub")
assert.stub(api.executeString).was.calledwith(expectedcommand)
end)
end)
Test results:
Input Capture Service getdigits should call api:executeString with the correct command spec/inputcapturespec.lua:32: Function was never called with matching arguments.
Called with (last call if any): (values list) ((table: 0x13ff416e0)
{ executeString = { by_default = { invokes = function: 0x13ff3e530 returns = function: 0x13ff3e4c0 } callback = function: 0x13ff3f650 called = function: 0x13ffca310 called_with = function: 0x13ff3e360 calls = { 1 = { ... more } } clear = function: 0x13ffca130 invokes = function: 0x13ff3e530 on_call_with = function: 0x13ff3e5d0 returned_with = function: 0x13ff3e390 returns = function: 0x13ff3e4c0 returnvals = { 1 = { ... more } } revert = function: 0x13ff3e3c0 target_key = 'executeString' target_table = { executeString = { ... more } } } }, (string) 'playandgetdigits 1 5 1 5000 # test.wav silencestream://500') Expected: (values list) ((string) 'playandgetdigits 1 5 1 5000 # test.wav silencestream://500')
I can't sort out what I'm doing wrong with the stub here.
I've verified that the expected string is indeed being passed down the line correctly.
It's my first four days with Lua, pls halp, lol
https://redd.it/1d3lotl
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Is there an up-to date alternative to fengari?
Considering fengari-webs latest commit is 3 years ago, I would consider it more than just stale. Is there any alternatives to run Lua in a html document thats more up to date than fengari?
https://redd.it/1d3zgec
@r_lua
Considering fengari-webs latest commit is 3 years ago, I would consider it more than just stale. Is there any alternatives to run Lua in a html document thats more up to date than fengari?
https://redd.it/1d3zgec
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
LUA Executor?
Before anyone calls me a noscript kiddie, NO, I am not looking for a way to cheat in FiveM or Roblox. I am looking for a simple lua executor or a way to create one (I unfortunately don't know cpp to make injectors on my own).
Why? I am currently having fun decompiling Farming Simulator 2011 and fiddling around with it's source code and I was wondering if I can change game's boolean values or execute functions while the game is running since it was written in lua. Apologies if my post violates the rules. I am just a bored developer. Cheers :)
https://redd.it/1d4cxgu
@r_lua
Before anyone calls me a noscript kiddie, NO, I am not looking for a way to cheat in FiveM or Roblox. I am looking for a simple lua executor or a way to create one (I unfortunately don't know cpp to make injectors on my own).
Why? I am currently having fun decompiling Farming Simulator 2011 and fiddling around with it's source code and I was wondering if I can change game's boolean values or execute functions while the game is running since it was written in lua. Apologies if my post violates the rules. I am just a bored developer. Cheers :)
https://redd.it/1d4cxgu
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
I need help to make this work
Good day, I'm trying to make a Cheat Table work for a game (Persona Q), and I keep getting this error:
Error:[string "---------------------------..."\]:369: attempt to index a nil value (local 'f')
366 --- returns the contents of a file in a given path
367 function readAll(file)
368 local f = io.open(file, "rb")
369 local content = f:read("*all"); f:close()
370 return content
371 end
The section of the code in question... (I know nothing about code, so apologies if it's something obvious)
https://github.com/zarroboogs/pq-ct/blob/master/citra-pq.CT
And this here is the github page
https://redd.it/1d4dxl1
@r_lua
Good day, I'm trying to make a Cheat Table work for a game (Persona Q), and I keep getting this error:
Error:[string "---------------------------..."\]:369: attempt to index a nil value (local 'f')
366 --- returns the contents of a file in a given path
367 function readAll(file)
368 local f = io.open(file, "rb")
369 local content = f:read("*all"); f:close()
370 return content
371 end
The section of the code in question... (I know nothing about code, so apologies if it's something obvious)
https://github.com/zarroboogs/pq-ct/blob/master/citra-pq.CT
And this here is the github page
https://redd.it/1d4dxl1
@r_lua
GitHub
pq-ct/citra-pq.CT at master · zarroboogs/pq-ct
A cheat table for Persona Q @ Citra. Contribute to zarroboogs/pq-ct development by creating an account on GitHub.
What do I think about Lua after shipping a project with 60,000 lines of Lua code?
https://blog.luden.io/what-do-i-think-about-lua-after-shipping-a-project-with-60-000-lines-of-code-bf72a1328733
https://redd.it/1d53qff
@r_lua
https://blog.luden.io/what-do-i-think-about-lua-after-shipping-a-project-with-60-000-lines-of-code-bf72a1328733
https://redd.it/1d53qff
@r_lua
Medium
What do I think about Lua after shipping a project with 60,000 lines of code?
Lead programmer talks Lua’s flexibility, challenges, and integration with Defold game engine after 60k lines of code in Craftomation 101.
Luaforwindows Luarocks error
C:\\Users\\####>luarocks install protobuf
Installing http://luarocks.org/repositories/rocks/protobuf-1.1.2-0.rockspec...
Cloning into 'protobuf-lua'...
fatal: unable to connect to github.com:
github.com[0: 140.82.121.3\]: errno=Unknown error
Error: Failed fetching files from GIT while cloning
https://redd.it/1d55brt
@r_lua
C:\\Users\\####>luarocks install protobuf
Installing http://luarocks.org/repositories/rocks/protobuf-1.1.2-0.rockspec...
Cloning into 'protobuf-lua'...
fatal: unable to connect to github.com:
github.com[0: 140.82.121.3\]: errno=Unknown error
Error: Failed fetching files from GIT while cloning
https://redd.it/1d55brt
@r_lua
LUA Table ripple load
I need to create a LUA table (20 elements) and always write new values to newTable[20\]=newValue. On the next iteration of the write to index 20 the value at newTable[20\] needs to go to newTable[19\], and repeat until the original value falls off the top. I don't know what this is called, and suspect it's been done before. Is there a LUA library function that does this kind of thing? Thanks.
https://redd.it/1d5oyiz
@r_lua
I need to create a LUA table (20 elements) and always write new values to newTable[20\]=newValue. On the next iteration of the write to index 20 the value at newTable[20\] needs to go to newTable[19\], and repeat until the original value falls off the top. I don't know what this is called, and suspect it's been done before. Is there a LUA library function that does this kind of thing? Thanks.
https://redd.it/1d5oyiz
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Lua for reaper reanoscript
Anyone here learn to code specifically for that scenario? How long did it take to learn? I’m not sure if it’s worth it just for that.
https://redd.it/1d6puwx
@r_lua
Anyone here learn to code specifically for that scenario? How long did it take to learn? I’m not sure if it’s worth it just for that.
https://redd.it/1d6puwx
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Online Lua course recommendations
Hi all, Has anybody done any online courses to learn Lua? If so any tips in terms of good ones to look at and ones to avoid?
https://redd.it/1d7h220
@r_lua
Hi all, Has anybody done any online courses to learn Lua? If so any tips in terms of good ones to look at and ones to avoid?
https://redd.it/1d7h220
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Not understanding why my noscript isnt working | Ghub API
I'm trying to make a macro play when 2 keys have been pressed (xButton1 & G1)
My noscript always fails to work unless I remove one of the keys as a requirement to fire the macro. What am I doing wrong?
if event =="MOUSE_BUTTON_PRESSED"
and arg == 5 then
if event =="G_PRESSED"
and arg == 1 then
PlayMacro()
https://redd.it/1d84ap1
@r_lua
I'm trying to make a macro play when 2 keys have been pressed (xButton1 & G1)
My noscript always fails to work unless I remove one of the keys as a requirement to fire the macro. What am I doing wrong?
if event =="MOUSE_BUTTON_PRESSED"
and arg == 5 then
if event =="G_PRESSED"
and arg == 1 then
PlayMacro()
https://redd.it/1d84ap1
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community