Need Censorbot and slots vs connection bot
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Need Censorbot and slots vs connection bot

Started by Zigurds, 04 March, 2005, 09:19:11

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Zigurds

------------------------------------------------------------------------
-- CENSORBOTS (verlihub version)
------------------------------------------------------------------------

trigs = {["?"]=1,["?"]=2,["?"]=3,["?"]=4,["?"]=5,["?"]=6,["?"]=7,["?"]=8,["?"]=9,["?"]=10,["?"]=11,["?"]=12,["?"]=13,["?"]=14,["?"]=15,["?"]=16,["?"]=17,["?"]=18,["?"]=19,["?"]=20,["?"]=21,["?"]=22,["?"]=23,["?"]=24,["?"]=25,["?"]=26,["?"]=27,["?"]=28,["?"]=29,["?"]=30}
max_class = 3
botname = "-CENSORBOTS-"
iemesls = "6. rule - Only Latvian language"

--------
 
function IsUserAdmin(nick)
res, class = VH:GetUserClass(nick)
if res and class >= max_class then
return true
else
return false
end
end

function cenzura(nick,data)
if not IsUserAdmin(nick) then
for key,a in trigs do
if(string.find(data, key)) then
VH:SendDataToUser("<"..botname.."> "..iemesls,nick)
VH:CloseConnection(nick);
return 0
end
end
end
return 1
end

function VH_OnParsedMsgChat(nick, data)
return cenzura(nick,data)
end

function VH_OnParsedMsgMyINFO(nick, data)
return cenzura(nick,data)
end


---------------------------------------

-- Slots vs Connection Speed by   [aXs] Wellx   11/06-03
-- Thx goes to Sedulus & aMutex for idea's and help
-- This script checks for slots vs speed and Disconnect if not Master/Operator/VIP
-- Optimized a bit made some no-used code at first...p

Connection={}
Connection["28.8Kbps"] = 0   
Connection["33.6Kbps"] = 0
Connection["56Kbps"] = 0
Connection["ISDN"] = 0
Connection["Satellite"] = 0
Connection["Cable"] = 20
Connection["DSL"] = 24
Connection["LAN(T1)"] = 27
Connection["LAN(T3)"] = 30

function DataArrival(curUser, data)
   if strsub( data, 1, 8 ) == "$MyINFO " and (curUser.iProfile < 0 or curUser.iProfile > 2) then
   SlotsCheck(curUser, strsub(data, 1, strlen(data) -1))
   end
end

function SlotsCheck(curUser, myinfo)   
local s,e,Slots,speed = strfind(myinfo, "S:([^,>]+).*>$ $([^$]*)")  
local Slots = tonumber(Slots)  
   if speed then
   local speed = strsub(speed,1,strlen(speed)-1)
      if Connection[speed] and Slots > Connection[speed] then
      curUser:SendPM("<-SLOTBOTS->", "Par daudz atveertu slotu shim piesleegumam! Maksimums ir ("..Connection[speed]..") Tev atveerti ("..Slots..") sloti")
--      SendToOps("<-SLOTBOTS->","*** Juuzeris <"..curUser.sName.."> IP <" ..curUser.sIP.."> Nepareizs slotu skaits! Atvienots:)")
      curUser:Disconnect()
      end
   end
end

----------------------------------------------------
owner for Latvian hub Alfa

SMF spam blocked by CleanTalk