Lua and Skype
Lua and Skype
A friend of mine has found a dice roller that asks Skype permissions to access the messages sent and received, parses them and if it finds something like //XdY[+Z] it throws that/those di(c)e and prints the results. Is there something like a Lua interpreter that works the same way or a compiled library loadable in Lua that allows the script to access Skype messages?
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: Lua and Skype
You probably want to start here: https://developer.skype.com/
I'm sure that with Lua and something like Alien or FFI, you could hook into skype's API and do some interesting things.
As for dice rolling, that's easy. "2D6+1" would be parsed like so:
Good luck and I wish you a +2 on your Programming Skill.
I'm sure that with Lua and something like Alien or FFI, you could hook into skype's API and do some interesting things.
As for dice rolling, that's easy. "2D6+1" would be parsed like so:
Code: Select all
function dice_check( s )
local dice, sides, bonus = string.match(s, "(%d+)[dD](%d+)(.*)")
assert(dice and sides)
local sum = bonus and tonumber(bonus) or 0
for i = 1, tonumber(dice) do
sum = sum + math.random(1, tonumber(sides))
end
return sum
end
Re: Lua and Skype
I already tried there, but I couldn't figure out how to use it so I gave up after a couple of hours, thanks anyway
I don't want to create a diceroller, I'd like to have a lua interpreter that works through Skype, but thanks for the code
I don't want to create a diceroller, I'd like to have a lua interpreter that works through Skype, but thanks for the code
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Who is online
Users browsing this forum: No registered users and 2 guests