Everyone who has never used our Bots before, can test each one for 2 days without any limitation.
The trial is given automatically when you login on the Bot, but in some cases it wouldn't work (security reasons).
If this happens, send me a private message and i will be checking the failed trials manually and adding it for those who didn't get it.
We are looking for resellers who may accept payment methods different from ours, including classictibia's cash, realesta's cash, mastercores' cash, etc. Interested? Click here at anytime.



Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VIP alarm only once on log in/out
#1
Hello again!

Is there a way to make a persistant like "VIP Online", but that only triggers the alarm once (once when the person logs in, and once when the person logs out), instead of usual constant nonstop alarm? Thanks in advance!
Reply

#2
Try this
local LIST = { 'vip one', 'vip two' }

table.lower(LIST)

if CACHE_VIPS == nil then
  CACHE_VIPS = { }
end

local vips = getviplist()
for _, now in ipairs(vips) do
    if table.find(LIST, now.name:lower()) ~= nil then
        for __, before in ipairs(CACHE_VIPS) do
            if now.name == before.name and now.status ~= before.status then
                if now.status then
                    print(now.name .. ' is online.')
                else
                    print(now.name .. ' is offline.')
                end
                playsound('alert_viponline')
                flashclient()
            end
        end
    end
end

CACHE_VIPS = vips
Reply

#3
Hello! I did some testing and this is the output: (I erased the char name)

"19:23:57 - Classictibia OTBot finished loading successfully.
19:29:15 - is online.
19:29:27 - is online.
19:29:30 - is online.
19:29:32 - is online.
19:30:51 - is online.
19:30:57 - is online."

It seems to register as online both logging in and out, looks almost functional
Reply

#4
Hello.

I tested myself and it worked fine, i've added playsound to script that i forgot.
Reply

#5
Hey, thanks for quick reply! Ive messed with it a bit and tried it over with your updated version, but it's still repeating "... online" for both logging in and out, how does it happen that it works over there and not here?
|Only Registered members can see download links. | Click here to buy subscription or here to register.
|Only Registered members can see download links. | Click here to buy subscription or here to register.alt="Tongue" title="Tongue" class="smilie smilie_5" />
Reply

#6
Try this
local LIST = { 'vip one', 'vip two' }

table.lower(LIST)

if CACHE_VIPS == nil then
  CACHE_VIPS = { }
end

local vips = getviplist()
for _, now in ipairs(vips) do
    if table.find(LIST, now.name:lower()) ~= nil then
        for __, before in ipairs(CACHE_VIPS) do
            if now.name == before.name and now.status ~= before.status then
                if now.status == 1 then
                    print(now.name .. ' is online.')
                else
                    print(now.name .. ' is offline.')
                end
                playsound('alert_viponline')
                flashclient()
            end
        end
    end
end

CACHE_VIPS = vips
Reply

#7
It works! You're awesome!
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016