• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Task flood message, how to fix it

Lopaskurwa

Well-Known Member
Joined
Oct 6, 2017
Messages
936
Solutions
2
Reaction score
57
Hello, im using auto task system from otland but its really annoying when it floods auto task all over again
So example you reach level you get message "Find and kill 20 wolfs! " then after like one minute it sends same message again Find and kill 20 wolfs! and again after sometime it sends same message all over again so basically i would look to make it send just once and send it after relog which is included already.
 
then make talkaction that shows the message and delete the one from lib also making array of them and taggin each mission/task with number may make it easier for the whole thing
here is example of my TASK message upon saying !task info
LUA:
function onSay(cid, words, param)
    if(param == '') then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "!task list, check your current list of undergoing tasks.")
        return true
    end
 
    if(param == 'info') then
        local started = getPlayerStartedTasks(cid)
        if(started and #started > 0) then
            local text = ""
            local sep = ", "
            table.sort(started, (function(a, b) return (a < b) end))
            local t = 0
            for _, id in ipairs(started) do
                t = t + 1
                if t == #started - 1 then
                    sep = " and "
                elseif t == #started then
                    sep = "."
                end
                local amount = getPlayerStorageValue(cid, KILLSSTORAGE_BASE + getTaskByName(tasks[id].name or tasks[id].raceName));
            
                text = text .. "" .. (tasks[id].name or tasks[id].raceName) .. " (".. amount.."/"..(tasks[id].killsRequired)..")" .. sep;
            end
            doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"The current task" .. (#started > 1 and "s" or "") .. " that you started " .. (#started > 1 and "are" or "is") .. " " .. text)
        else
            doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"You haven't started any task yet.")
        end
    end
    return true
end
 
then make talkaction that shows the message and delete the one from lib also making array of them and taggin each mission/task with number may make it easier for the whole thing
here is example of my TASK message upon saying !task info
LUA:
function onSay(cid, words, param)
    if(param == '') then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "!task list, check your current list of undergoing tasks.")
        return true
    end

    if(param == 'info') then
        local started = getPlayerStartedTasks(cid)
        if(started and #started > 0) then
            local text = ""
            local sep = ", "
            table.sort(started, (function(a, b) return (a < b) end))
            local t = 0
            for _, id in ipairs(started) do
                t = t + 1
                if t == #started - 1 then
                    sep = " and "
                elseif t == #started then
                    sep = "."
                end
                local amount = getPlayerStorageValue(cid, KILLSSTORAGE_BASE + getTaskByName(tasks[id].name or tasks[id].raceName));
          
                text = text .. "" .. (tasks[id].name or tasks[id].raceName) .. " (".. amount.."/"..(tasks[id].killsRequired)..")" .. sep;
            end
            doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"The current task" .. (#started > 1 and "s" or "") .. " that you started " .. (#started > 1 and "are" or "is") .. " " .. text)
        else
            doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"You haven't started any task yet.")
        end
    end
    return true
end
It would be great but then if you reach level it will not send first message am i wrong, or i miss understood something? Since its auto task that appears when you reach X level
 
It would be great but then if you reach level it will not send first message am i wrong, or i miss understood something? Since its auto task that appears when you reach X level
then add second lib which will just solely tell you first task upon level ( just print message once player is that level upon advance is best but you can make it with interval. and they will know it by command then.)
 
then add second lib which will just solely tell you first task upon level ( just print message once player is that level upon advance is best but you can make it with interval. and they will know it by command then.)
So if you say to make "second lib" it would solve this whole problem because like you say it would send once when you reach level. So making talkaction is not required, and im not sure what you mean print because printing can be seen only in console so i dont understand what you mean. And adding interval isnt it kinda monkey move?
 
So if you say to make "second lib" it would solve this whole problem because like you say it would send once when you reach level. So making talkaction is not required, and im not sure what you mean print because printing can be seen only in console so i dont understand what you mean. And adding interval isnt it kinda monkey move?
depends on what you expect the function to do but yes you can just make second lib that will print it once and allow talkaction for current status and will probably work better than the original .
 
depends on what you expect the function to do but yes you can just make second lib that will print it once and allow talkaction for current status and will probably work better than the original .
Like i said i expect too send message once you reach x level and send it once you relog, thats it. Relog message is include it just need to fix that spam message once x level is reached. How do i "print" like you say
 
Like i said i expect too send message once you reach x level and send it once you relog, thats it. Relog message is include it just need to fix that spam message once x level is reached. How do i "print" like you say
simple add storage id that once player reach the level he get storage id and check for that storage id and point to correct task and "sendPlayerMessage" (print) then once he logs in print message from the storage id or temporary add him taht storage id and take it after few second interval (if he is in the level range) atleast thats how i could do it if i would not be able to fix the original

essentialy:
add local variable of StorageID to each task and turn it to 1 once it has been printed.
you could have second storageID to check if the task was finished but i guess it just does automatically jump into the next task once its done with this one?
 
simple add storage id that once player reach the level he get storage id and check for that storage id and point to correct task and "sendPlayerMessage" (print) then once he logs in print message from the storage id or temporary add him taht storage id and take it after few second interval (if he is in the level range) atleast thats how i could do it if i would not be able to fix the original

essentialy:
add local variable of StorageID to each task and turn it to 1 once it has been printed.
you could have second storageID to check if the task was finished but i guess it just does automatically jump into the next task once its done with this one?
Sound complicated. And no it doesnt jump to next mission if you finish that one, it wont give next mission until you get required level for it
 
Sound complicated. And no it doesnt jump to next mission if you finish that one, it wont give next mission until you get required level for it
it doesnt you already have incremention storage
  1. function tasks:getOnTaskStorage(task)
  2. return tonumber(6520000 + (task * 10))
  3. end

  4. function tasks:getMonstersStorage(task)
  5. return tonumber(6520001 + (task * 10))
  6. end

  7. function tasks:getCompletedStorage(task)
  8. return tonumber(6520002 + (task * 10))
  9. end

  10. function tasks:getFinishedStorage(task)
  11. return tonumber(6520003 + (task * 10))
  12. end

  13. function tasks:getCanceledStorage(task)
  14. return tonumber(6520004 + (task * 10))
  15. end
there is nothing looking for said storage when printig eg. if getOnTaskStorage(taskid) != 0 then do nothing else sendplayermessage mission for you blabala
 
it doesnt you already have incremention storage
  1. function tasks:getOnTaskStorage(task)
  2. return tonumber(6520000 + (task * 10))
  3. end

  4. function tasks:getMonstersStorage(task)
  5. return tonumber(6520001 + (task * 10))
  6. end

  7. function tasks:getCompletedStorage(task)
  8. return tonumber(6520002 + (task * 10))
  9. end

  10. function tasks:getFinishedStorage(task)
  11. return tonumber(6520003 + (task * 10))
  12. end

  13. function tasks:getCanceledStorage(task)
  14. return tonumber(6520004 + (task * 10))
  15. end
there is nothing looking for said storage when printig eg. if getOnTaskStorage(taskid) != 0 then do nothing else sendplayermessage mission for you blabala
what?????
"there is nothing looking for said storage when printig eg. if getOnTaskStorage(taskid) != 0 then do nothing else sendplayermessage mission for you blabala"
 
kiedy twoje funkcje wysylaja graczowi wiadomosc nie maja storageID do sprawdzenia napisz skrypt ktory bedzie sprawdzal czy owy storage id jest przypisany jezeli nie wyslij wiadomosc tego taska i potem daj StorageID zeby przy sprawdzaniu drugi raz jej juz nie wysylal.
 
kiedy twoje funkcje wysylaja graczowi wiadomosc nie maja storageID do sprawdzenia napisz skrypt ktory bedzie sprawdzal czy owy storage id jest przypisany jezeli nie wyslij wiadomosc tego taska i potem daj StorageID zeby przy sprawdzaniu drugi raz jej juz nie wysylal.
What? fdgrt sdfsdg pierdole storageid kurwa dgfertew eroqos ortkbks df ekrtweldklfsd StorageID
 
What? fdgrt sdfsdg pierdole storageid kurwa dgfertew eroqos ortkbks df ekrtweldklfsd StorageID
why u use kurwa in nickname if you dont want to be perceived as polish person? i tried expalining to you in english maybe go to br forum look for help if you cant understand
make storageID that checks before printing(telling the fkn player what task he is o n) if player seen the message what you expect me write you new script? lol
 
why u use kurwa in nickname if you dont want to be perceived as polish person? i tried expalining to you in english maybe go to br forum look for help if you cant understand
make storageID that checks before printing(telling the fkn player what task he is o n) if player seen the message what you expect me write you new script? lol
Well it was first word that came in my head when i though about nickname since otland is about tibia so i though "kurwa" would fit well. Dont tell me where to post you polish swine. You just need to learn how to type solution properly because your sentences make no sense in english and programming. Anyway i found solution not even close to your poorly described idea. Good luck sir.
 
Back
Top