Error
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Error

Started by Markitos, 24 April, 2005, 19:31:55

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Markitos

when i start fresh stuff i get this error "Fresh Stuff.lua:123: attempt to call global `readfrom' (a nil value)" and the script doesnt work why???
   -- FreshStuff v.3.3
    -- original idea/script by chilla
    -- completely rewriten by plop
    -- if you were running 3.0 then you gotta delete the old file
    -- it's incompatible with this version
    -- deleting now goes by id number
    -- msg rotator added by bastya_elvtars (the rock n' roll doctor) - 16. 10. 04.

    Times={ -- ["time in 24h format"]="type",

    ["18:00"]="cinemas",

    ["20:00"]="destaques",

    ["15:15"]="eventos"

    }
    -- Name the commands to what U like
    -- This command adds stuff, syntax : +addalbum TYPE/CATAGORY THESTUFF2ADD
    cmd1 = "!add"

    -- This command shows the stuff, syntax : +albums with options new/game/warez/music/movie
    cmd2 = "!read"

    -- This command deletes an entry, syntax : +delalbum THESTUFF2DELETE
    cmd3 = "!del"

    -- This command shows the latest stuff, syntax : +newalbums
    cmd4 = "!new"

    -- This command reloads the txt file. syntax : !reload
    -- (this command is needed if you manualy edit the text file)
    cmd5 = "!reload"

    -- Show latest stuff on entry 1=yes, 0=no
    ShowOnEntry = 0

    -- Max stuff shown on newalbums/entry
    MaxNew = 10

    -- The file storing the stuff
    file = "txt/AlbumsAll.txt"

    -- Name of the bot
    Bot = "!'GeNi??'!?"

    -- you can add catagory's yourself ["trigger_name"]="catagory_name"
    Types = {["cinemas"] = "Cinemas", ["destaques"]="Destaques", ["eventos"]="Eventos", ["jogos"]="Jogos"}

    --------------------- don't change anything below here
    AllStuff = {}
    NewestStuff = {}

    function Main()
    frmHub:RegBot(Bot)
    ReloadRel()
    SetTimer(60000)
    StartTimer()
    end

    function NewUserConnected(user)
    if ShowOnEntry == 1 then
    user:SendPM(Bot, MsgNew.."|")
    end
    end

    function OpConnected(user)
    if ShowOnEntry == 1 then
    user:SendPM(Bot, MsgNew.."|")
    end
    end

    function DataArrival(user,data)
    if (strsub(data, 1, 1) == "<") then
    data = strsub(data,1,strlen(data)-1)
    s,e,cmd,type,tune = strfind(data, "%b<>%s+(%S+)%s*(%S*)%s*(.*)")
    if cmd == cmd2 then
    if type == "" then
    user:SendPM(Bot, MsgAll.."|")
    elseif type == "new" then
    user:SendPM(Bot, MsgNew.."|")
    elseif Types[type] then
    ShowRelType(type)
    user:SendPM(Bot, MsgType.."|")
    end
    return 1
    elseif cmd == cmd4 then
    user:SendPM(Bot, MsgNew.."|")
    return 1
    elseif user.bOperator then
    if cmd == cmd3 then
    if type ~= "" then
    DelRel(user, type)
    else
    user:SendData(Bot, "Como Se Eu Soubesse O Que ? Para Apagar!!! Syntaxe : !del n?mero de entrada cujo deseja apagar|")
    end
    return 1
    elseif cmd == cmd1 then
    if tune ~= "" and Types[type] then
    AddRel(user, tune, type)
    elseif Types[type] == nil then
    user:SendData(Bot, "Tenho Que Saber A Categoria A Adiciona-lo! Syntaxe : !add TYPE/CATAGORY THESTUFF2ADD|")
    else
    user:SendData(Bot, "yea right, like i know what you got 2 add when you don't tell me!|")
    end
    return 1
    elseif cmd == cmd5 then
    Reload()
    user:SendData(Bot, "Albums reloaded!|")
    return 1
    end
    end
    end
    end

    function OpenRel()
    AllStuff = nil
    NewestStuff = nil
    AllStuff = {}
    NewestStuff = {}
    Count = 0
    Count2 = 0
    readfrom(file)
    while 1 do
    local line = read()
    if ( line == nil ) then
    break
    else
    Count = Count +1
    AllStuff[Count]=line
    end
    end
    readfrom()
    if Count > MaxNew then
    local temp = Count - MaxNew + 1
    for i=temp, Count do
    Count2 = Count2 + 1
    NewestStuff[Count2]=AllStuff[i]
    end
    else
    for i=1, Count do
    Count2 = Count2 + 1
    NewestStuff[Count2]=AllStuff[i]
    end
    end
    end

    function ShowRel(table)
    Msg = "\r\n"
    if table == NewestStuff then
    if Count2 == 0 then
    MsgNew = "\r\n\r\n".." ___________________________________________________________________________ __________________________ \r\n\r\n Quem Quiser Publicitar Neste Espa?o Fale Com Os Operadores Ou Vip's\r\n\r\n ___________________________________________________________________________ __________________________ \r\n\r\n"
    else
    for i=1, Count2 do
    s,e,type,who,when,title=strfind(NewestStuff[i], "(.+)$(.+)$(.+)$(.+)")
    if title then
    Msg = Msg.." "..when.." -- "..who.." -- "..type.." -- "..title.."\r\n"
    else
    Msg = Msg..NewestStuff[i].."\r\n"
    end
    end
    MsgNew = "\r\n\r\n".." ___________________________________________________________________________ __________________________ "..Msg.."\r\n ___________________________________________________________________________ __________________________ \r\n\r\n"
    end
    else
    if Count == 0 then
    MsgAll = "\r\n\r\r\n".." ___________________________________________________________________________ __________________________ \r\n\r\n No releases on the list yet\r\n\r\n ___________________________________________________________________________ __________________________ \r\n\r\n"
    else
    MsgHelp = " use "..cmd2.."  to see only the selected types"
    for i=1, Count do
    s,e,type,who,when,title=strfind(AllStuff[i], "(.+)$(.+)$(.+)$(.+)")
    if title then
    Msg = Msg.." ? ID: "..i.." -- "..when.." -- "..who.." -- "..type.." -- "..title.."\r\n"
    else
    Msg = Msg..AllStuff[i].."\r\n"
    end
    end
    MsgAll = "\r\n\r\r\n".." ___________________________________________________________________________ __________________________ "..Msg.."\r\n ___________________________________________________________________________ __________________________ \r\n"..MsgHelp.."\r\n"
    end
    end
    end

    function ShowRelType(what)
    Msg = "\r\n"
    tmp = 0
    if Count == 0 then
    MsgType = "\r\n\r\n".." _____________________________________????? "..Types[what].." ?????? _________________________________________ \r\n\r\n No "..strlower(Types[what]).." yet\r\n\r\n ___________________________________________________________________________ __________________________ \r\n\r\n"
    else
    for i=1, Count do
    s,e,type,who,when,title=strfind(AllStuff[i], "(.+)$(.+)$(.+)$(.+)")
    if type == what then
    tmp = tmp + 1
    Msg = Msg.." "..when.." -- "..who.." -- "..title.."\r\n"
    end
    end
    if tmp == 0 then
    MsgType = "\r\n\r\n".." _____________________________________????? "..Types[what].." ?????? _________________________________________ \r\n\r\n No "..strlower(Types[what]).." yet\r\n\r\n ___________________________________________________________________________ __________________________ \r\n\r\n"
    else
    MsgType= "\r\n\r\n".." _____________________________________????? "..Types[what].." ?????? _________________________________________ \r\n"..Msg.."\r\n ___________________________________________________________________________ __________________________ \r\n\r\n"
    end
    end
    end

    function AddRel(user, what, type)
    Count = Count + 1
    AllStuff[Count]=(type.."$"..user.sName.."$"..date("%x").."$"..what)
    user:SendData(Bot, what.." Foi Adicionado Por "..user.sName.." A Lista De "..type.."|")
    SaveRel()
    ReloadRel()
    end

    function DelRel(user, what)
    if tonumber(what) then
    what = tonumber(what)
    if AllStuff[what] then
    local s,e,which=strfind(AllStuff[what], "([^%$]+)$")
    user:SendData(Bot, which.." Foi Apagado Da Lista Por "..user.sName.."|")
    AllStuff[what]=nil
    SaveRel()
    ReloadRel()
    else
    user:SendData(Bot, what.." n?o foi Encontrado Na Lista|")
    end
    else
    user:SendData(Bot, "Preciso Do Numero De ID Para Poder Apaga-lo|")
    end
    end

    function SaveRel()
    writeto(file)
    for i=1,Count do
    if AllStuff[i] then
    write(AllStuff[i].."\n")
    end
    end
    writeto()
    end

    function ReloadRel()
    OpenRel()
    ShowRel(NewestStuff)
    ShowRel(AllStuff)
    end

    function DelRelOld(user, what)
    Okie = nil
    for a,b in AllStuff do
    s,e,title=strfind(b, ".+$(.+)$")
    if title == what then
    AllStuff[a]=nil
    user:SendData(Bot, what.." foi apado da lista|")
    Okie = 1
    break
    end
    end
    if Okie then
    SaveRel()
    ReloadRel()
    else
    user:SendData(Bot, what.." n?o foi encontrado na lista de releases|")
    end
    end


    function RotateMsg(what)
    local Msg = "\r\n"
    local MsgType
    tmp = 0
    if Count == 0 then
    MsgType = "\r\n\r\n".." _____________________________________????? "..Types[what].." ?????? _________________________________________ \r\n\r\n No "..strlower(Types[what]).." yet\r\n\r\n ___________________________________________________________________________ __________________________ \r\n\r\n"
    else
    for i=1, Count do
    s,e,type,who,when,title=strfind(AllStuff[i], "(.+)$(.+)$(.+)$(.+)")
    if type == what then
    tmp = tmp + 1
    Msg = Msg.." "..when.." -- "..who.." -- "..title.."\r\n"
    end
    end
    if tmp == 0 then
    
    MsgType = "\r\n\r\n".." _____________________________________????? "..Types[what].." ?????? _________________________________________ \r\n\r\n No "..strlower(Types[what]).." yet\r\n\r\n ___________________________________________________________________________ __________________________ \r\n\r\n"
    else
    
    MsgType= "\r\n\r\n".." _____________________________________????? "..Types[what].." ?????? _________________________________________ \r\n\r\n No "..strlower(Types[what]).." yet\r\n\r\n ___________________________________________________________________________ __________________________ \r\n\r\n"
    end
    end
    return MsgType
    end

    function OnTimer()
    if Times[date("%H:%M")] then
    SendToAll(RotateMsg(Times[date("%H:%M")]))
    end
    end


Cheers...

jiten

That's because that script is a Lua 4 one and not compatible with the new PtokaX.
You need to convert it or if not, search the PtokaX Lua 5 Finished Scripts section. U'll find newer versions there.

Cheers

SMF spam blocked by CleanTalk