RBN
(Junior Member)
**

Registration Date: 02-19-2021
Date of Birth: Not Specified
Local Time: 03-02-2021 at 10:02 AM
Status: Offline

RBN's Forum Info
Joined: 02-19-2021
Last Visit: Yesterday, 12:45 AM
Total Posts: 2 (0.18 posts per day | 0.13 percent of total posts)
(Find All Posts)
Total Threads: 0 (0 threads per day | 0 percent of total threads)
Time Spent Online: 22 Minutes, 55 Seconds
Members Referred: 0
Total Likes Received: 1 (0.09 per day | 0.23 percent of total 435)
(Find All Threads Liked ForFind All Posts Liked For)
Total Likes Given: 0 (0 per day | 0 percent of total 435)
(Find All Liked ThreadsFind All Liked Posts)
Reputation: 1 [Details]
  
RBN's Most Liked Post
Post Subject Numbers of Likes
RE: Player attack ALARM doesn't work (vithrax 1.2) 1
Thread Subject Forum Name
Player attack ALARM doesn't work (vithrax 1.2) Requests
Post Message
Problem: "mode == 16" on

Code:
onTextMessage(function(mode, text)
    if storage[alarmsPanelName].enabled and storage[alarmsPanelName].playerAttack and mode == 16 and string.match(text, "hitpoints due to an attack") and not string.match(text, "hitpoints due to an attack by a ") then
        playSound("/sounds/Player_Attack.ogg")
    end
end)

remove all, change to

Code:
onTextMessage(function(mode, text)
    if storage[alarmsPanelName].enabled and storage[alarmsPanelName].playerAttack and string.match(text, "You lose") and string.match(text, "hitpoints due to an attack by") and not string.match(text, "hitpoints due to an attack by a") then
        local name
        local count = 0
        for attack in string.gmatch(text, "([^%s]+)") do
            if count > 8 then
                if name == nil then
                    name = attack
                else
                    name = name.." "..attack
                end
            end
            count = count + 1
        end
        name = name:gsub("%.", "")
        local attacker = getCreatureByName(name)
        if attacker and attacker:isPlayer() then
            playSound("/sounds/Player_Attack.ogg")
        end
    end
end)