PtokaX forum

Archive => Archived 5.0 boards => Help with scripts => Topic started by: Creative on 13 December, 2006, 09:56:19

Title: Block Command script
Post by: Creative on 13 December, 2006, 09:56:19
Hi every1, i wanted some changes in the following script. Like if any user types a command, thn it will be blocked directly without warning and no msg will be shown to him in main or pm and also no msg will be sent to OP or Master.

Also if u can, thn make a change so tht if a user types a command which i hve blocked, thn just the command will be shown in main and tht too every1 can c tht command typed by tht user..........
--[[
Quiz-Guardian Version 1.3 Lua 5.02/5.1 by Toobster?? 03/07/2006
As requested by Silverback??
Thanks to Mutor For Help on Conversion to 5.1
***IMPORTANT*** This script MUST be placed above quiz script in Ptokax GUI,
otherwise quiz will accept command before it can be blocked
]]--
--================Config Settings ================================
Bot = "Quiz-Guardian" -- Bot Nick
HubOwner = "Toobster??" -- Hub Owner Nick
HubName = frmHub:GetHubName()
--================Blocked Commands=============================
Blocked = {
"triviascorereset",
"trivstart",
"trivstop",
}
--================How Offender Is Punished========================
-- ( 0=Warn / 1=Disconnect / 2=Kick / 3=Ban)
Action = 1
--================DO NOT EDIT BELOW==========================
function ChatArrival(user, data)
if user.sName ~= HubOwner then
data = string.lower(data)
for id, word in ipairs(Blocked) do
if string.find(data, word, 1, 1) then
SendPmToNick(HubOwner, Bot, user.sName .." Is Messing With Trivia in "..HubName..
", Here Is The Proof - " ..data)
user:SendPM(HubOwner,  "THIS IS AN AUTO RESPONSE MESSAGE \r\n\r\n You have been "..
"reported for messing with Quiz,DO NOT do it again \r\n\r\n Here is the proof: " ..data)
local action = Actions[Action](user,data)
SendPmToOps(Bot, user.sName.." ( "..user.sIP.." )  is "..action.." by "..HubOwner..
" because - Fucking With My Quiz" ..data)
return 1
end
end
end
end


Title: Re: Block Command script
Post by: bastya_elvtars on 13 December, 2006, 16:27:53
Please use proper English in the forums, I had a hard time decrypting your post. :)
Title: Re: Block Command script
Post by: Alexinno on 13 December, 2006, 21:09:52
Quote from: SwapY on 13 December, 2006, 09:56:19
Hi every1, i wanted some changes in the following script. Like if any user types a command, thn it will be blocked directly without warning and no msg will be shown to him in main or pm and also no msg will be sent to OP or Master.

Also if u can, thn make a change so tht if a user types a command which i hve blocked, thn just the command will be shown in main and tht too every1 can c tht command typed by tht user..........

my english is bad too , but i can't understand almost nothing from he's request :D
Title: Re: Block Command script
Post by: Dessamator on 13 December, 2006, 21:22:19
Im not sure , but I think he doesnt want the ops to be reported when a blocked command is typed,and he wants the command to be seen by all users.
Title: Re: Block Command script
Post by: achiever on 14 December, 2006, 16:02:46
hi,

lol i did not think ppl here could become so much dum in understanding things  :D

well swapy i have tried to make the changes u asked for:-
note:- this my first try at a script so bare with me if this wont work  ;)
--[[
Quiz-Guardian Version 1.3 Lua 5.02/5.1 by Toobster?? 03/07/2006
As requested by Silverback??
Thanks to Mutor For Help on Conversion to 5.1
***IMPORTANT*** This script MUST be placed above quiz script in Ptokax GUI,
otherwise quiz will accept command before it can be blocked
]]--
--================Config Settings ================================
Bot = "Quiz-Guardian" -- Bot Nick
HubOwner = "Toobster??" -- Hub Owner Nick
HubName = frmHub:GetHubName()
--================Blocked Commands=============================
Blocked = {
"triviascorereset",
"trivstart",
"trivstop",
}
--================Main Function=============================
function ChatArrival(user, data)
if user.sName ~= HubOwner then
data = string.lower(data)
for id, word in ipairs(Blocked) do
if string.find(data, word, 1, 1) then
return 1
end
end
end
end


this wont make the command seen by all but should work otherwise  :)

bye,

achiever
Title: Re: Block Command script
Post by: Creative on 21 December, 2006, 11:30:36
dude, it works fine but if i wanna block commands like +astop or +nstop thn it doesnt works..........
Title: Re: Block Command script
Post by: achiever on 21 December, 2006, 15:52:46
Quote from: SwapY on 21 December, 2006, 11:30:36
dude, it works fine but if i wanna block commands like +astop or +nstop thn it doesnt works..........

plzz make sure of this
***IMPORTANT*** This script MUST be placed above quiz script in Ptokax GUI,
otherwise quiz will accept command before it can be blocked


and post ur progress  :)

mean while here is the other version of script which will block command according to profiles
--[[***IMPORTANT*** This script MUST be placed above quiz script in Ptokax GUI,
otherwise quiz will accept command before it can be blocked
]]--
-================Config Settings ================================
Bot = "Quiz-Guardian" -- Bot Nick
HubOwner = "Toobster??" -- Hub Owner Nick
HubName = frmHub:GetHubName()
--================Blocked Commands=============================
Blocked = {
"triviascorereset", --add ur commands here
"numstop",
"astop",
}
--================Main Function=============================
function ChatArrival(user, data)
if user.iProfile ==  3 then --profile is set to reg
if user.sName ~= HubOwner then
data = string.lower(data)
for id, word in ipairs(Blocked) do
if string.find(data, word, 1, 1) then
user:SendData("***Write ur message here ")
return 1
end
end
end
end
end


and block commands according to file share size of user
--[[***IMPORTANT*** This script MUST be placed above quiz script in Ptokax GUI,
otherwise quiz will accept command before it can be blocked
thks to SNOOZE for all the help  ;)
]]--
-================Config Settings ================================
Bot = "Quiz-Guardian" -- Bot Nick
HubOwner = "Toobster??" -- Hub Owner Nick
HubName = frmHub:GetHubName()
--================Blocked Commands=============================
Blocked = {
"triviascorereset", --add ur commands here
"numstop",
"astop",
}
--================Main Function=============================
function ChatArrival(user, data)
if (user.iShareSize/1024/1024/1024) < 1 then --this size is in gb
if user.sName ~= HubOwner then
data = string.lower(data)
for id, word in ipairs(Blocked) do
if string.find(data, word, 1, 1) then
user:SendData("*** Write ur message here  ")
return 1
end
end
end
end
end

all the sugestions to change and improve are most welcome  :)

achiever