Recent Posts

Pages: 1 ... 5 6 7 8 9 [10]
91
Support / Compile error on Raspbian
« Last post by illustris on 14 February, 2016, 15:08:03 »
I'm trying to compile ptokax on raspbian. I followed the instructions at wiki ptokax org/doku.php?id=guides:debian_bugbuntu
Compiling works with LUA5.2, but some of the scripts i want don't work with LUA5.2. Compiling with LUA5.1 gives the following error :

Code: [Select]
root@raspberrypi:~/PtokaX# make -f makefile-sqlite
c++ -O -g -Wall -Wextra -D_WITH_SQLITE -Iskein/Optimized_32bit -I/usr/include -I/usr/include/lua5.3 -c /root/PtokaX/core/colUsers.cpp -o /root/PtokaX/obj/colUsers.o
c++ -O -g -Wall -Wextra -D_WITH_SQLITE -Iskein/Optimized_32bit -I/usr/include -I/usr/include/lua5.3 -c /root/PtokaX/core/DB-SQLite.cpp -o /root/PtokaX/obj/DB-SQLite.o
c++ -O -g -Wall -Wextra -D_WITH_SQLITE -Iskein/Optimized_32bit -I/usr/include -I/usr/include/lua5.3 -c /root/PtokaX/core/DcCommands.cpp -o /root/PtokaX/obj/DcCommands.o
c++ -O -g -Wall -Wextra -D_WITH_SQLITE -Iskein/Optimized_32bit -I/usr/include -I/usr/include/lua5.3 -c /root/PtokaX/core/DeFlood.cpp -o /root/PtokaX/obj/DeFlood.o
c++ -O -g -Wall -Wextra -D_WITH_SQLITE -Iskein/Optimized_32bit -I/usr/include -I/usr/include/lua5.3 -c /root/PtokaX/core/eventqueue.cpp -o /root/PtokaX/obj/eventqueue.o
c++ -O -g -Wall -Wextra -D_WITH_SQLITE -Iskein/Optimized_32bit -I/usr/include -I/usr/include/lua5.3 -c /root/PtokaX/core/GlobalDataQueue.cpp -o /root/PtokaX/obj/GlobalDataQueue.o
c++ -O -g -Wall -Wextra -D_WITH_SQLITE -Iskein/Optimized_32bit -I/usr/include -I/usr/include/lua5.3 -c /root/PtokaX/core/hashBanManager.cpp -o /root/PtokaX/obj/hashBanManager.o
c++ -O -g -Wall -Wextra -D_WITH_SQLITE -Iskein/Optimized_32bit -I/usr/include -I/usr/include/lua5.3 -c /root/PtokaX/core/hashUsrManager.cpp -o /root/PtokaX/obj/hashUsrManager.o
c++ -O -g -Wall -Wextra -D_WITH_SQLITE -Iskein/Optimized_32bit -I/usr/include -I/usr/include/lua5.3 -c /root/PtokaX/core/hashRegManager.cpp -o /root/PtokaX/obj/hashRegManager.o
c++ -O -g -Wall -Wextra -D_WITH_SQLITE -Iskein/Optimized_32bit -I/usr/include -I/usr/include/lua5.3 -c /root/PtokaX/core/HubCommands.cpp -o /root/PtokaX/obj/HubCommands.o
In file included from /root/PtokaX/core/HubCommands.cpp:31:0:
/root/PtokaX/core/LuaInc.h:26:18: fatal error: lua.h: No such file or directory
  #include <lua.h>
                  ^
compilation terminated.
makefile-sqlite:184: recipe for target '/root/PtokaX/obj/HubCommands.o' failed
make: *** [/root/PtokaX/obj/HubCommands.o] Error 1

