Author Topic: Bit of help please ....  (Read 2484 times)

0 Members and 1 Guest are viewing this topic.

Offline Tw?sT?d-d?v

  • Lord
  • ***
  • Posts: 436
  • Karma: +79/-2
    • EURO-OP
Bit of help please ....
« 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 ...   
Code: [Select]
--------------------------------------------------------------------------------
-- 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  ....   

PtokaX forum

Bit of help please ....
« on: 14 February, 2008, 20:20:32 »

Offline Tw?sT?d-d?v

  • Lord
  • ***
  • Posts: 436
  • Karma: +79/-2
    • EURO-OP
Re: Bit of help please ....
« Reply #1 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?

Offline Tw?sT?d-d?v

  • Lord
  • ***
  • Posts: 436
  • Karma: +79/-2
    • EURO-OP
Re: Bit of help please ....
« Reply #2 on: 15 February, 2008, 23:10:34 »
Cool tyvm   
btw  when does the  "American Idiot manual"  come out    :P

PtokaX forum

Re: Bit of help please ....
« Reply #2 on: 15 February, 2008, 23:10:34 »