PtokaX forum

Development Section => Your Developing Problems => Topic started by: Tw?sT?d-d?v on 14 February, 2008, 20:20:32

Title: Bit of help please ....
Post by: Tw?sT?d-d?v on 14 February, 2008, 20:20:32
Ive been working on a anti-advert script for the new api and i would like to know the best way to make a cmd add a word to a .TBL file

Here is rough script so far ...   

--------------------------------------------------------------------------------
-- Simple Anti-Advert Blocker
-- Added allowed profile option
-- Added .TBL file
--------------------------------------------------------------------------------
---   Config Stuff
 
Antiadds = {
             adds = "adds.tbl",
}
Allowed = {
                      [0] = 1, -- Master
                      [1] = 0, -- Operator
                      [2] = 0,   -- VIP
                      [3] = 0,   -- Reg
                      [-1] = 0,  -- User
}
Messagetosend = {
                   mess = "Sorry, your PM was blocked. Please use main chat to post adverts!"
}
Bot = {
       bot = "{-Twisteds-Soul-}"
}
--------------------------------------------------------------
OnStartup = function()
if loadfile(Antiadds.adds) then dofile(Antiadds.adds) end
end

Bot = Bot.bot
function ToArrival(user,data)
Core.GetUserAllData(user)
if user.iProfile ~= 0 then
for key,a in pairs(adds) do
if( string.find(string.lower(data), key) ) then
Core.SendPmToNick(user.sNick,Bot, (Messagetosend.mess)) 
return true
end
end
end
end


Ive looked at other scripts but cant get my head round it  ....   
Title: Re: Bit of help please ....
Post by: Tw?sT?d-d?v on 15 February, 2008, 08:00:43
Nice  ty :)     
Ive noticed in the notes of the px rc builds that the Lua has bee upgraded.     
Upgraded: Lua to 5.1.3.
Are there any main differances between the lua previous?
Title: Re: Bit of help please ....
Post by: Tw?sT?d-d?v on 15 February, 2008, 23:10:34
Cool tyvm   
btw  when does the  "Mutor manual"  come out    :P