I have installed all the required libraries, although installing lua5.1 had this warning :
Note, selecting 'liblua5.1-0-dev' instead of 'liblua5.1-dev'
92
Feature Proposals / Re: Unicode support
« Last post by PPK on 11 February, 2016, 16:57:30 »
Yes, it is actually "under construction" http://forum.ptokax.org/index.php?topic=8848.0  ;)
93
Feature Proposals / Unicode support
« Last post by RPGamer on 11 February, 2016, 09:38:15 »
Will future releases support Unicode languages? (utf-8)
Whenever I try to use my native language, it comes as boxes indicating that it is not supported.
94
Already noticed ;-)
Change Line 557:             local s,e,genre,request = string.find( data, "%b<> %p%w+%s(.*)%s(.*)|$")
into:            local s,e,genre,request = data:find("%b<>%s+%S+%s+(%S+)%s+(.*)|$")
and in Line 570.                                                table.insert(RelCfg.Rel,RequestUpdate)
is a small typo, it should be RelCfg.Req,RequestUpdate
The easiest way to tackle TV Series would be TV-Series because you would get the same problem at release section..
[09:00:29] <PtokaX> Genre: TV-Series is added by [NL]-Harrie to the ReleaseBot
[09:00:56] <PtokaX> Request: anything new is added by [NL]-Harrie to the RequestBot under genre: TV-Series
Theres only one small problem to tackle, if you try to show request for a section thats not used, it shows an empty list, should give error on empty section..

95
I found the error, it was a syntax error. The correct line is:
local s,e,genre,request = string.find(data, "%b<> %p%w+%s(.*)%s(.*)|$")

Now a new problem arises (lol):
I tried to add request "Person of Interest Season 5" under genre "TV Series", but gives me the following reply by hub bot:
Quote
The genre: >> TV Series Person of Interest Season << is not available yet..
The table of request is also empty when viewed.

EDIT:

I tinkered around the code and now it's almost solved. Now the code for addreq is:
Code: [Select]
addreq = function(user,data)
if user then
local s,e,genre,request = string.find( data, "%b<> %p%w+%s(%S+)%s(.+)|$")
if not request  then
return "Error!, Use: "..RelCfg.Pfx..
"addreq <genre> <request>"
else
for i,v in pairs(RelCfg.Req) do
if v["Request"] == request then
return "*** The request: >> "..v["Request"].." << is already added to the RequestBot"
end
end
for i,v in pairs(RelCfg.Bu) do
if v["Genre"] == genre then
RequestUpdate = {["Genre"] = genre,["Request"] = request,["Name"] = user.sNick,["Date"] = os.date(),["Time"] = os.time(),}
table.insert(RelCfg.Req,RequestUpdate) -- was error
Core.SendToAll("<"..RelCfg.Bot.."> Request: "..request.." is added by "..user.sNick.." to the RequestBot under genre: "..v["Genre"].."|")
Save_File(RelCfg.ReqFile,RelCfg.Req,"RelCfg.Req")
return "Done!!"
else
msg = "*** The genre: >> "..genre.." << is not available yet.."
end
end
return msg
end
else
return "Add A Request"," %[line:Genre] %[line:Request]"," %[line:Genre] %[line:Request]",
-- profiles aan of uit
{[-1] = 0,[0] = 1,[1] = 1,[2] = 1,[3] = 1,[4] = 0,[5] = 0,[6] = 0,}
end
end,

The problem: only one word is being absorbed (taken into account) when reading the genre name for comparison (instead of TV Series, the function is reading it as TV) and then gives the error:
Quote
The genre: >> TV << is not available yet..
96
I'll take a look at it today, has to be a small typo or missing a sign somewhere, could be I changed a line to many to.. :(
97
It was already data.find in that line when error was showing up. I tried changing it to string.find and still the error persists. Seems to be a data type mismatch.
98
Try changing string.find(data,  into   data.find(  in the line giving you the error
99
@the-master
I tried your code and replaced all the sections that you edited or corrected the indentation, but whenever I try to add a new request this error occurs:
Quote
Ptokax\scripts\ReleaseBot_Daywalker.lua:558: bad argument #2 to 'find' (string expected, got no value)
stack traceback:
   [C]: in function 'find'
        Ptokax\scripts\ReleaseBot_Daywalker.lua:558: in function '?'
        Ptokax\scripts\ReleaseBot_Daywalker.lua:151: in function <...kh\Downloads\Ptokax\scripts\ReleaseBot_Daywalker.lua:129>
Add Release seems to be working now, though I might edit it for having an extra field for magnet links.
PS: If you could highlight line no.s while changing, that would be appreciated: I'd learn that way. I'm unable to do a side by side comparison of text...
100
Request for scripts / Re: Block unregistered users from downloading
« Last post by the-master on 25 January, 2016, 22:56:11 »
You won't find a "simple" script for this, because if you block them to connect, you will block the registered users trying to connect to them to.
If you want a more extended script, try "home" and search. :P
Pages: 1 ... 5 6 7 8 9 [10]